We are trying to do API end to end testing and part of our testing is attachment/upload API but we’re block in testing it and always getting an error. Below is the error we always encounter
Server responded with status code 400 instead of expected 200 status code.
Server returned response body:
{“errors”:{"":[“Failed to read the request form. Missing content-type boundary.”]},“type”:“RFC 7231 - Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content or more validation errors occurred.”,“status”:400,“traceId”:“00-177865efaf7b1b4ea9c925f2ac57060b-16e7e84947adbc4d-00”}
Would you please help our team to solve this and tell us the proper way of using multipart/form-data. Thanks
We spend days on this, but could’nt solve it.
However, here is the non proper solution we got but works : we used newman and launched it through shell commands add-on on test project.
for example i used this : cd Desktop/MTE & newman run NewmanCollection.json -e NewmanEnvironnement.json --verbose
Using Execute commands from shell commands addon.
But follow instructions on the links.
recap :
1- Install node and newman
2- Export your collection and environments from postman
3- Execute from shell (u can add variables if necessary)
4- Get the shell result on test project and parse it using some js functions.