Getting a 406 - Unable to resolve Accept header to a representation on Rest request
I receive a 406 - Not acceptable
RAW request :
PUT https://api.********.com/contractor/index/3884?indexType=basic HTTP/1.1
Content-Type: application/json
Content-Length: 0
Host: api.********.com
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_162)
RAW response:
HTTP/1.1 406 Not Acceptable
Date: Tue, 03 Jul 2018 10:35:37 GMT
Server: Apache/2.4.10 (Debian)
Cache-Control: must-revalidate, no-cache, no-store
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: PUT, GET, POST, PATCH, DELETE, OPTIONS
Access-Control-Allow-Headers: Authorization, Origin, X-Requested-With, Content-Type, Accept
Content-Length: 166
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: application/problem+json
{"type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html","title":"Not Acceptable","status":406,"detail":"Unable to resolve Accept header to a representation"}
In Postman everything works fine.
Also, I can recommend comparing 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 in Postman http://screencast.com/t/LpyQIAIH, click the Code button and choose HTTP: http://screencast.com/t/SLEdPUNX
Or, you can use Fiddler (http://www.telerik.com/download/fiddler) which is a free tool to capture HTTP(S) traffic.