kasia
7 months agoNew Contributor
Mismatch between response from a CURL request and ReadyAPI response
Hello,
I'm encountering a significant issue as I'm receiving an unexpected response when sending a request through ReadyAPI to validate error handling in the software under test. (The request works as expected when it's a 'passing' request).
Here is the curl request :
curl -X POST http://localhost/xxx/api/rest/latest/ai-servers -H 'Authorization: Basic xxx' -d '{"name": "name"}' -H'Content-Type: application/json'
and the correct response:
{"fieldValidationErrors":[{"objectName":"post-ai-server","fieldName":"url","fieldValue":null,"errorMessage":"This attribute can't be empty"}]}
When I send the same request in ReadyAPI I get
<response null="true"></response>
Could you please tell me what this is due to?
Best regards,
Kasia
I see below header sent in curl request.
Content-Type: application/json
What did see in the raw tab of the request? Try adding that header and see.
Otherwise, try adding Accept Header with application/json as value