new 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.


decodedParameters: stringinstance #

URLDecoded parameters

decodedUri: stringinstance #

The same as uri, but URLDecode'd

headers: stringinstance #

HTTP request headers

method: stringinstance #

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

parameters: stringinstance #

URL parameters. Can be transformed to object using queryString.parse

uri: stringinstance #

URL WITHOUT appName and endpoint name

url: stringinstance #

Full URL


read(encodingopt: String)→ArrayBuffer | Stringinstance#

Read from source


Return String in case no encoding passed or ArrayBuffer

Arguments info:

  • 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

writeToFile(fullFilePath: string)→booleaninstance#

Write request body content (as binary) to a file. Return true on success