Httprequest
class Httprequest (View source)
HTTP requests library
Methods
Class constructor
Class destructor
Set remote host address
Force lib to use curl (default if available) or stream
Set http authentication
Set user agent for request
Set connection timeout
Set http version (1.0/1.1)
Set http content type
Set TCP port to connect to
Set HTTP method to use
Set whether or not to ignore errors
Set HTTP method to use
Set header component
Unset header component
Get the whole headers array
Get received headers
Get received headers
Get transport channel (curl channel or stream context)
Init transport and send data to the remote host.
Init transport and get remote content
Reset the data channel for new request
Details
at line 176
final
__construct(string $address = false, bool $curl = true)
Class constructor
at line 200
final
__destruct()
Class destructor
at line 215
final Httprequest
setHost(string $address)
Set remote host address
at line 234
final Httprequest
setCurl(bool $mode = true)
Force lib to use curl (default if available) or stream
at line 256
final Httprequest
setAuth(string $method, string $user, string $pass = null)
Set http authentication
at line 290
final Httprequest
setUserAgent(string $ua)
Set user agent for request
at line 307
final Httprequest
setTimeout(int $sec)
Set connection timeout
at line 324
final Httprequest
setHttpVersion(string $ver)
Set http version (1.0/1.1)
at line 349
final Httprequest
setContentType(string $type)
Set http content type
at line 366
final Httprequest
setPort(integer $port)
Set TCP port to connect to
at line 389
final Httprequest
setHttpMethod(string $method)
Set HTTP method to use
at line 412
final Httprequest
setIgnoreErrors(boolean $ignore = true)
Set whether or not to ignore errors
at line 431
final Httprequest
setProxy(string $address, string $user = null, string $pass = null)
Set HTTP method to use
at line 461
final Httprequest
setHeader(string $header, string $value = NULL)
Set header component
at line 476
final Httprequest
unsetHeader(string $header)
Unset header component
at line 489
final array
getHeaders()
Get the whole headers array
at line 500
final array
getReceivedHeaders()
Get received headers
at line 511
final integer
getHttpStatusCode()
Get received headers
at line 522
final mixed
getChannel()
Get transport channel (curl channel or stream context)
at line 535
string
send($data = null)
Init transport and send data to the remote host.
at line 571
string
get()
Init transport and get remote content
at line 603
final
reset()
Reset the data channel for new request