Forum Discussion
Hi richie . Digging up this old post as I'm also confronted with this issue and I believe the original question isn't answered. I found a stackoverflow post which clearly explains the issue: https://stackoverflow.com/questions/78076769/soapui-readyapi-multi-part-form-data-rest-request-how-to-set-content-type-of
So next to a normal file, we also need to send a json object for another query parameter called "myInfo". I tried 3 ways in ReadyAPI 3.52 to achieve this, but all fail to achieve my goal. More info on these 3 with test data from the stackoverflow post:
- The way the original poster tried it in stackoverflow: I tried to add the json value in the query parameter. The raw view shows the json payload, but the Content-Type: application/json is missing, and our application does not accept it without this header (Content-Type 'application/octet-stream' is not supported). I have no way of adjusting this query parameter's setting to set the content-type.
- In the payload window, underneath the "media type" selection I added the json payload, like {"myInfo" : {"firstName" : "John", "lastName", "Doe", "middleInitial" : "A"} }. Then the Content-Type: application/json is there, but no Content-Disposition: form-data; name="myInfo" , which makes our application saying it's missing the "myInfo" parameter.
- I tried to pack my json into another file (next to my normal attachment "pdfFile"). The the readyAPI reads out that file and sends the json object, but again, not with proper application/json header but with Content-Type: application/octet-stream & Content-Transfer-Encoding: binary
The thing is, if I can send it like the poster on stackoverlfow indicates, so
Content-Disposition: form-data; name="myInfo" Content-Type: application/json
it will work, as I can achieve that via postmen. It seems to me a limitation in ReadyAPI that blocks me...
FYI: Raised support ticket 00667624 to address this.
Related Content
- 4 years ago
- 4 years ago
Recent Discussions
- 5 days ago
- 9 days ago