Documentation

HttpStatus
in package

Bunch of status codes.

Table of Contents

Constants

ACCEPTED  : mixed = 202
Accepted for processing, but not complete.
BAD_GATEWAY  : mixed = 502
Response not received from upstream.
BAD_REQUEST  : mixed = 400
Generic client error.
CONFLICT  : mixed = 409
Conflict between resources or state.
CONTINUE  : mixed = 100
CREATED  : mixed = 201
Created a new resource.
EXPECTATION_FAILED  : mixed = 417
FORBIDDEN  : mixed = 403
Not permitted, the user _IS_ authenticated.
FOUND  : mixed = 302
Temporarily moved. Use this for GET -> GET.
GATEWAY_TIMEOUT  : mixed = 504
The upstream didn't respond in time.
GONE  : mixed = 410
The resource is no longer available.
INTERNAL_SERVER_ERROR  : mixed = 500
Generic everything is bad.
LENGTH_REQUIRED  : mixed = 411
METHOD_NOT_ALLOWED  : mixed = 405
Method isn't support for the given resource.
MISDIRECTED_REQUEST  : mixed = 421
MOVED_PERMANENT  : mixed = 301
Permanently moved. Use this for GET -> GET.
MULTIPLE_CHOICES  : mixed = 300
Permanently moved. Use this for GET -> GET.
NO_CONTENT  : mixed = 204
No body.
NOT_ACCEPTABLE  : mixed = 406
Content doesn't match the requested accept header.
NOT_FOUND  : mixed = 404
Resource is missing.
NOT_IMPLEMENTED  : mixed = 501
Method or resource is not recognized, but may be later.
NOT_MODIFIED  : mixed = 304
Not modified since 'If-Modified-Since'.
OK  : mixed = 200
Good.
PARTIAL_CONTENT  : mixed = 206
Only part of the result due to a range header.
PAYLOAD_TOO_LARGE  : mixed = 413
PAYMENT_REQUIRED  : mixed = 402
Not ratified into a standard, but use this for whatever as long as it's money related.
PERMANENT_REDIRECT  : mixed = 308
Permanently moved. Use this for POST -> POST and the like.
PRECONDITION_FAILED  : mixed = 412
PRECONDITION_REQUIRED  : mixed = 428
PROXY_AUTHENTICATION_REQUIRED  : mixed = 407
The client must authenticate with the proxy first.
RANGE_NOT_SATISFIABLE  : mixed = 416
The server cannot supply the requested range header.
REQUEST_HEADER_FIELDS_TOO_LARGE  : mixed = 431
REQUEST_TIMEOUT  : mixed = 408
The client did not produce a request before the server gave up.
RESET_CONTENT  : mixed = 205
No content + reset (please).
SEE_OTHER  : mixed = 303
Temporarily moved. Use this for POST/PUT/DELETE -> GET.
SERVICE_UNAVAILABLE  : mixed = 503
Server can't handle it.
STRINGS  : array<int, string> = [self::CONTINUE => 'Continue', self::SWITCHING_...
Status code strings.
SWITCHING_PROTOCOLS  : mixed = 101
TEAPOT  : mixed = 418
Yep.
TEMPORARY_REDIRECT  : mixed = 307
Temporarily moved. Use this for POST -> POST and the like.
TOO_EARLY  : mixed = 425
Unwilling to process a request that might be replayed.
TOO_MANY_REQUESTS  : mixed = 429
Rate-limit reached.
UNAUTHORIZED  : mixed = 401
Not permitted, the user is not yet authenticated.
UNAVAILABLE_FOR_LEGAL_REASONS  : mixed = 451
UNPROCESSABLE_CONTENT  : mixed = 422
UNSUPPORTED_MEDIA_TYPE  : mixed = 415
The content type isn't supported.
URI_TOO_LONG  : mixed = 414

Methods

getStatus()  : string
Get the full status string.
toString()  : string
Convert a code to a string.

Constants

ACCEPTED

Accepted for processing, but not complete.

public mixed ACCEPTED = 202

BAD_GATEWAY

Response not received from upstream.

public mixed BAD_GATEWAY = 502

BAD_REQUEST

Generic client error.

public mixed BAD_REQUEST = 400

CONFLICT

Conflict between resources or state.

public mixed CONFLICT = 409

CREATED

Created a new resource.

public mixed CREATED = 201

EXPECTATION_FAILED

public mixed EXPECTATION_FAILED = 417

FORBIDDEN

Not permitted, the user _IS_ authenticated.

public mixed FORBIDDEN = 403

FOUND

Temporarily moved. Use this for GET -> GET.

public mixed FOUND = 302

GATEWAY_TIMEOUT

The upstream didn't respond in time.

public mixed GATEWAY_TIMEOUT = 504

GONE

The resource is no longer available.

public mixed GONE = 410

INTERNAL_SERVER_ERROR

Generic everything is bad.

public mixed INTERNAL_SERVER_ERROR = 500

LENGTH_REQUIRED

public mixed LENGTH_REQUIRED = 411

METHOD_NOT_ALLOWED

Method isn't support for the given resource.

public mixed METHOD_NOT_ALLOWED = 405

MISDIRECTED_REQUEST

public mixed MISDIRECTED_REQUEST = 421

MOVED_PERMANENT

Permanently moved. Use this for GET -> GET.

public mixed MOVED_PERMANENT = 301

MULTIPLE_CHOICES

Permanently moved. Use this for GET -> GET.

public mixed MULTIPLE_CHOICES = 300

NO_CONTENT

No body.

public mixed NO_CONTENT = 204

NOT_ACCEPTABLE

Content doesn't match the requested accept header.

public mixed NOT_ACCEPTABLE = 406

NOT_FOUND

Resource is missing.

public mixed NOT_FOUND = 404

NOT_IMPLEMENTED

Method or resource is not recognized, but may be later.

public mixed NOT_IMPLEMENTED = 501

NOT_MODIFIED

Not modified since 'If-Modified-Since'.

public mixed NOT_MODIFIED = 304

PARTIAL_CONTENT

Only part of the result due to a range header.

public mixed PARTIAL_CONTENT = 206

PAYLOAD_TOO_LARGE

public mixed PAYLOAD_TOO_LARGE = 413

PAYMENT_REQUIRED

Not ratified into a standard, but use this for whatever as long as it's money related.

public mixed PAYMENT_REQUIRED = 402

PERMANENT_REDIRECT

Permanently moved. Use this for POST -> POST and the like.

public mixed PERMANENT_REDIRECT = 308

PRECONDITION_FAILED

public mixed PRECONDITION_FAILED = 412

PRECONDITION_REQUIRED

public mixed PRECONDITION_REQUIRED = 428

PROXY_AUTHENTICATION_REQUIRED

The client must authenticate with the proxy first.

public mixed PROXY_AUTHENTICATION_REQUIRED = 407

RANGE_NOT_SATISFIABLE

The server cannot supply the requested range header.

public mixed RANGE_NOT_SATISFIABLE = 416

REQUEST_HEADER_FIELDS_TOO_LARGE

public mixed REQUEST_HEADER_FIELDS_TOO_LARGE = 431

REQUEST_TIMEOUT

The client did not produce a request before the server gave up.

public mixed REQUEST_TIMEOUT = 408

RESET_CONTENT

No content + reset (please).

public mixed RESET_CONTENT = 205

SEE_OTHER

Temporarily moved. Use this for POST/PUT/DELETE -> GET.

public mixed SEE_OTHER = 303

SERVICE_UNAVAILABLE

Server can't handle it.

public mixed SERVICE_UNAVAILABLE = 503

STRINGS

Status code strings.

public array<int, string> STRINGS = [self::CONTINUE => 'Continue', self::SWITCHING_PROTOCOLS => 'Switching Protocols', self::OK => 'OK', self::CREATED => 'Created', self::ACCEPTED => 'Accepted', self::NO_CONTENT => 'No Content', self::RESET_CONTENT => 'Reset Content', self::PARTIAL_CONTENT => 'Partial Content', self::MULTIPLE_CHOICES => 'Multiple Choices', self::MOVED_PERMANENT => 'Permanently Moved', self::FOUND => 'Found', self::SEE_OTHER => 'See Other', self::NOT_MODIFIED => 'Not Modified', self::TEMPORARY_REDIRECT => 'Redirect (Temporary)', self::PERMANENT_REDIRECT => 'Redirect (Permanent)', self::BAD_REQUEST => 'Bad Request', self::UNAUTHORIZED => 'Unauthorized', self::PAYMENT_REQUIRED => 'Payment Required', self::FORBIDDEN => 'Forbidden', self::NOT_FOUND => 'Not Found', self::METHOD_NOT_ALLOWED => 'Method Not Allowed', self::NOT_ACCEPTABLE => 'Not Acceptable', self::PROXY_AUTHENTICATION_REQUIRED => 'Proxy Authentication Required', self::REQUEST_TIMEOUT => 'Request Timeout', self::CONFLICT => 'Conflict', self::GONE => 'Gone', self::LENGTH_REQUIRED => 'Length Required', self::PRECONDITION_FAILED => 'Precondition Failed', self::PAYLOAD_TOO_LARGE => 'Payload Too Large', self::URI_TOO_LONG => 'URI Too Long', self::UNSUPPORTED_MEDIA_TYPE => 'Unsupported Media Type', self::RANGE_NOT_SATISFIABLE => 'Range Not Satisfiable', self::EXPECTATION_FAILED => 'Expectation Failed', self::TEAPOT => 'I\'m A Teapot', self::MISDIRECTED_REQUEST => 'Misdirected Request', self::UNPROCESSABLE_CONTENT => 'Unprocessable Content', self::TOO_EARLY => 'Too Early', self::PRECONDITION_REQUIRED => 'Precondition Required', self::TOO_MANY_REQUESTS => 'Too Many Requests', self::REQUEST_HEADER_FIELDS_TOO_LARGE => 'Request Header Fields Too Large', self::UNAVAILABLE_FOR_LEGAL_REASONS => 'Unavailable For Legal Reasons', self::INTERNAL_SERVER_ERROR => 'Internal Server Error', self::NOT_IMPLEMENTED => 'Not Implemented', self::BAD_GATEWAY => 'Bad Gateway', self::SERVICE_UNAVAILABLE => 'Service Unavailable', self::GATEWAY_TIMEOUT => 'Gateway Timeout']

SWITCHING_PROTOCOLS

public mixed SWITCHING_PROTOCOLS = 101

TEMPORARY_REDIRECT

Temporarily moved. Use this for POST -> POST and the like.

public mixed TEMPORARY_REDIRECT = 307

TOO_EARLY

Unwilling to process a request that might be replayed.

public mixed TOO_EARLY = 425

TOO_MANY_REQUESTS

Rate-limit reached.

public mixed TOO_MANY_REQUESTS = 429

UNAUTHORIZED

Not permitted, the user is not yet authenticated.

public mixed UNAUTHORIZED = 401
public mixed UNAVAILABLE_FOR_LEGAL_REASONS = 451

UNPROCESSABLE_CONTENT

public mixed UNPROCESSABLE_CONTENT = 422

UNSUPPORTED_MEDIA_TYPE

The content type isn't supported.

public mixed UNSUPPORTED_MEDIA_TYPE = 415

Methods

getStatus()

Get the full status string.

public static getStatus(int $code[, float $version = 1.1 ]) : string
Parameters
$code : int
$version : float = 1.1
Return values
string

toString()

Convert a code to a string.

public static toString(int $code) : string
Parameters
$code : int
Return values
string
On this page

Search results