PHP 클래스 ManaPHP\Http\Client

상속: extends ManaPHP\Component, implements ManaPHP\Http\ClientInterface
파일 보기 프로젝트 열기: manaphp/manaphp

보호된 프로퍼티들

프로퍼티 타입 설명
$_curlResponseHeader array
$_headers array
$_options array
$_peek boolean
$_responseBody string

공개 메소드들

메소드 설명
__construct ( array $options = [], array $headers = [] ) Client constructor.
_request ( string $type, string $url, string | array $data, array $headers, array $options ) : integer
delete ( array | string $url, array $headers = [], array $options = [] ) : integer
get ( array | string $url, array $headers = [], array $options = [] ) : integer
getResponseBody ( ) : string
patch ( array | string $url, string | array $data = [], array $headers = [], array $options = [] ) : integer
post ( array | string $url, string | array $data = [], array $headers = [], array $options = [] ) : mixed
put ( array | string $url, string | array $data = [], array $headers = [], array $options = [] ) : integer
setProxy ( string $proxy = '127.0.0.1:8888', boolean $peek = true ) : static

보호된 메소드들

메소드 설명
_buildUrl ( string | array $url ) : string
request ( string $type, string | array $url, string | array $data, array $headers, array $options ) : integer

메소드 상세

__construct() 공개 메소드

Client constructor.
public __construct ( array $options = [], array $headers = [] )
$options array - `timeout`: How long should we wait for a response? (integer, seconds, default: 10) - `max_redirects`: How many times should we redirect 3xx before error? (integer, default: 10) (string, default: '') - `proxy`: Proxy details to use for proxy by-passing and authentication (string, default: '') - `ssl_certificates`: Should we verify SSL certificates? Allows passing in a custom certificate file as a string. (Using true uses the system-wide root certificate store instead, but this may have different behaviour across transports.) (string, default: 'xxx/ca.pem') - `verify_host`: Should we verify the common name in the SSL certificate? (bool: default, true)
$headers array - `User-Agent`: User Agent to send to the server (string, default: php-requests/$version)

_buildUrl() 보호된 메소드

protected _buildUrl ( string | array $url ) : string
$url string | array
리턴 string

_request() 공개 메소드

public _request ( string $type, string $url, string | array $data, array $headers, array $options ) : integer
$type string
$url string
$data string | array
$headers array
$options array
리턴 integer

delete() 공개 메소드

public delete ( array | string $url, array $headers = [], array $options = [] ) : integer
$url array | string
$headers array
$options array
리턴 integer

get() 공개 메소드

public get ( array | string $url, array $headers = [], array $options = [] ) : integer
$url array | string
$headers array
$options array
리턴 integer

getResponseBody() 공개 메소드

public getResponseBody ( ) : string
리턴 string

patch() 공개 메소드

public patch ( array | string $url, string | array $data = [], array $headers = [], array $options = [] ) : integer
$url array | string
$data string | array
$headers array
$options array
리턴 integer

post() 공개 메소드

public post ( array | string $url, string | array $data = [], array $headers = [], array $options = [] ) : mixed
$url array | string
$data string | array
$headers array
$options array
리턴 mixed

put() 공개 메소드

public put ( array | string $url, string | array $data = [], array $headers = [], array $options = [] ) : integer
$url array | string
$data string | array
$headers array
$options array
리턴 integer

request() 보호된 메소드

protected request ( string $type, string | array $url, string | array $data, array $headers, array $options ) : integer
$type string
$url string | array
$data string | array
$headers array
$options array
리턴 integer

setProxy() 공개 메소드

public setProxy ( string $proxy = '127.0.0.1:8888', boolean $peek = true ) : static
$proxy string
$peek boolean
리턴 static

프로퍼티 상세

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

protected array $_curlResponseHeader
리턴 array

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

protected array $_headers
리턴 array

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

protected array $_options
리턴 array

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

protected bool $_peek
리턴 boolean

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

protected string $_responseBody
리턴 string