Forum Discussion

InekeBauw's avatar
Occasional Contributor
6 years ago

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":"","title":"Not Acceptable","status":406,"detail":"Unable to resolve Accept header to a representation"}


In Postman everything works fine.

2 Replies