Skip to content

CurlHandler :: setOption(constant, value)

Brian Boll edited this page Apr 22, 2018 · 3 revisions

CurlHandler :: setOption(constant, value)

$ch = new CurlHandler('http://example.com');

//Changes the URL
$ch->setOption(CURLOPT_URL, 'http://google.com');

//Set user agent; valid UA often required for API use
$ch->setOption(CURLOPT_USERAGENT, 'EXAMPLE_USERAGENT');

Parameters [2]:

[1] constant: A constant representing one of the libcurl options detailed more here

[2] value: The expected value for the corresponding option passed by the first parameter

Returns:

No return value

Clone this wiki locally