D7 API documentation
What's New
Modules
Main module in old core
Legacy mode
PSR-18: HTTP Client
Asynchronous queries
CURL
Proxy
Logging
HttpClient constructor
HttpClient destuctor
disableSslVerification
download
get
getCharset
getContentType
getCookies
getEffectiveUrl
getError
getHeaders
getResult
getStatus
head
post
query
setAuthorization
setCharset
setCompress
setCookies
setHeader
setOutputStream
setProxy
setRedirect
setStreamTimeout
setTimeout
setVersion
waitResponse
Proxy
Client supports operation via HTTP and HTTPS proxies.
$http = new HttpClient([ 'proxyHost' => '185.135.157.89', 'proxyPort' => '8080', ]);
For URL http:// client will make a query via proxy with indicated full URL as follows:
GET http://www.bitrix24.com/ HTTP/1.1
For address https://, client will use the CONNECTmethod to proxy. After establishing a tunnel to the host, socket will switch to a protected mode and then the exchange with the host proceeds as usual:
CONNECT www.bitrix24.com:443 HTTP/1.1
Make sure, that proxy servers can be quite limiting and continuous operation isn't guaranteed. However, you can benefit from using CURL because of its more developed proxy support.
© «Bitrix24», 2001-2024
Up