- class
HttpClient
(httpclient\HttpClient
) - source
httpclient/HttpClient.php
Description
Class HttpClient
->
baseUrl
:string
->
userAgent
:string
->
referrer
:string
->
followRedirects
:bool
->
connectTimeout
:string
->
readTimeout
:string
->
proxyType
:string
- HTTP, SOCKS,->
proxy
:string
->
requestType
:string
- URLENCODE, MULTIPART, JSON, TEXT, XML, RAW->
responseType
:string
- JSON, TEXT, XML, JSOUP->
body
:array|mixed
->
encoding
:string
->
cookies
:array
->
headers
:array
->
bodyParser
:null|callable
->
handlers
:callable[]
->
_boundary
:string
->
_threadPool
:ThreadPool
->
__construct()
- HttpClient constructor.->
setThreadPool()
->
get()
->
post()
->
put()
->
patch()
->
delete()
->
options()
->
head()
->
getAsync()
->
postAsync()
->
putAsync()
->
patchAsync()
->
deleteAsync()
->
optionsAsync()
->
headAsync()
->
sendAsync()
->
executeAsync()
->
send()
->
execute()
->
connect()
->
formatUrlencode()
->
formatMultipart()
__construct(string $baseUrl): void
HttpClient constructor.
setThreadPool([ php\lang\ThreadPool $pool): void
get(string $url, array $args): httpclient\HttpResponse
post(string $url, mixed $body): httpclient\HttpResponse
put(string $url, mixed $body): httpclient\HttpResponse
patch(string $url, mixed $body): httpclient\HttpResponse
delete(string $url, array $args): httpclient\HttpResponse
options(string $url, array $args): httpclient\HttpResponse
head(string $url, array $args): httpclient\HttpResponse
getAsync(string $url, array $args): php\concurrent\Promise
postAsync(string $url, mixed $body): php\concurrent\Promise
putAsync(string $url, mixed $body): php\concurrent\Promise
patchAsync(string $url, mixed $body): php\concurrent\Promise
deleteAsync(string $url, array $args): php\concurrent\Promise
optionsAsync(string $url, array $args): php\concurrent\Promise
headAsync(string $url, array $args): php\concurrent\Promise
sendAsync(httpclient\HttpRequest $request, [ php\lang\ThreadPool $threadPool): php\concurrent\Promise
executeAsync(string $method, string $url, null $body): php\concurrent\Promise
send(httpclient\HttpRequest $request): httpclient\HttpResponse
execute(string $method, string $url, mixed $body): httpclient\HttpResponse
connect(httpclient\HttpRequest $request, mixed $fullUrl, php\net\URLConnection $connection, mixed $body): httpclient\HttpResponse
formatUrlencode(array $data, string $prefix): string
formatMultipart(array $data, mixed $prefix): void