new.response {AnalysisPageServer} | R Documentation

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

### 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

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

[Package AnalysisPageServer version 1.16.0 Index]