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:

  • name string the name of the value.
  • value string the value to set.
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:

  1. string the header start value.
  2. table a table containing the header value parameters.
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:

  1. string the header start value.
  2. table a table containing the header parameters as key, value.
generated by LDoc 1.4.6