HTTP Response Parser

package SimplePie
subpackage HTTP

 Methods

Create an instance of the class with the input data

__construct(string $data) 

Parameters

$data

string

Input data

Parse the input data

parse() : boolean

Returns

booleantrue on success, false on failure

Parse the body

body() 

Parsed a "Transfer-Encoding: chunked" body

chunked() 

Check whether there is data beyond the pointer

has_data() : boolean

Returns

booleantrue if there is further data, false if not

Parse the HTTP version

http_version() 

See if the next character is LWS

is_linear_whitespace() : boolean

Returns

booleantrue if the next character is LWS, false if not

Parse LWS, replacing consecutive LWS characters with a single space

linear_whitespace() 

Parse a header name

name() 

Deal with a new line, shifting data around as needed

new_line() 

See what state to move to while within quoted header values

quote() 

Parse a header value while within quotes

quote_char() 

Parse an escaped character within quotes

quote_escaped() 

Parse the reason phrase

reason() 

Parse the status code

status() 

See what state to move to while within non-quoted header values

value() 

Parse a header value while outside quotes

value_char() 

 Properties

 

Body of the response

$body : string

Default

''
 

Key/value pairs of the headers

$headers : array

Default

array()
 

HTTP Version

$http_version : float

Default

0.0
 

Reason phrase

$reason : string

Default

''
 

Status code

$status_code : integer

Default

0
 

Input data

$data : string

Default

''
 

Input data length (to avoid calling strlen() everytime this is needed)

$data_length : integer

Default

0
 

Name of the hedaer currently being parsed

$name : string

Default

''
 

Current position of the pointer

$position : integer

Default

0
 

Current state of the state machine

$state : string

Default

'http_version'
 

Value of the hedaer currently being parsed

$value : string

Default

''