title: PHP cURL: how to set body to binary data?
body: <p>I'm using an API that wants me to send a POST with the binary data from a file as the body of the request. How can I accomplish this using PHP cURL?</p>
  
  <p>The command line equivalent of what I'm trying to achieve is:</p>
  
  <pre><code>curl --request POST --data-binary "@myimage.jpg" https://myapiurl
  </code></pre>