WonderPush PHP library
  • Namespace
  • Class
Navigation
  • Namespace
  • Class
Namespaces
  • WonderPush
    • Api
    • Errors
    • Net
    • Obj
    • Params
    • Util
Classes
  • CurlHttpClient
  • Request
  • Response
Interfaces
  • HttpClientInterface

Class Response

Represents an HTTP response, with JSON parsing facility.

WonderPush\Obj\BaseObject implements WonderPush\Util\JsonSerializable
┗ WonderPush\Net\Response
Namespace: WonderPush\Net
Located at Net/Response.php

Methods summary

public getRequest( void ) : WonderPush\Net\Request

Returns

WonderPush\Net\Request
public setRequest( WonderPush\Net\Request $request ) : WonderPush\Net\Response

Parameters

$request

Returns

WonderPush\Net\Response
public getStatusCode( void ) : integer

The HTTP Status code.

The HTTP Status code.

Returns

integer
public setStatusCode( integer $statusCode ) :

Set the HTTP Status code.

Set the HTTP Status code.

Parameters

$statusCode

Returns


$this
public getHeaders( void ) : string[]

The HTTP headers.

The HTTP headers.

Returns

string[]
public setHeaders( string[] $headers ) :

Set the HTTP headers.

Set the HTTP headers.

Parameters

$headers

Returns


$this
public getRawBody( void ) : string

The raw HTTP body.

The raw HTTP body.

Returns

string
public setRawBody( string $rawBody ) :

Set the raw HTTP body.

Set the raw HTTP body.

Parameters

$rawBody

Returns


$this
public parseError( void ) : WonderPush\Errors\Base

The error code encountered while parsing the body, if any.

The error code encountered while parsing the body, if any.

Returns

WonderPush\Errors\Base
public parsedBody( void ) : mixed

The parsed body, or a WonderPush\Errors\Parsing.

The parsed body, or a WonderPush\Errors\Parsing.

Returns

mixed
public exception( void ) : null|WonderPush\Errors\Base

Returns an exception when there was an error making the call, or if the server returned an error response.

Returns an exception when there was an error making the call, or if the server returned an error response.

Returns

null|WonderPush\Errors\Base
public checkedResult( $cls ) : mixed

Returns the result instantiated with provided $cls or throws when request had error.

Returns the result instantiated with provided $cls or throws when request had error.

Parameters

$cls

Returns

mixed

Throws

WonderPush\Errors\Base

Methods inherited from WonderPush\Obj\BaseObject

__construct(), __toString(), _new(), clearAllFields(), deepClone(), jsonSerialize(), toArray(), toData()

WonderPush PHP library API documentation generated by ApiGen