title: How to send OData to RESTful API in PHP cURL Request
body: <p>I am trying to send OData parameters in a GET request to a RESTful API using PHP. A properly formatted OData request to this service looks like so:</p>
  
  <pre class="lang-none prettyprint-override"><code>https://myapi.org/endpoint?filter=family_name eq 'Doe'
  </code></pre>
  
  <p>It seems like I should just append these variables to the end of my <code>CURLOPT_URL</code> before sending the request, but the API service doesn't seem to receive the OData.</p>
  
  <pre><code>$ch = curl_init();
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_TIMEOUT, 100);
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('OSDI-API-Token:xxxxxxxxxxxx'));
  curl_setopt($ch, CURLOPT_URL, "https://myapi.org/endpoint?filter=family_name eq 'Doe'");
  $response = curl_exec($ch);
  curl_close($ch);
  
  echo "&lt;pre&gt;";
  print_r($response);
  echo "&lt;/pre&gt;";
  </code></pre>
  
  <p>Output is <code>NULL</code>. This seems like a strange response considering that this same request with identical headers and the same Odata URL searches and finds the correct data in the API's browser.</p>
  
  <p>Can anybody confirm whether or not this is the correct way to send OData parameters through a cURL request?</p>