Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 401 and 402] [Versions 401 and 403]

(no description)

File Size: 265 lines (13 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Http:: (2 methods):
  decodeChunked()
  parseResponseHeaders()


Class: Http  - X-Ref

decodeChunked($buffer)   X-Ref
Decode a string that is encoded with "chunked" transfer encoding as defined in rfc2068 par. 19.4.6
Code shamelessly stolen from nusoap library by Dietrich Ayala.

param: string $buffer the string to be decoded
return: string

parseResponseHeaders(&$data, $headersProcessed = false, $debug=0)   X-Ref
Parses HTTP an http response headers and separates them from the body.

param: string $data the http response, headers and body. It will be stripped of headers
param: bool $headersProcessed when true, we assume that response inflating and dechunking has been already carried out
return: array with keys 'headers', 'cookies', 'raw_data' and 'status_code'