Auth0-PHP

HttpResponse
in package

Class HttpResponse.

Table of Contents

decodeContent()  : mixed
Extract the content from an HTTP response and parse as JSON (ResponseInterface).
getContent()  : string
Extract the content from an HTTP response (ResponseInterface).
getHeaders()  : array<string|int, array<string|int, string>>
Extract the headers from an HTTP response (ResponseInterface).
getStatusCode()  : int
Extract the status code from an HTTP response (ResponseInterface).
wasSuccessful()  : bool
Returns true when the ResponseInterface identifies a 200 status code; otherwise false.

Methods

decodeContent()

Extract the content from an HTTP response and parse as JSON (ResponseInterface).

public static decodeContent(ResponseInterface $response) : mixed
Parameters
$response : ResponseInterface

a ResponseInterface instance to extract from

Tags
throws
JsonException

when JSON decoding fails

Return values
mixed

getContent()

Extract the content from an HTTP response (ResponseInterface).

public static getContent(ResponseInterface $response) : string
Parameters
$response : ResponseInterface

a ResponseInterface instance to extract from

Tags
psalm-suppress

RedundantConditionGivenDocblockType

Return values
string

getHeaders()

Extract the headers from an HTTP response (ResponseInterface).

public static getHeaders(ResponseInterface $response) : array<string|int, array<string|int, string>>
Parameters
$response : ResponseInterface

a ResponseInterface instance to extract from

Return values
array<string|int, array<string|int, string>>

getStatusCode()

Extract the status code from an HTTP response (ResponseInterface).

public static getStatusCode(ResponseInterface $response) : int
Parameters
$response : ResponseInterface

a ResponseInterface instance to extract from

Return values
int

wasSuccessful()

Returns true when the ResponseInterface identifies a 200 status code; otherwise false.

public static wasSuccessful(ResponseInterface $response[, int $expectedStatusCode = 200 ]) : bool
Parameters
$response : ResponseInterface

a ResponseInterface instance to extract from

$expectedStatusCode : int = 200

Optional. The status code expected to consider the request successful. Defaults to 200.

Return values
bool

Search results