ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
The MessageInterface is the base interface that's used by both the RequestInterface and ResponseInterface. 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) | |
Updates the body resource with a new stream. 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... | |
The MessageInterface is the base interface that's used by both the RequestInterface and ResponseInterface.
Definition at line 13 of file MessageInterface.php.
Sabre\HTTP\MessageInterface::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 |
Implemented in Sabre\HTTP\Message.
Sabre\HTTP\MessageInterface::addHeaders | ( | array | $headers | ) |
Adds a new set of HTTP headers.
Any existing headers will not be overwritten.
array | $headers |
Implemented in Sabre\HTTP\Message.
Referenced by Sabre\DAV\CorePlugin\httpGet().
Sabre\HTTP\MessageInterface::getBody | ( | ) |
Returns the message body, as it's internal representation.
This could be either a string or a stream.
Implemented in Sabre\HTTP\Message.
Referenced by Sabre\HTTP\Client\createCurlSettingsArray(), Sabre\CardDAV\Plugin\httpAfterGet(), Sabre\CalDAV\Plugin\httpAfterGet(), Sabre\DAV\Sharing\Plugin\httpPost(), Sabre\DAV\CorePlugin\httpPropPatch(), Sabre\DAV\CorePlugin\httpReport(), Sabre\CalDAV\Schedule\Plugin\outboxRequest(), and Sabre\HTTP\Sapi\sendResponse().
Sabre\HTTP\MessageInterface::getBodyAsStream | ( | ) |
Returns the body as a readable stream resource.
Note that the stream may not be rewindable, and therefore may only be read once.
Implemented in Sabre\HTTP\Message.
Referenced by Sabre\DAV\CorePlugin\httpPut().
Sabre\HTTP\MessageInterface::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.
Implemented in Sabre\HTTP\Message.
Referenced by Sabre\DAVACL\Plugin\httpAcl(), Sabre\DAV\Locks\Plugin\httpLock(), Sabre\CalDAV\Plugin\httpMkCalendar(), Sabre\DAV\CorePlugin\httpMkcol(), Sabre\CalDAV\SharingPlugin\httpPost(), and Sabre\DAV\CorePlugin\httpPropFind().
Sabre\HTTP\MessageInterface::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 |
Implemented in Sabre\HTTP\Message.
Referenced by Sabre\DAV\Server\checkPreconditions(), Sabre\DAV\Server\getCopyAndMoveInfo(), Sabre\DAV\PartialUpdate\Plugin\getHTTPUpdateRange(), Sabre\DAV\Server\getIfConditions(), Sabre\CardDAV\Plugin\httpAfterGet(), Sabre\CalDAV\Plugin\httpAfterGet(), Sabre\DAV\CorePlugin\httpGet(), Sabre\CalDAV\ICSExportPlugin\httpGet(), Sabre\DAV\CorePlugin\httpMkcol(), Sabre\DAV\PartialUpdate\Plugin\httpPatch(), Sabre\DAV\Browser\Plugin\httpPOST(), Sabre\CalDAV\Schedule\Plugin\httpPost(), Sabre\DAV\Sharing\Plugin\httpPost(), Sabre\CalDAV\SharingPlugin\httpPost(), Sabre\DAV\CorePlugin\httpPut(), Sabre\DAV\Locks\Plugin\httpUnlock(), Sabre\CalDAV\Schedule\Plugin\scheduleReply(), Sabre\HTTP\Sapi\sendResponse(), and Sabre\DAV\Locks\Plugin\validateTokens().
Sabre\HTTP\MessageInterface::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 |
Implemented in Sabre\HTTP\Message.
Sabre\HTTP\MessageInterface::getHeaders | ( | ) |
Returns all the HTTP headers as an array.
Every header is returned as an array, with one or more values.
Implemented in Sabre\HTTP\Message.
Referenced by Sabre\HTTP\Client\createCurlSettingsArray(), and Sabre\HTTP\Sapi\sendResponse().
Sabre\HTTP\MessageInterface::getHttpVersion | ( | ) |
Returns the HTTP version.
Implemented in Sabre\HTTP\Message.
Referenced by Sabre\HTTP\Sapi\sendResponse().
Sabre\HTTP\MessageInterface::hasHeader | ( | $name | ) |
Will return true or false, depending on if a HTTP header exists.
string | $name |
Implemented in Sabre\HTTP\Message.
Sabre\HTTP\MessageInterface::removeHeader | ( | $name | ) |
Removes a HTTP header.
The specified header name must be treated as case-insenstive. This method should return true if the header was successfully deleted, and false if the header did not exist.
string | $name |
Implemented in Sabre\HTTP\Message.
Sabre\HTTP\MessageInterface::setBody | ( | $body | ) |
Updates the body resource with a new stream.
resource | string | $body |
Implemented in Sabre\HTTP\Message.
Referenced by Sabre\DAV\Mount\Plugin\davMount(), Sabre\CalDAV\ICSExportPlugin\generateResponse(), Sabre\CalDAV\Schedule\Plugin\handleFreeBusyRequest(), Sabre\CardDAV\Plugin\httpAfterGet(), Sabre\CalDAV\Plugin\httpAfterGet(), Sabre\CardDAV\VCFExportPlugin\httpGet(), Sabre\DAV\CorePlugin\httpGet(), Sabre\DAV\Browser\Plugin\httpGet(), Sabre\CalDAV\Notifications\Plugin\httpGet(), Sabre\DAV\TemporaryFileFilterPlugin\httpGet(), Sabre\DAV\CorePlugin\httpHead(), Sabre\DAV\Locks\Plugin\httpLock(), Sabre\DAV\CorePlugin\httpMkcol(), Sabre\CalDAV\SharingPlugin\httpPost(), Sabre\DAV\TemporaryFileFilterPlugin\httpPropfind(), Sabre\DAV\CorePlugin\httpPropFind(), and Sabre\DAV\CorePlugin\httpPropPatch().
Sabre\HTTP\MessageInterface::setHeader | ( | $name, | |
$value | |||
) |
Updates a HTTP header.
The case-sensitity of the name value must be retained as-is.
If the header already existed, it will be overwritten.
string | $name | |
string|string[] | $value |
Implemented in Sabre\HTTP\Message.
Referenced by Sabre\DAV\Server\checkPreconditions(), Sabre\DAV\Mount\Plugin\davMount(), Sabre\CalDAV\ICSExportPlugin\generateResponse(), Sabre\CalDAV\Schedule\Plugin\handleFreeBusyRequest(), Sabre\CardDAV\Plugin\httpAfterGet(), Sabre\CalDAV\Plugin\httpAfterGet(), Sabre\DAV\CorePlugin\httpCopy(), Sabre\DAV\TemporaryFileFilterPlugin\httpDelete(), Sabre\DAV\CorePlugin\httpDelete(), Sabre\CardDAV\VCFExportPlugin\httpGet(), Sabre\DAV\CorePlugin\httpGet(), Sabre\DAV\Browser\Plugin\httpGet(), Sabre\CalDAV\Notifications\Plugin\httpGet(), Sabre\DAV\TemporaryFileFilterPlugin\httpGet(), Sabre\DAV\CorePlugin\httpHead(), Sabre\DAV\Locks\Plugin\httpLock(), Sabre\CalDAV\Plugin\httpMkCalendar(), Sabre\DAV\CorePlugin\httpMkcol(), Sabre\DAV\CorePlugin\httpMove(), Sabre\DAV\CorePlugin\httpOptions(), Sabre\DAV\PartialUpdate\Plugin\httpPatch(), Sabre\DAV\Browser\Plugin\httpPOST(), Sabre\DAV\Sharing\Plugin\httpPost(), Sabre\CalDAV\SharingPlugin\httpPost(), Sabre\DAV\TemporaryFileFilterPlugin\httpPropfind(), Sabre\DAV\CorePlugin\httpPropFind(), Sabre\DAV\CorePlugin\httpPropPatch(), Sabre\DAV\TemporaryFileFilterPlugin\httpPut(), Sabre\DAV\CorePlugin\httpPut(), Sabre\DAV\Locks\Plugin\httpUnlock(), Sabre\DAV\Server\invokeMethod(), and Sabre\CalDAV\Plugin\validateICalendar().
Sabre\HTTP\MessageInterface::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 |
Implemented in Sabre\HTTP\Message.
Sabre\HTTP\MessageInterface::setHttpVersion | ( | $version | ) |
Sets the HTTP version.
Should be 1.0 or 1.1.
string | $version |
Implemented in Sabre\HTTP\Message.