Questions tagged [http-status-code-406]

The HTTP response status code 406 Not Acceptable

The requested resource is only capable of generating content not acceptable according to the Accept headers sent in the request.

See also RFC2616.

176 questions
232
votes
11 answers

What is "406-Not Acceptable Response" in HTTP?

In my Ruby on Rails application I tried to upload an image through the POSTMAN REST client in Base64 format. When I POST the image I am getting a 406 Not Acceptable Response. When I checked my database, the image was there and was successfully…
Cyber
  • 4,844
  • 8
  • 41
  • 61
16
votes
2 answers

Set headers on get request angular 2

I try to set an Authorization header to a GET request to authenticate users to a rest API. I'm using Angular 2 RC1. (I'am a total beginner). getTest(){ let authToken = localStorage.getItem('auth_token'); let headers = new Headers({…
11
votes
3 answers

Spring 4.1.1 RELEASE and @ResponseBody return HTTP 406

I am using @ResponseBody to return Json object in Spring MVC. It works as expected on release 4.0.7 and 3.2.11, but it returns HTTP status 406 when I try to use the latest Spring release 4.1.1(as of 10/16) with no any other configuration changes. Is…
Dino Tw
  • 3,167
  • 4
  • 34
  • 48
9
votes
1 answer

ODataController returning HTTP 406 Not Acceptable

I'm building an OData 3 service on Web API 2.2. The service is correctly returning the metadata for my entities, but returns 406 Not Available when I query one of the actual entities. I've done quite a bit of research (I'm currently following…
JDB
  • 25,172
  • 5
  • 72
  • 123
8
votes
7 answers

Spring REST consumption results in HTTP Status 406 - Not Acceptable

I get this error when i try to consume a REST API: Exception in thread "main" org.springframework.web.client.HttpClientErrorException: 406 Not Acceptable Here's the client code that gets executed: public static void main(String[] args) { Car c =…
ndrizza
  • 3,285
  • 6
  • 27
  • 41
7
votes
3 answers

I Call API from PYTHON I get the response 406 Not Acceptable

I created a API in my site and I'm trying to call an API from python but I always get 406 as a response, however, if I put the url in the browser with the parameters, I can see the correct answer I already did some test in pages where you can tests…
Samper
  • 73
  • 1
  • 4
6
votes
4 answers

Spring XML 406 error

I am trying to make a RESTful service using Java, using several tutorials and many, MANY StackOverflow entries. Unfortunately I don't seem to be able to get my code to work, I am persistantly getting Http 406 when I try and hit the endpoint. Any…
sparks
  • 736
  • 1
  • 9
  • 29
6
votes
1 answer

Can cookies be set from 4xx responses?

I just tried setting (actually, deleting - via max age set to 0) a session cookie, when I detect a specific client error. The HTTP response I am using is from the 4xx category (e.g. 401, 406, etc). The cookie deletion works fine with this kind of…
angularJsNewbie
  • 495
  • 2
  • 8
  • 14
5
votes
3 answers

Rails 3 :mobile MIME type throws 406 error after attempt to load content with JavaScript

I'm following Railscast #199 to allow my web app to be viewed in a mobile browser. It works great, except when I try to access information in a tabbed interface using UJS in the mobile version. Clicking on the tabs works in the web app, but on the…
tvalent2
  • 4,959
  • 10
  • 45
  • 87
4
votes
2 answers

NotAcceptableException (HTTP 406 Not Acceptable) but no apparent error from MessageBodyWriter

In a webapp implemented as a Jetty container, we have a custom javax.ws.rs.ext.MessageBodyWriter annotated with @Singleton @Provider @Produces( "application/rss+xml" ) We also have a resource which works just fine. The get() method is annotated…
Stewart
  • 17,616
  • 8
  • 52
  • 80
4
votes
0 answers

Localhost download with RestTemplate results in 406

I am testing download a file from localhost by restTemplate: Here is my test: @Test public void download_test() throws Exception { List> messageConverters = new ArrayList>(); …
kitty 23
  • 43
  • 3
4
votes
1 answer

spring mvc rest protocol buffers http 406 not acceptable error

I am using Spring MVC 4.1.5 with its REST support trying to get a web service working with google protocol buffers message format. I have seen a lot of posts that are mentioning this issue with JSON format but none with google protocol buffers…
Robin Bajaj
  • 2,002
  • 4
  • 29
  • 47
4
votes
7 answers

406-Not Acceptable Response - jQuery AJAX

I am receiving the 406 error when I am sending a JSON data object through the jQuery AJAX function to a backend service so the data can be stored into the database. AJAX FUNCTION data = { questions: questions, test_id: test_id, action:…
12Bo
  • 116
  • 1
  • 3
  • 11
4
votes
1 answer

Spring does not ignore file extension

In my Spring XML I have the following snippet:
user2221343
  • 614
  • 5
  • 16
3
votes
0 answers

Error 406 with IIS 6

I'm making a web site that must conform to MobileOK. When I run the validator, it receives a "406" error whenever it attempts to retrieve a jpeg or png file, but gif files are fine. What I think is causing it is that the "Accept:" header sent by the…
user684934
1
2 3
11 12