src/WebRequest.php
public function setCurlOption($key, $value)
    {
        if (!is_int($key)) {
            throw new InvalidArgumentException('It is not a CURL_OPT argument');
        }
        if ($key == CURLOPT_HEADER || $key == CURLOPT_RETURNTRANSFER) {
            throw new InvalidArgumentException('You cannot change CURLOPT_HEADER or CURLOPT_RETURNTRANSFER');
        }

        if (!is_null($value)) {
            $this->curlOptions[$key] = $value;
        } else {
            unset($this->curlOptions[$key]);
        }
    }
public function setCurlOption($key, $value)
    {
        if (!is_int($key)) {
            throw new InvalidArgumentException('It is not a CURL_OPT argument');
        }
        if ($key == CURLOPT_HEADER || $key == CURLOPT_RETURNTRANSFER) {
            throw new InvalidArgumentException('You cannot change CURLOPT_HEADER or CURLOPT_RETURNTRANSFER');
        }

        if (!is_null($value)) {
            $this->curlOptions[$key] = $value;
        } else {
            unset($this->curlOptions[$key]);
        }
    }
public function setCurlOption ( $ key , $ value ) { if ( ! is_int ( $ key ) ) { throw new InvalidArgumentException ( 'It is not a CURL_OPT argument' ) ; } if ( $ key == CURLOPT_HEADER || $ key == CURLOPT_RETURNTRANSFER ) { throw new InvalidArgumentException ( 'You cannot change CURLOPT_HEADER or CURLOPT_RETURNTRANSFER' ) ; } if ( ! is_null ( $ value ) ) { $ this -> curlOptions [ $ key ] = $ value ; } else { unset ( $ this -> curlOptions [ $ key ] ) ; } }
Set a custom CURL option

@param int $key
@param mixed $value
@throws InvalidArgumentException
Set a custom CURL option