PHP 클래스 LeagueWrap\Response

파일 보기 프로젝트 열기: paquettg/leaguewrap 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$code integer The HTTP code resulting from the request.
$content string The content of the response.
$headers array Request's headers.

공개 메소드들

메소드 설명
__construct ( string $content, integer $code, array $headers = [] ) The primary content of the response.
__toString ( ) : string Returns the content of the response as a string.
getCode ( ) : integer Returns the code associated with the response.
getHeader ( string $name ) : string | null Return header's value by key.
getHeaders ( ) : array Return array of header from response in format header key => header value.
hasHeader ( string $name ) : boolean Check if header key is present

메소드 상세

__construct() 공개 메소드

The primary content of the response.
public __construct ( string $content, integer $code, array $headers = [] )
$content string
$code integer
$headers array

__toString() 공개 메소드

Returns the content of the response as a string.
public __toString ( ) : string
리턴 string

getCode() 공개 메소드

Returns the code associated with the response.
public getCode ( ) : integer
리턴 integer

getHeader() 공개 메소드

If the header is not present, return null.
public getHeader ( string $name ) : string | null
$name string
리턴 string | null

getHeaders() 공개 메소드

Only one value per header key is allowed.
public getHeaders ( ) : array
리턴 array

hasHeader() 공개 메소드

Check if header key is present
public hasHeader ( string $name ) : boolean
$name string
리턴 boolean

프로퍼티 상세

$code 보호되어 있는 프로퍼티

The HTTP code resulting from the request.
protected int $code
리턴 integer

$content 보호되어 있는 프로퍼티

The content of the response.
protected string $content
리턴 string

$headers 보호되어 있는 프로퍼티

Request's headers.
protected array $headers
리턴 array