title: REST API file upload using jmeter using POST
body: <p>I'm trying to upload an image file using rest api jmeter but I'm getting a 400 bad request error. Below are the steps with the screenshots I've followed to upload a file:</p>
  
  <p><img src="https://i.stack.imgur.com/aABpg.png" alt="enter image description here"></p>
  
  <p>Checked the multipart/form data option and sent the post body empty, under the send files with request, specified the path of the image file which I've placed in the jmeter/bin folder, set the parameter name as file which is from the request payload and MIME type as image/jpeg</p>
  
  <p><img src="https://i.stack.imgur.com/PEDWt.png" alt="enter image description here"></p>
  
  <p>Http Header Manager with the Authorization- value, Accept-Encoding- value, Connection-Keep Alive, If-Match-2</p>
  
  <p><img src="https://i.stack.imgur.com/P5GQK.png" alt="enter image description here"></p>
  
  <p>Result: Got 404 bad request</p>
  
  <p>POST data:</p>
  
  <pre><code>--3yAYhmLPQ-1r98DX3NMZONHWXK0QDp4uuTmlQYEv
  Content-Disposition: form-data; 
  name="file"; 
  filename="SampleJPGImage_2mbmb.jpg"
  Content-Type: image/jpeg
  Content-Transfer-Encoding: binary
  
  &lt;actual file content, not shown here&gt;
  --3yAYhmLPQ-1r98DX3NMZONHWXK0QDp4uuTmlQYEv--
  </code></pre>