title: Pass binary file as JSON parameter using multipart/form-data using curl POST
body: <p>I've searched  a bunch and can't find the answer the answer to this.</p>
  
  <p>I'm trying to pass a binary file as a JSON parameter using multipart/form-data using curl for a POST request. I tried this, but it doesn't work for obvious reasons:</p>
  
  <pre><code>curl -X POST http://api.example.com \
  -H "Content-Type:multipart/form-data" \
  -F "data={\"key\": \"@text.txt\"};type=application/json"
  </code></pre>
  
  <p>Any insights would be appreciated.</p>