Module jls.net.http.HttpHeaders
This class provides common behavior for HTTP headers.
Class HttpHeaders
HttpHeaders:new () | Creates a new Headers. |
httpHeaders:getHeader (name) | Returns the header value for the specified name. |
httpHeaders:clearHeaders () | Removes all the header values. |
httpHeaders:setHeader (name, value) | Sets the specified header value. |
httpHeaders:addHeaderValue (name, value) | Adds the specified header value. |
HttpHeaders.parseHeaderValue (value) | Returns the header start value and a table containing the header value parameters. |
HttpHeaders.parseHeaderValueAsTable (value) | Returns the header start value and a table containing the header value parameters. |
Class HttpHeaders
The HttpHeaders class represents the headers for HTTP message.
- HttpHeaders:new ()
- Creates a new Headers.
- httpHeaders:getHeader (name)
-
Returns the header value for the specified name.
This is the raw value and may contains multiple entries.
Parameters:
- name string the name of the header.
Returns:
-
string
the header value corresponding to the name or nil if there is no such header.
- httpHeaders:clearHeaders ()
- Removes all the header values.
- httpHeaders:setHeader (name, value)
-
Sets the specified header value.
This is the raw value and may contains multiple entries.
Parameters:
- name string the name of the value.
- value the value to set.
- httpHeaders:addHeaderValue (name, value)
-
Adds the specified header value.
Parameters:
- HttpHeaders.parseHeaderValue (value)
-
Returns the header start value and a table containing the header value parameters.
Parameters:
- value string the header value to parse.
Returns:
- HttpHeaders.parseHeaderValueAsTable (value)
-
Returns the header start value and a table containing the header value parameters.
Parameters:
- value string the header value to parse.
Returns: