Unirest\Request::curlOpt PHP Method

curlOpt() public static method

Set a new default header to send on every request
public static curlOpt ( string $name, string $value ) : string
$name string header name
$value string header value
return string
    public static function curlOpt($name, $value)
    {
        return self::$curlOpts[$name] = $value;
    }

Usage Example

Exemplo n.º 1
0
 public function testCurlOpts()
 {
     Request::curlOpt(CURLOPT_COOKIE, 'foo=bar');
     $response = Request::get('http://mockbin.com/request');
     $this->assertTrue(property_exists($response->body->cookies, 'foo'));
     Request::clearCurlOpts();
 }
All Usage Examples Of Unirest\Request::curlOpt