Elgg  Version 6.1
Public Member Functions | List of all members
Elgg\Http\ResponseBuilder Interface Reference

HTTP response builder interface. More...

Inheritance diagram for Elgg\Http\ResponseBuilder:
Elgg\Http\Response Elgg\Http\ErrorResponse Elgg\Http\OkResponse Elgg\Http\RedirectResponse Elgg\Http\DownloadResponse

Public Member Functions

 setContent ($content= '')
 Sets response body. More...
 
 getContent ()
 Returns response body. More...
 
 setStatusCode (int $status_code)
 Sets response HTTP status code. More...
 
 getStatusCode ()
 Returns status code. More...
 
 setForwardURL (string $forward_url=REFERRER)
 Sets redirect URL. More...
 
 getForwardURL ()
 Returns redirect URL. More...
 
 setHeaders (array $headers=[])
 Sets additional response headers. More...
 
 getHeaders ()
 Returns additional response headers. More...
 
 isInformational ()
 Check if response is informational. More...
 
 isSuccessful ()
 Check if response is successful. More...
 
 isRedirection ()
 Check if response is redirection. More...
 
 isClientError ()
 Check if response is client error. More...
 
 isServerError ()
 Check if response is server error. More...
 
 isOk ()
 Check if response is OK. More...
 
 isNotModified ()
 Check if response has been modified. More...
 
 setException (\Exception $e)
 Set an exception for this response. More...
 
 getException ()
 Get the exception for this reponse. More...
 

Detailed Description

HTTP response builder interface.

Definition at line 13 of file ResponseBuilder.php.

Member Function Documentation

Elgg\Http\ResponseBuilder::getContent ( )

Returns response body.

Returns
mixed

Implemented in Elgg\Http\Response.

Elgg\Http\ResponseBuilder::getException ( )

Get the exception for this reponse.

Returns
|null

Implemented in Elgg\Http\Response.

Elgg\Http\ResponseBuilder::getForwardURL ( )

Returns redirect URL.

Returns
string|null string the forward url, null when no url was set or the constant REFERRER

Implemented in Elgg\Http\Response.

Elgg\Http\ResponseBuilder::getHeaders ( )

Returns additional response headers.

Returns
array

Implemented in Elgg\Http\Response, and Elgg\Http\DownloadResponse.

Elgg\Http\ResponseBuilder::getStatusCode ( )

Returns status code.

Returns
int

Implemented in Elgg\Http\Response.

Elgg\Http\ResponseBuilder::isClientError ( )

Check if response is client error.

Returns
bool

Implemented in Elgg\Http\Response.

Elgg\Http\ResponseBuilder::isInformational ( )

Check if response is informational.

Returns
bool

Implemented in Elgg\Http\Response.

Elgg\Http\ResponseBuilder::isNotModified ( )

Check if response has been modified.

Returns
bool

Implemented in Elgg\Http\Response.

Elgg\Http\ResponseBuilder::isOk ( )

Check if response is OK.

Returns
bool

Implemented in Elgg\Http\Response.

Elgg\Http\ResponseBuilder::isRedirection ( )

Check if response is redirection.

Returns
bool

Implemented in Elgg\Http\Response.

Elgg\Http\ResponseBuilder::isServerError ( )

Check if response is server error.

Returns
bool

Implemented in Elgg\Http\Response.

Elgg\Http\ResponseBuilder::isSuccessful ( )

Check if response is successful.

Returns
bool

Implemented in Elgg\Http\Response.

Elgg\Http\ResponseBuilder::setContent (   $content = '')

Sets response body.

Parameters
mixed$contentContent of the response as a scalar value or an array
Returns
self
Exceptions
InvalidArgumentException

Implemented in Elgg\Http\Response.

Elgg\Http\ResponseBuilder::setException ( \Exception  $e)

Set an exception for this response.

Parameters
\Exception$ethe exception for this response
Returns
self

Implemented in Elgg\Http\Response.

Elgg\Http\ResponseBuilder::setForwardURL ( string  $forward_url = REFERRER)

Sets redirect URL.

Parameters
string$forward_urlForward URL
Returns
self
Exceptions
InvalidArgumentException

Implemented in Elgg\Http\Response, and Elgg\Http\DownloadResponse.

Elgg\Http\ResponseBuilder::setHeaders ( array  $headers = [])

Sets additional response headers.

Parameters
array$headersHeaders
Returns
self

Implemented in Elgg\Http\Response.

Elgg\Http\ResponseBuilder::setStatusCode ( int  $status_code)

Sets response HTTP status code.

Parameters
int$status_codeStatus code
Returns
self
Exceptions
RangeException

Implemented in Elgg\Http\Response.


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