ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
This is the abstract base class for both the Request and Response objects. More...
Public Member Functions | |
getBodyAsStream () | |
Returns the body as a readable stream resource. More... | |
getBodyAsString () | |
Returns the body as a string. More... | |
getBody () | |
Returns the message body, as it's internal representation. More... | |
setBody ($body) | |
Replaces the body resource with a new stream or string. More... | |
getHeaders () | |
Returns all the HTTP headers as an array. More... | |
hasHeader ($name) | |
Will return true or false, depending on if a HTTP header exists. More... | |
getHeader ($name) | |
Returns a specific HTTP header, based on it's name. More... | |
getHeaderAsArray ($name) | |
Returns a HTTP header as an array. More... | |
setHeader ($name, $value) | |
Updates a HTTP header. More... | |
setHeaders (array $headers) | |
Sets a new set of HTTP headers. More... | |
addHeader ($name, $value) | |
Adds a HTTP header. More... | |
addHeaders (array $headers) | |
Adds a new set of HTTP headers. More... | |
removeHeader ($name) | |
Removes a HTTP header. More... | |
setHttpVersion ($version) | |
Sets the HTTP version. More... | |
getHttpVersion () | |
Returns the HTTP version. More... | |
Protected Attributes | |
$body | |
$headers = [] | |
$httpVersion = '1.1' | |
This is the abstract base class for both the Request and Response objects.
This object contains a few simple methods that are shared by both.
Definition at line 14 of file Message.php.
Sabre\HTTP\Message::addHeader | ( | $name, | |
$value | |||
) |
Adds a HTTP header.
This method will not overwrite any existing HTTP header, but instead add another value. Individual values can be retrieved with getHeadersAsArray.
string | $name | |
string | $value |
Implements Sabre\HTTP\MessageInterface.
Definition at line 235 of file Message.php.
References $name.
Referenced by Sabre\HTTP\Message\addHeaders().
Sabre\HTTP\Message::addHeaders | ( | array | $headers | ) |
Adds a new set of HTTP headers.
Any existing headers will not be overwritten.
array | $headers |
Implements Sabre\HTTP\MessageInterface.
Definition at line 260 of file Message.php.
References $name, and Sabre\HTTP\Message\addHeader().
Sabre\HTTP\Message::getBody | ( | ) |
Returns the message body, as it's internal representation.
This could be either a string or a stream.
Implements Sabre\HTTP\MessageInterface.
Definition at line 92 of file Message.php.
References Sabre\HTTP\Message\$body.
Referenced by Sabre\HTTP\Message\getBodyAsStream(), and Sabre\HTTP\Message\getBodyAsString().
Sabre\HTTP\Message::getBodyAsStream | ( | ) |
Returns the body as a readable stream resource.
Note that the stream may not be rewindable, and therefore may only be read once.
Implements Sabre\HTTP\MessageInterface.
Definition at line 47 of file Message.php.
References Sabre\HTTP\Message\$body, GuzzleHttp\Psr7\$stream, and Sabre\HTTP\Message\getBody().
Sabre\HTTP\Message::getBodyAsString | ( | ) |
Returns the body as a string.
Note that because the underlying data may be based on a stream, this method could only work correctly the first time.
Implements Sabre\HTTP\MessageInterface.
Definition at line 68 of file Message.php.
References Sabre\HTTP\Message\$body, $contentLength, Sabre\HTTP\Message\getBody(), and Sabre\HTTP\Message\getHeader().
Referenced by Sabre\HTTP\Response\__toString(), Sabre\HTTP\Request\__toString(), and Sabre\DAV\Locks\Plugin2Test\testUnlockAfterDelete().
Sabre\HTTP\Message::getHeader | ( | $name | ) |
Returns a specific HTTP header, based on it's name.
The name must be treated as case-insensitive. If the header does not exist, this method must return null.
If a header appeared more than once in a HTTP request, this method will concatenate all the values with a comma.
Note that this not make sense for all headers. Some, such as Set-Cookie
cannot be logically combined with a comma. In those cases you should use getHeaderAsArray().
string | $name |
Implements Sabre\HTTP\MessageInterface.
Definition at line 154 of file Message.php.
References $name.
Referenced by Sabre\HTTP\Message\getBodyAsString().
Sabre\HTTP\Message::getHeaderAsArray | ( | $name | ) |
Returns a HTTP header as an array.
For every time the HTTP header appeared in the request or response, an item will appear in the array.
If the header did not exists, this method will return an empty array.
string | $name |
Implements Sabre\HTTP\MessageInterface.
Definition at line 176 of file Message.php.
References $name.
Sabre\HTTP\Message::getHeaders | ( | ) |
Returns all the HTTP headers as an array.
Every header is returned as an array, with one or more values.
Implements Sabre\HTTP\MessageInterface.
Definition at line 116 of file Message.php.
References $result.
Referenced by Sabre\HTTP\Response\__toString(), and Sabre\HTTP\Request\__toString().
Sabre\HTTP\Message::getHttpVersion | ( | ) |
Returns the HTTP version.
Implements Sabre\HTTP\MessageInterface.
Definition at line 309 of file Message.php.
References Sabre\HTTP\Message\$httpVersion.
Sabre\HTTP\Message::hasHeader | ( | $name | ) |
Will return true or false, depending on if a HTTP header exists.
string | $name |
Implements Sabre\HTTP\MessageInterface.
Definition at line 132 of file Message.php.
References $name.
Sabre\HTTP\Message::removeHeader | ( | $name | ) |
Removes a HTTP header.
The specified header name must be treated as case-insensitive. This method should return true if the header was successfully deleted, and false if the header did not exist.
string | $name |
Implements Sabre\HTTP\MessageInterface.
Definition at line 279 of file Message.php.
References $name.
Sabre\HTTP\Message::setBody | ( | $body | ) |
Replaces the body resource with a new stream or string.
resource | string | $body |
Implements Sabre\HTTP\MessageInterface.
Definition at line 103 of file Message.php.
References Sabre\HTTP\Message\$body.
Referenced by Sabre\HTTP\Request\__construct(), and Sabre\HTTP\Response\__construct().
Sabre\HTTP\Message::setHeader | ( | $name, | |
$value | |||
) |
Updates a HTTP header.
The case-sensitivity of the name value must be retained as-is.
If the header already existed, it will be overwritten.
string | $name | |
string|string[] | $value |
Implements Sabre\HTTP\MessageInterface.
Definition at line 199 of file Message.php.
References $name.
Referenced by Sabre\HTTP\Message\setHeaders().
Sabre\HTTP\Message::setHeaders | ( | array | $headers | ) |
Sets a new set of HTTP headers.
The headers array should contain headernames for keys, and their value should be specified as either a string or an array.
Any header that already existed will be overwritten.
array | $headers |
Implements Sabre\HTTP\MessageInterface.
Definition at line 216 of file Message.php.
References $name, and Sabre\HTTP\Message\setHeader().
Referenced by Sabre\HTTP\Request\__construct(), and Sabre\HTTP\Response\__construct().
Sabre\HTTP\Message::setHttpVersion | ( | $version | ) |
Sets the HTTP version.
Should be 1.0 or 1.1.
string | $version |
Implements Sabre\HTTP\MessageInterface.
Definition at line 298 of file Message.php.
References $version.
|
protected |
Definition at line 23 of file Message.php.
Referenced by Sabre\HTTP\Request\__construct(), Sabre\HTTP\Response\__construct(), Sabre\HTTP\Message\getBody(), Sabre\HTTP\Message\getBodyAsStream(), Sabre\HTTP\Message\getBodyAsString(), and Sabre\HTTP\Message\setBody().
|
protected |
Definition at line 30 of file Message.php.
Referenced by Sabre\HTTP\Request\__construct(), and Sabre\HTTP\Response\__construct().
|
protected |
Definition at line 37 of file Message.php.
Referenced by Sabre\HTTP\Message\getHttpVersion().