Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
PhpXmlRpc\Helper\Http Class Reference

Public Member Functions

 parseAcceptHeader ($header)
 Parses one of the http headers which can have a list of values with quality param.
 
 parseResponseHeaders (&$data, $headersProcessed=false, $debug=0)
 Parses HTTP an http response's headers and separates them from the body.
 

Static Public Member Functions

static decodeChunked ($buffer)
 

Member Function Documentation

◆ parseAcceptHeader()

PhpXmlRpc\Helper\Http::parseAcceptHeader ( $header)

Parses one of the http headers which can have a list of values with quality param.

See also
https://www.rfc-editor.org/rfc/rfc7231#section-5.3.1
Parameters
string$header
Return values
string[]

◆ parseResponseHeaders()

PhpXmlRpc\Helper\Http::parseResponseHeaders ( & $data,
$headersProcessed = false,
$debug = 0 )

Parses HTTP an http response's headers and separates them from the body.

Parameters
string$datathe http response, headers and body. It will be stripped of headers
bool$headersProcessedwhen true, we assume that response inflating and dechunking has been already carried out
int$debugwhen > 0, logs to screen messages detailing info about the parsed data
Return values
arraywith keys 'headers', 'cookies', 'raw_data' and 'status_code'
Exceptions
HttpException
Todo
if $debug is < 0, we could avoid populating 'raw_data' and 'headers' in the returned value - but that would be a weird API...

The documentation for this class was generated from the following file: