Learn R Programming

AnalysisPageServer (version 1.6.2)

new.response: new.response

Description

Build a new AnalysisPageResponse object

Usage

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)

Value

AnalysisPageResponse object

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.

Examples

Run this code
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")

Run the code above in your browser using DataLab