How can I add custom cURL options?

cURL offer a huge number of customizable options. While Guzzle normalizes many of these options across different handlers, there are times when you need to set custom cURL options. This can be accomplished by passing an associative array of cURL settings in the curl key of a request.

For example, let’s say you need to customize the outgoing network interface used with a client.

  1. $client->request('GET', '/', [
  2. 'curl' => [
  3. CURLOPT_INTERFACE => 'xxx.xxx.xxx.xxx'
  4. ]
  5. ]);