Forum Discussion
Hi,
Thank you for your post. To find the cause of the issue, compare a successful (or expected) raw request with a raw request from ReadyAPI.
To get a raw request in ReadyAPI, please switch to the Raw tab on the left side of the Request Editor.
To get a raw request which was sent from a Rest client and Postman you can use Fiddler (http://www.telerik.com/download/fiddler) which is a free tool to capture HTTP(S) traffic.
I compared the RAW Request in both, ReadyAPI and Postman and they both looks the same just besides the Header information.
Method: Get
Raw Request in Ready API:
Get https://url
Accept-Encoding: gzip,deflate
Authorization: Bearer
Content-Type: application/vnd.api+json
Content-Type: application/json
Content-Length: 0
Host: domain-uat.sdvi.com
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0
Raw Request in Postman:
Get https://url
Authorization:Bearer INDdCRdJ/XXXXXXXXXXXXXXXXXXX+
Content-Type:application/vnd.api+json
Response for ReadyAPI: still the same as below
HTTP/1.1 406 NOT ACCEPTABLE
Server: nginx
Date: Wed, 10 Jan 2018 02:47:31 GMT
Content-Type: application/json
Content-Length: 297
Connection: keep-alive
{
"errors": [
{
"detail": "The resource identified by the request is only capable of generating response entities which have content characteristics not acceptable according to the accept headers sent in the request.",
"status": "406",
"title": "Not Acceptable"
}
]
}
Response for Postman: 201, OK
Now what you/ anyone else suggest?
Thanks
- Nastya_Khovrina8 years ago
Alumni
How do you add this header: Content-Type: application/vnd.api+json ?
Try to change the Media Type for the request from application/json to application/vnd.api+json.
- API_Tester8 years agoOccasional Contributor
I followed your instruction and still the same results. Attaching a screen shot for your review and see if that can help you to see what I'm facing.
Thanks,
- Nastya_Khovrina8 years ago
Alumni
Hi,
Then, we need to compare the Raw requests once again. Does the new request include only one Content-Type header?
Another header that can affect is the Accept-Encoding header. To remove this header from the request un-check the Response Compression box in Preferences->HTTP Settings.