new.response: new.response

Description Usage Arguments Details Value Author(s) Examples

View source: R/response.R

Description

Build a new AnalysisPageResponse object

Usage

1
new.response(body, content.type, status = 200, headers = character())

Arguments

body

Either a raw vector or a character vector that constitutes the response body.

content.type

A string giving the content-type, such as "text/plain"

status

Integer. An HTTP response status. Default, 200, means HTTP_OK

headers

Named charvec of extra HTTP headers. Default: character() (none)

Details

A handler may return an AnalysisPageResponse object, which is basically a complete response, if it doesn't want the framework to do any extra processing. This allows complete control over the response.

Value

AnalysisPageResponse object

Author(s)

Brad Friedman

Examples

1
2
3
poem.file <- system.file("examples/in-a-station-of-the-metro.html", package="AnalysisPageServer")
poem.html <- readLines(poem.file, warn = FALSE)
new.response(paste0(poem.html, "\n"), content.type = "text/html")

AnalysisPageServer documentation built on April 28, 2020, 6:32 p.m.