Ask a Question

Getting a 406 - Unable to resolve Accept header to a representation on Rest request

SOLVED
InekeBauw
Occasional Contributor

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.

2 REPLIES 2
Nastya_Khovrina
SmartBear Alumni (Retired)

Hi Ineke,

 

Thank you for your post! Try to add the Accept header with the */* value as it's shown on the following screenshot:FastStoneEditor1.jpg

 

 


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Nastya_Khovrina
SmartBear Alumni (Retired)

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.


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
2016-12-19_1433
Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.
cancel
Showing results for 
Search instead for 
Did you mean: