Skip to content

Commit

Permalink
Modernize a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Aug 21, 2024
1 parent 02dc876 commit aaef806
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 15 deletions.
8 changes: 5 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Package: webutils
Type: Package
Title: Utility Functions for Developing Web Applications
Version: 1.2.1
Author: Jeroen Ooms
Maintainer: Jeroen Ooms <[email protected]>
Authors@R: person("Jeroen", "Ooms", role = c("aut", "cre"), email = "[email protected]",
comment = c(ORCID = "0000-0002-4035-0289"))
Description: Parses http request data in application/json, multipart/form-data,
or application/x-www-form-urlencoded format. Includes example of hosting
and parsing html form data in R using either 'httpuv' or 'Rhttpd'.
Expand All @@ -16,5 +16,7 @@ Imports:
Suggests:
httpuv,
testthat
RoxygenNote: 7.0.2
RoxygenNote: 7.3.2.9000
Language: en-US
Roxygen: list(markdown = TRUE)
Encoding: UTF-8
8 changes: 4 additions & 4 deletions R/parse_http.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#' Parse http request
#'
#' Parse the body of a http request, based on the \code{Content-Type} request
#' Parse the body of a http request, based on the `Content-Type` request
#' header. Currently supports the three most important content types:
#' \code{application/x-www-form-urlencoded} (\code{\link{parse_query}}),
#' \code{multipart/form-data} (\code{\link{parse_multipart}}) and
#' \code{application/json} (\code{\link[jsonlite:fromJSON]{fromJSON}}).
#' `application/x-www-form-urlencoded` with [parse_query()],
#' `multipart/form-data` with [parse_multipart()], and `application/json`
#' with [jsonlite::fromJSON()].
#'
#' @export
#' @param body request body of the http request
Expand Down
6 changes: 3 additions & 3 deletions R/parse_multipart.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
#'
#' Parse a multipart/form-data request, which is usually generated from a HTML form
#' submission. The parameters can include both text values as well as binary files.
#' They can be distinguished from the presence of a \code{filename} attribute.
#' They can be distinguished from the presence of a `filename` attribute.
#'
#' A multipart/form-data request consists of a single body which contains one or more
#' values plus meta-data, separated using a boundary string. This boundary string
#' is chosen by the client (e.g. the browser) and specified in the \code{Content-Type}
#' is chosen by the client (e.g. the browser) and specified in the `Content-Type`
#' header of the HTTP request. There is no escaping; it is up to the client to choose
#' a boundary string that does not appear in one of the values.
#'
Expand All @@ -15,7 +15,7 @@
#'
#' @export
#' @param body body of the HTTP request. Must be raw or character vector.
#' @param boundary boundary string as specified in the \code{Content-Type} request header.
#' @param boundary boundary string as specified in the `Content-Type` request header.
#' @examples \dontrun{example form
#' demo_rhttpd()
#' }
Expand Down
4 changes: 2 additions & 2 deletions R/parse_query.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#'
#' For http GET requests, the query string is specified
#' in the URL after the question mark. For http POST or PUT requests, the query
#' string can be used in the request body when the \code{Content-Type} header
#' is set to \code{application/x-www-form-urlencoded}.
#' string can be used in the request body when the `Content-Type` header
#' is set to `application/x-www-form-urlencoded`.
#'
#' @export
#' @param query a url-encoded query string
Expand Down
6 changes: 3 additions & 3 deletions man/parse_http.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit aaef806

Please sign in to comment.