PHP 클래스 VCR\Util\HttpUtil

파일 보기 프로젝트 열기: php-vcr/php-vcr 1 사용 예제들

공개 메소드들

메소드 설명
formatAsStatusString ( Response $response ) : string Returns a HTTP status line from specified response.
formatAsStatusWithHeadersString ( Response $response ) : string 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.

메소드 상세

formatAsStatusString() 공개 정적인 메소드

Returns a HTTP status line from specified response.
public static formatAsStatusString ( Response $response ) : string
$response VCR\Response
리턴 string HTTP status line.

formatAsStatusWithHeadersString() 공개 정적인 메소드

Returns a HTTP status line with headers from specified response.
public static formatAsStatusWithHeadersString ( Response $response ) : string
$response VCR\Response
리턴 string HTTP status line.

formatHeadersForCurl() 공개 정적인 메소드

Returns a list of headers from a key/value paired array.
public static formatHeadersForCurl ( array $headers ) : array
$headers array Headers as key/value pairs.
리턴 array List of headers ['Content-Type: text/html', '...'].

parseHeaders() 공개 정적인 메소드

Returns key value pairs of response headers.
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']

parseRawHeader() 공개 정적인 메소드

Returns an array of arrays for specified raw header string.
public static parseRawHeader ( $rawHeader ) : array
리턴 array

parseResponse() 공개 정적인 메소드

Returns status, headers and body from a HTTP response string.
public static parseResponse ( string $response ) : array
$response string Response including header and body.
리턴 array Status, headers and body as strings.

parseStatus() 공개 정적인 메소드

Returns http_version, code and message from a HTTP status line.
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'.