Requests 2.0.11 API

Status411 extends Http
in package

FinalYes

Exception for 411 Length Required responses

Table of Contents

Properties

$code  : int
HTTP status code
$data  : mixed
Data associated with the exception
$reason  : string
Reason phrase
$type  : string
Type of exception

Methods

__construct()  : mixed
Create a new exception
get_class()  : string
Get the correct exception class for a given error code
getData()  : mixed
Gives any relevant data
getReason()  : string
Get the status message.
getType()  : string
Like {@see \Exception::getCode()}, but a string code.

Properties

$code

HTTP status code

protected int $code = 411

$data

Data associated with the exception

protected mixed $data

$reason

Reason phrase

protected string $reason = 'Length Required'

$type

Type of exception

protected string $type

Methods

__construct()

Create a new exception

public __construct(string $message, string $type[, mixed $data = null ][, int $code = 0 ]) : mixed
Parameters
$message : string

Exception message

$type : string

Exception type

$data : mixed = null

Associated data

$code : int = 0

Exception numerical code, if applicable

get_class()

Get the correct exception class for a given error code

public static get_class(int|bool $code) : string
Parameters
$code : int|bool

HTTP status code, or false if unavailable

Return values
string

Exception class name to use

getData()

Gives any relevant data

public getData() : mixed

getReason()

Get the status message.

public getReason() : string
Return values
string

getType()

Like {@see \Exception::getCode()}, but a string code.

public getType() : string
Return values
string

        
On this page

Search results