ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Sabre\HTTP\MessageInterface Interface Reference

The MessageInterface is the base interface that's used by both the RequestInterface and ResponseInterface. More...

+ Inheritance diagram for Sabre\HTTP\MessageInterface:
+ Collaboration diagram for Sabre\HTTP\MessageInterface:

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...
 

Detailed Description

The MessageInterface is the base interface that's used by both the RequestInterface and ResponseInterface.

Author
Evert Pot (http://evertpot.com/) http://sabre.io/license/ Modified BSD License

Definition at line 13 of file MessageInterface.php.

Member Function Documentation

◆ addHeader()

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.

Parameters
string$name
string$value
Returns
void

Implemented in Sabre\HTTP\Message.

◆ addHeaders()

Sabre\HTTP\MessageInterface::addHeaders ( array  $headers)

Adds a new set of HTTP headers.

Any existing headers will not be overwritten.

Parameters
array$headers
Returns
void

Implemented in Sabre\HTTP\Message.

Referenced by Sabre\DAV\CorePlugin\httpGet().

+ Here is the caller graph for this function:

◆ getBody()

Sabre\HTTP\MessageInterface::getBody ( )

Returns the message body, as it's internal representation.

This could be either a string or a stream.

Returns
resource|string

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().

+ Here is the caller graph for this function:

◆ getBodyAsStream()

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.

Returns
resource

Implemented in Sabre\HTTP\Message.

Referenced by Sabre\DAV\CorePlugin\httpPut().

+ Here is the caller graph for this function:

◆ getBodyAsString()

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.

Returns
string

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().

+ Here is the caller graph for this function:

◆ getHeader()

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().

Parameters
string$name
Returns
string|null

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().

+ Here is the caller graph for this function:

◆ getHeaderAsArray()

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.

Parameters
string$name
Returns
string[]

Implemented in Sabre\HTTP\Message.

◆ getHeaders()

Sabre\HTTP\MessageInterface::getHeaders ( )

Returns all the HTTP headers as an array.

Every header is returned as an array, with one or more values.

Returns
array

Implemented in Sabre\HTTP\Message.

Referenced by Sabre\HTTP\Client\createCurlSettingsArray(), and Sabre\HTTP\Sapi\sendResponse().

+ Here is the caller graph for this function:

◆ getHttpVersion()

Sabre\HTTP\MessageInterface::getHttpVersion ( )

Returns the HTTP version.

Returns
string

Implemented in Sabre\HTTP\Message.

Referenced by Sabre\HTTP\Sapi\sendResponse().

+ Here is the caller graph for this function:

◆ hasHeader()

Sabre\HTTP\MessageInterface::hasHeader (   $name)

Will return true or false, depending on if a HTTP header exists.

Parameters
string$name
Returns
bool

Implemented in Sabre\HTTP\Message.

◆ removeHeader()

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.

Parameters
string$name
Returns
bool

Implemented in Sabre\HTTP\Message.

◆ setBody()

◆ setHeader()

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.

Parameters
string$name
string|string[]$value
Returns
void

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().

+ Here is the caller graph for this function:

◆ setHeaders()

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.

Parameters
array$headers
Returns
void

Implemented in Sabre\HTTP\Message.

◆ setHttpVersion()

Sabre\HTTP\MessageInterface::setHttpVersion (   $version)

Sets the HTTP version.

Should be 1.0 or 1.1.

Parameters
string$version
Returns
void

Implemented in Sabre\HTTP\Message.


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