title: Sending JSON file using relative path with curl
body: <p>I have a JSON file called <code>people.json</code>:</p>
  <pre><code>[
      {
          &quot;name&quot;: &quot;Adam&quot;
      }, 
      {
          &quot;name&quot;: &quot;Eve&quot;
      }
  ]
  </code></pre>
  <p>I'm trying to send this data using a POST request with <code>curl</code>, from the project's root directory:</p>
  <pre><code>curl --request POST \
       --header 'Content-Type: application/json' 'Accept: application/json' \
       --data-binary @src/test/java/com/spring/app/people.json \
       http://127.0.0.1:8080/api/v1/person -v -s
  </code></pre>
  <p>I keep getting the &quot;Bad Request&quot; error:</p>
  <pre><code>* Closing connection -1
  *   Trying 127.0.0.1:8080...
  * Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
  &gt; POST /api/v1/person HTTP/1.1
  &gt; Host: 127.0.0.1:8080
  &gt; User-Agent: curl/7.74.0
  &gt; Accept: */*
  &gt; Content-Type: application/json
  &gt; Content-Length: 80
  &gt; 
  * upload completely sent off: 80 out of 80 bytes
  * Mark bundle as not supporting multiuse
  &lt; HTTP/1.1 400 
  &lt; Content-Type: application/json
  &lt; Transfer-Encoding: chunked
  &lt; Date: Sat, 12 Dec 2020 03:56:38 GMT
  &lt; Connection: close
  &lt; 
  * Closing connection 0
  {&quot;timestamp&quot;:&quot;2020-12-12T03:56:38.822+00:00&quot;,&quot;status&quot;:400,&quot;error&quot;:&quot;Bad Request&quot;,&quot;message&quot;:&quot;&quot;,&quot;path&quot;:&quot;/api/v1/person&quot;}%  
  </code></pre>
  <p>I've already had a look at <a href="https://stackoverflow.com/a/16621248/13055097">this post</a>, but still get the same error.
  I've also installed homebrew <code>curl</code>, but even using that doesn't resolve the error.</p>
  <p>I would appreciate any help.</p>