Class shardimage\shardimagephpapi\web\Http
Inheritance | shardimage\shardimagephpapi\web\Http |
---|
HTTP helper methods and constants.
Public Properties
Property | Type | Description | Defined By |
---|---|---|---|
$statuses | shardimage\shardimagephpapi\web\Http |
Public Methods
Method | Description | Defined By |
---|---|---|
buildHeaders() | Builds the headers from an array. | shardimage\shardimagephpapi\web\Http |
buildHttpMessage() | Builds the HTTP message. | shardimage\shardimagephpapi\web\Http |
Constants
Constant | Value | Description | Defined By |
---|---|---|---|
CONTENT_TYPE_FILE | 'application/octet-stream' | File content type. | shardimage\shardimagephpapi\web\Http |
CONTENT_TYPE_JSON | 'application/json' | Json content type. | shardimage\shardimagephpapi\web\Http |
HEADER_ACCEPT | 'Accept' | Accept header. | shardimage\shardimagephpapi\web\Http |
HEADER_ACCEPT_ENCODING | 'Accept-Encoding' | Accept encoding header. | shardimage\shardimagephpapi\web\Http |
HEADER_ACCEPT_LANGUAGE | 'Accept-Language' | Accept language header. | shardimage\shardimagephpapi\web\Http |
HEADER_CONTENT_ID | 'Content-ID' | Content ID header. | shardimage\shardimagephpapi\web\Http |
HEADER_CONTENT_LENGTH | 'Content-Length' | Content length header. | shardimage\shardimagephpapi\web\Http |
HEADER_CONTENT_TRANSFER_ENCODING | 'Content-Transfer-Encoding' | Content transfer encoding header. | shardimage\shardimagephpapi\web\Http |
HEADER_CONTENT_TYPE | 'Content-Type' | Content Type header. | shardimage\shardimagephpapi\web\Http |
HEADER_EXPECT | 'Expect' | Expect header. | shardimage\shardimagephpapi\web\Http |
HEADER_IF_NONE_MATCH | 'If-None-Match' | ETag header. | shardimage\shardimagephpapi\web\Http |
STATUS_ACCEPTED | 202 | shardimage\shardimagephpapi\web\Http | |
STATUS_BAD_REQUEST | 400 | shardimage\shardimagephpapi\web\Http | |
STATUS_CREATED | 201 | shardimage\shardimagephpapi\web\Http | |
STATUS_FOUND | 302 | shardimage\shardimagephpapi\web\Http | |
STATUS_INTERNAL_SERVER_ERROR | 500 | shardimage\shardimagephpapi\web\Http | |
STATUS_MOVED_PERMANENTLY | 301 | shardimage\shardimagephpapi\web\Http | |
STATUS_NOT_MODIFIED | 304 | shardimage\shardimagephpapi\web\Http | |
STATUS_NO_CONTENT | 204 | shardimage\shardimagephpapi\web\Http | |
STATUS_OK | 200 | shardimage\shardimagephpapi\web\Http |
Property Details
public static $statuses = [100 => 'Continue', 101 => 'Switching Protocols', 102 => 'Processing', 118 => 'Connection timed out', 200 => 'OK', 201 => 'Created', 202 => 'Accepted', 203 => 'Non-Authoritative', 204 => 'No Content', 205 => 'Reset Content', 206 => 'Partial Content', 207 => 'Multi-Status', 208 => 'Already Reported', 210 => 'Content Different', 226 => 'IM Used', 300 => 'Multiple Choices', 301 => 'Moved Permanently', 302 => 'Found', 303 => 'See Other', 304 => 'Not Modified', 305 => 'Use Proxy', 306 => 'Reserved', 307 => 'Temporary Redirect', 308 => 'Permanent Redirect', 310 => 'Too many Redirect', 400 => 'Bad Request', 401 => 'Unauthorized', 402 => 'Payment Required', 403 => 'Forbidden', 404 => 'Not Found', 405 => 'Method Not Allowed', 406 => 'Not Acceptable', 407 => 'Proxy Authentication Required', 408 => 'Request Time-out', 409 => 'Conflict', 410 => 'Gone', 411 => 'Length Required', 412 => 'Precondition Failed', 413 => 'Request Entity Too Large', 414 => 'Request-URI Too Long', 415 => 'Unsupported Media Type', 416 => 'Requested range unsatisfiable', 417 => 'Expectation failed', 418 => 'I\'m a teapot', 421 => 'Misdirected Request', 422 => 'Unprocessable entity', 423 => 'Locked', 424 => 'Method failure', 425 => 'Unordered Collection', 426 => 'Upgrade Required', 428 => 'Precondition Required', 429 => 'Too Many Requests', 431 => 'Request Header Fields Too Large', 449 => 'Retry With', 450 => 'Blocked by Windows Parental Controls', 500 => 'Internal Server Error', 501 => 'Not Implemented', 502 => 'Bad Gateway or Proxy Error', 503 => 'Service Unavailable', 504 => 'Gateway Time-out', 505 => 'HTTP Version not supported', 507 => 'Insufficient storage', 508 => 'Loop Detected', 509 => 'Bandwidth Limit Exceeded', 510 => 'Not Extended', 511 => 'Network Authentication Required']
Method Details
Builds the headers from an array.
public static string buildHeaders ( $headers ) | ||
$headers | array | Headers in array |
Builds the HTTP message.
public static string buildHttpMessage ( $firstline, $headers, $body ) | ||
$firstline | string | Request/status line |
$headers | string | HTTP headers |
$body | mixed | HTTP body |