Learn R Programming

RestRserve (version 0.1.5)

RestRserveRequest: Creates RestRserveRequest object (R6 class)

Description

Called internally for handling incoming requests from Rserve side. Also useful for testing.

  • response = RestRserveRequest$new( path = "/", method = "GET", query = new.env(parent = emptyenv()), headers = new.env(parent = emptyenv()), body = raw(), content_type = "application/octet-stream")

    path

    "/somepath", always character of length 1

    method

    "GET", always character of length 1

    query

    as.environment(list("a" = "1", "b" = "2")), environment, key-value pairs from query parameters.

    body

    • NULL if the http body is empty or zero length.

    • raw vector with a "content-type" attribute in all cases except URL encoded form (if specified in the headers)

    • named characeter vector in the case of a URL encoded form. It will have the same shape as the query string (named string vector)

    headers

    as.environment(list("a" = "1", "b" = "2")), environment, key-value pairs from http-header.

Usage

RestRserveRequest

Arguments

Value

RestRserveRequest object - R6 class:

path

= "/somepath", always character of length 1

method

= "GET", always character of length 1

query

as.environment(list("a" = "1", "b" = "2")), environment, key-value pairs from query parameters.

body

= raw(0).

  • NULL if the http body is empty or zero length.

  • raw vector with a "content-type" attribute in all cases except URL encoded form (if specified in the headers)

  • named characeter vector in the case of a URL encoded form. It will have the same shape as the query string (named string vector).

content_type

= "", always character of length 1

headers

as.environment(list("a" = "1", "b" = "2")), environment, key-value pairs from http-header. According to RFC2616 header field names are case-insensitive. So in RestRserve keys are always in lower case.

Format

An object of class R6ClassGenerator of length 24.