Create an HTTP response object
httpResponse( status = 200L, content_type = "text/html; charset=UTF-8", content = "", headers = list() )
status | HTTP status code for the response. |
---|---|
content_type | The value for the |
content | The body of the response, given as a single-element character vector (will be encoded as UTF-8) or a raw vector. |
headers | A named list of additional headers to include. Do not include
|
httpResponse(status = 405L, content_type = "text/plain", content = "The requested method was not allowed" )#> $status #> [1] 405 #> #> $content_type #> [1] "text/plain" #> #> $content #> [1] "The requested method was not allowed" #> #> $headers #> $headers$`X-UA-Compatible` #> [1] "IE=edge,chrome=1" #> #> #> attr(,"class") #> [1] "httpResponse"