httpResponse: Create an HTTP response object

Description Usage Arguments Examples

View source: R/middleware.R

Description

Create an HTTP response object

Usage

1
2
3
4
5
6
httpResponse(
  status = 200L,
  content_type = "text/html; charset=UTF-8",
  content = "",
  headers = list()
)

Arguments

status

HTTP status code for the response.

content_type

The value for the Content-Type header.

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 Content-Length (as it is automatically calculated) or Content-Type (the content_type argument is used instead).

Examples

1
2
3
4
httpResponse(status = 405L,
  content_type = "text/plain",
  content = "The requested method was not allowed"
)

shiny documentation built on Jan. 26, 2021, 1:06 a.m.