Class: Headers
Represents the headers of the inbound request.
Methods
hasHeader | Checks whether the requested header key exists in the header map. |
getHeader | Returns the value of the specified header. |
getHeaders | Gets all the header values to which the specified header key maps to. |
getHeaderNames | Gets all the names of the headers of the request. |
getHeader
function getHeader(string headerName) returns string | HeaderNotFoundError
Isolated Function
Returns the value of the specified header. If the specified header key maps to multiple values, the first of these values is returned.
Parameters
- headerName string
The header name
Return Type
(string | HeaderNotFoundError)The first header value for the specified header name or the HeaderNotFoundError
if the header is not
found.
getHeaders
function getHeaders(string headerName) returns string[ ] | HeaderNotFoundError
Isolated Function
Gets all the header values to which the specified header key maps to.
Parameters
- headerName string
The header name
Return Type
(string[ ] | HeaderNotFoundError)The header values the specified header key maps to or the HeaderNotFoundError
if the header is not
found.