THTTPRequest

THTTPRequest

An THTTPRequest object is created by UB server and passed as the first argument to the endpoint's methods or as a second argument to the rest entity method's event.

It may be used to access HTTP request status, headers and data.

Constructor

new THTTPRequest()

Implements:

Members

decodedParameters: string readonly

URLDecoded parameters
Example
// GET http://host:port/bla-bla?$filter=Name%20eq%20%27John%27
     req.parameters === '$filter=Name%20eq%20%27John%27'
     req.decodedParameters === "$filter=Name eq 'John'"

decodedUri: string readonly

The same as uri, but URLDecode'd
Example
//GET http://host:port/ub/rest/TripPinServiceRW/My%20People"
  req.decodedUri === 'TripPinServiceRW/My People'

headers: string readonly

HTTP request headers

method: string readonly

HTTP request method GET|POST|PUT......

parameters: string readonly

URL parameters. Can be transformed to object using queryString.parse
Example
// GET http://host:port/ub/rest/doc_document/report?id=1&param2=asdas
  req.parameters === 'id=1&param2=asdas'

uri: string readonly

URL WITHOUT appName and endpoint name
Example
// GET http://host:port/ub/rest/doc_document/report?id=1&param2=asdas
  req.uri === 'doc_document/report'

url: string readonly

Full URL
Example
// GET http://host:port/ub/rest/doc_document/report?id=1&param2=asdas
  req.url === 'ub/rest/doc_document/report?id=1&param2=asdas'

Methods

read(encodingopt)ArrayBuffer|String

Read from source
Arguments:
  1. [encoding] (String)  Optional encoding of source. Default to 'utf-8'. If 'bin' - return ArrayBuffer source representation without any conversion. If 'base64' - transform base64 encoded content of source to ArrayBuffer If 'bin2base64' - transform content to base64 encoded string
Implements: