title: How to use basic authorization in PHP curl
body: <p>I am having problem with PHP curl request with basic authorization.</p>
  
  <p>Here is the command line curl:</p>
  
  <pre><code>curl -H "Accept: application/product+xml" "https://{id}:{api_key}@api.domain.com/products?limit=1&amp;offset=0"
  </code></pre>
  
  <p>I have tried by setting curl header in following ways but it's not working</p>
  
  <pre><code>Authorization: Basic id:api_key
  or 
  Authorization: Basic {id}:{api_key}
  </code></pre>
  
  <p>I get the response "authentication parameter in the request are missing or invalid" but I have used proper id and api_key which is working in command line curl (I tested)</p>
  
  <p>Please help me.</p>