Class coroner.protocol.http

HTTP (Hypertext Transfer Protocol) dissector.

Methods

coroner.protocol.http:new (packet) Create a new object.
coroner.protocol.http:parse () Parse the packet data.
coroner.protocol.http:type () Get the module name.
coroner.protocol.http:set_packet (packet) Change or set new packet data.
coroner.protocol.http:is_request () Check if parsed data is HTTP request.
coroner.protocol.http:get_version () Get HTTP version string.
coroner.protocol.http:get_method () Get request method.
coroner.protocol.http:get_uri () Get URI specified in a request.
coroner.protocol.http:get_statuscode () Get response status code.
coroner.protocol.http:get_response () Get HTTP response.
coroner.protocol.http:get_header (name) Get HTTP header field by name.
coroner.protocol.http:get_error () Get last error message.


Methods

coroner.protocol.http:new (packet)
Create a new object.

Parameters:

  • packet string pass packet data as an opaque string

Returns:

    table New http table.
coroner.protocol.http:parse ()
Parse the packet data.

Returns:

    boolean True on success, false on failure (error message is set).

See also:

coroner.protocol.http:type ()
Get the module name.

Returns:

    string Module name.
coroner.protocol.http:set_packet (packet)
Change or set new packet data.

Parameters:

  • packet string byte string of packet data
coroner.protocol.http:is_request ()
Check if parsed data is HTTP request.

Returns:

    boolean True/False.
coroner.protocol.http:get_version ()
Get HTTP version string.

Returns:

    string Returns either 1.1 or 1.0.
coroner.protocol.http:get_method ()
Get request method. Calling this function makes sense only for HTTP requests.

Returns:

    string Name of the method or nil.
coroner.protocol.http:get_uri ()
Get URI specified in a request. Calling this function makes sense only for HTTP requests.

Returns:

    string URI.
coroner.protocol.http:get_statuscode ()
Get response status code. Calling this function makes sense only for HTTP responses.

Returns:

    integer Status code.
coroner.protocol.http:get_response ()
Get HTTP response. Calling this function makes sense only for HTTP responses.

Returns:

    string Status code and response name.
coroner.protocol.http:get_header (name)
Get HTTP header field by name.

Parameters:

  • name string Lower-case name of the header field.

Returns:

    string Header field value or nil.
coroner.protocol.http:get_error ()
Get last error message.

Returns:

    string Error message.
generated by LDoc 1.4.3 Last updated 2016-08-15 00:59:34