new.response: new.response

Description Usage Arguments Details Value Author(s) Examples

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")

apomatix/AnalysisPageServer documentation built on May 26, 2019, 11:36 a.m.