This simple structure simplifies parsing of HTTP request and response headers. It is also capable of parsing SCGI requests.
The first line of request/response - the content of this line is different for response and request.
First, second and third part of the first line. Content is different for response and request.
Http fields as key-value pairs. Keys are converted to lower-case. Note that the same key can be present multiple times.
Set of http response http cookies (filled based on Set-Cookie headers during parsing).
Indicates that this header is a result of parsing scgi.
Returns the first http header field with key id (must be lower-case) or empty string if such field is not present.
Returns the value of first cookie of response (set by Set-Cookie) with name id.
Returns first line fields of http response.
Returns first line fields of http request.
Returns the protocol part of of the first line response.
Returns the return code part of the first line of response.
Returns the reason part of the first line of response.
Returns the method part of the first line of request.
Returns the URI part of the first line of request.
Returns the version part of the first line of request.
Returns true if header has content-length field.
Returns the content length as specified in header or 0 if not specified or header not yet loaded.
Parses the header (all lines of header) into first_line and fields.
Calls Clear and parses the header (all lines of header) into first_line and fields.
Parse SCGI header, resulting state is as if the header parsed was normal HTTP.
Reads the header from socket and parses it. Method detects SCGI requests based on first character of request - if it is a digit, SCGI is assumed and the header is parsed as SCGI.