Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250530) (c39b7370636)
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' in the returned value - but that would be a weird API... (note that we still need to always have headers parsed for content charset)

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