Метод | Описание | |
---|---|---|
formatAsStatusString ( |
Returns a HTTP status line from specified response. | |
formatAsStatusWithHeadersString ( |
Returns a HTTP status line with headers from specified response. | |
formatHeadersForCurl ( array $headers ) : array | Returns a list of headers from a key/value paired array. | |
parseHeaders ( array $headers ) : array | Returns key value pairs of response headers. | |
parseRawHeader ( $rawHeader ) : array | Returns an array of arrays for specified raw header string. | |
parseResponse ( string $response ) : array | Returns status, headers and body from a HTTP response string. | |
parseStatus ( string $status ) : array | Returns http_version, code and message from a HTTP status line. |
public static formatAsStatusString ( |
||
$response | ||
Результат | string | HTTP status line. |
public static formatAsStatusWithHeadersString ( |
||
$response | ||
Результат | string | HTTP status line. |
public static formatHeadersForCurl ( array $headers ) : array | ||
$headers | array | Headers as key/value pairs. |
Результат | array | List of headers ['Content-Type: text/html', '...']. |
public static parseHeaders ( array $headers ) : array | ||
$headers | array | List of headers. Example: ['Content-Type: text/html', '...'] |
Результат | array | Key/value pairs of headers, e.g. ['Content-Type' => 'text/html'] |
public static parseRawHeader ( $rawHeader ) : array | ||
Результат | array |
public static parseResponse ( string $response ) : array | ||
$response | string | Response including header and body. |
Результат | array | Status, headers and body as strings. |
public static parseStatus ( string $status ) : array | ||
$status | string | HTTP status line, e.g. HTTP/1.1 200 OK |
Результат | array | Parsed 'http_version', 'code' and 'message'. |