title: How to do a POST request to upload a file and data in cURL from the command line
body: <p>I am trying to send a POST Request in cURL to an API while following the given requirements.</p>
  
  <blockquote>
    <p>Guidelines:</p>
    
    <ul>
    <li><p>The content type for the submission should be application/json</p></li>
    <li><p>The following is the structure of the body:</p>
    
    <ul>
    <li><p>Name: String</p></li>
    <li><p>PhoneNumber: String</p></li>
    <li><p>Email: String</p></li>
    <li><p>Position: String</p></li>
    <li><p>Urls: Array of objects containing the following properties</p>
    
    <ul>
    <li><p>Type: String</p></li>
    <li><p>Link: String</p></li>
    </ul></li>
    </ul></li>
    <li><p>All fields are required</p></li>
    <li><p>At least one URL with the "Resume" type is required</p></li>
    <li><p>For resumes, we require submissions to be in PDF format</p></li>
    <li><p>If your submission was successful, you will receive a HTTP 202 response</p></li>
    </ul>
  </blockquote>
  
  <p>I believe I have the proper syntax for all my data I want to send in JSON but I am not sure how to upload a PDF in the same request.</p>
  
  <p>Here is my syntax so far.</p>
  
  <pre><code>curl -i -H "Accept: application/json" -H "Content-Type: application/json" -
       X POST -d '{"json":{"Name":"data"}}' -d '{"json":
       {"PhoneNumber":"data"}}' -d '{"json":{"Email":"data"}}' -d '{"json":
       {"Position":"data"}}' https://example
  </code></pre>
  
  <p>When I enter this into the command line I get an 'HTTP 400 Bad Request' response when of course I am shooting for a 202 response. </p>
  
  <p>I mostly program in Python and R so using cURL is new to me. Any help so I can  send this application is greatly appreciated. Please let me know if you need anymore information. </p>