Methods |
public
|
beforeSend($callback)
Before Send
|
#
|
abstract
public
|
close()
|
#
|
public
|
complete($callback)
Complete
|
#
|
public
|
disableTimeout()
Disable Timeout
|
#
|
public
|
error($callback)
Error
|
#
|
public
|
getOpt($option): mixed
Get Opt
|
#
|
public
|
removeHeader($key)
Remove Header
Remove Header
Remove an internal header from the request.
Using `curl -H "Host:" ...' is equivalent to $curl->removeHeader('Host');.
|
#
|
public
|
setAutoReferer(mixed $auto_referer = true)
Set auto referer
|
#
|
public
|
setAutoReferrer(mixed $auto_referrer = true)
Set auto referrer
|
#
|
public
|
setBasicAuthentication($username, $password = '')
Set Basic Authentication
|
#
|
public
|
setConnectTimeout($seconds)
Set Connect Timeout
|
#
|
abstract
public
|
setCookie($key, $value)
|
#
|
abstract
public
|
setCookieFile($cookie_file)
|
#
|
abstract
public
|
setCookieJar($cookie_jar)
|
#
|
abstract
public
|
setCookieString($string)
|
#
|
abstract
public
|
setCookies($cookies)
|
#
|
public
|
setDigestAuthentication($username, $password = '')
Set Digest Authentication
Set Digest Authentication
|
#
|
public
|
afterSend($callback)
After Send
After Send
This function is called after the request has been sent.
It can be used to override whether or not the request errored. The
instance is passed as the first argument to the function and the instance
has attributes like $instance->httpStatusCode and $instance->response to
help decide if the request errored. Set $instance->error to true or false
within the function.
When $instance->error is true indicating a request error, the error
callback set by Curl::error() is called. When $instance->error is false,
the success callback set by Curl::success() is called.
|
#
|
public
|
setFile($file)
Set File
|
#
|
protected
|
setFileInternal($file)
|
#
|
public
|
setFollowLocation(mixed $follow_location = true)
Set follow location
|
#
|
public
|
setForbidReuse(mixed $forbid_reuse = true)
Set forbid reuse
|
#
|
abstract
public
|
setHeader($key, $value)
|
#
|
abstract
public
|
setHeaders($headers)
|
#
|
public
|
setInterface($interface)
Set Interface
Set Interface
The name of the outgoing network interface to use.
This can be an interface name, an IP address or a host name.
|
#
|
abstract
public
|
setJsonDecoder($mixed)
|
#
|
public
|
setMaximumRedirects(mixed $maximum_redirects)
Set maximum redirects
|
#
|
abstract
public
|
setOpt($option, $value)
|
#
|
protected
|
setOptInternal($option, $value)
|
#
|
abstract
public
|
setOpts($options)
|
#
|
public
|
setPort($port)
Set Port
|
#
|
public
|
setProxy($proxy, $port = null, $username = null, $password = null)
Set Proxy
Set Proxy
Set an HTTP proxy to tunnel requests through.
|
#
|
public
|
setProxyAuth($auth)
Set Proxy Auth
Set Proxy Auth
Set the HTTP authentication method(s) to use for the proxy connection.
|
#
|
public
|
setProxyTunnel($tunnel = true)
Set Proxy Tunnel
Set Proxy Tunnel
Set the proxy to tunnel through HTTP proxy.
|
#
|
public
|
setProxyType($type)
Set Proxy Type
Set Proxy Type
Set the proxy protocol type.
|
#
|
public
|
setRange($range)
Set Range
|
#
|
protected
|
setRangeInternal($range)
|
#
|
public
|
setReferer($referer)
Set Referer
|
#
|
public
|
setReferrer($referrer)
Set Referrer
|
#
|
abstract
public
|
setRetry($mixed)
|
#
|
public
|
setTimeout($seconds)
Set Timeout
|
#
|
protected
|
setTimeoutInternal($seconds)
|
#
|
abstract
public
|
setUrl($url, $mixed_data = '')
|
#
|
public
|
setUserAgent($user_agent)
Set User Agent
|
#
|
protected
|
setUserAgentInternal($user_agent)
|
#
|
abstract
public
|
setXmlDecoder($mixed)
|
#
|
abstract
public
|
stop()
|
#
|
public
|
success($callback)
Success
|
#
|
abstract
public
|
unsetHeader($key)
|
#
|
public
|
unsetProxy()
Unset Proxy
Unset Proxy
Disable use of the proxy.
|
#
|
public
|
verbose(bool $on = true, resource|string $output = 'STDERR')
Verbose
|
#
|