Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

Trait implementing functionality common to requests and responses.

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

Defines 16 functions


Functions that are not part of a class:

getProtocolVersion()   X-Ref
No description

withProtocolVersion($version)   X-Ref
No description

getHeaders()   X-Ref
No description

hasHeader($header)   X-Ref
No description

getHeader($header)   X-Ref
No description

getHeaderLine($header)   X-Ref
No description

withHeader($header, $value)   X-Ref
No description

withAddedHeader($header, $value)   X-Ref
No description

withoutHeader($header)   X-Ref
No description

getBody()   X-Ref
No description

withBody(StreamInterface $body)   X-Ref
No description

setHeaders(array $headers)   X-Ref

param: array<string|int, string|string[]> $headers

normalizeHeaderValue($value)   X-Ref

param: mixed $value
return: string[]

trimAndValidateHeaderValues(array $values)   X-Ref
Trims whitespace from the header values.

Spaces and tabs ought to be excluded by parsers when extracting the field value from a header field.

header-field = field-name ":" OWS field-value OWS
OWS          = *( SP / HTAB )

param: mixed[] $values Header values
return: string[] Trimmed header values

assertHeader($header)   X-Ref

param: mixed $header

assertValue(string $value)   X-Ref