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
3
votes
2 answers

Spring 3 REST with XML gives "406 Not Acceptable"

I'm trying to implement REST Remoting using Spring 3 but I can't get through "406 Not Acceptable" error... I try to remote 1 service that is returning an application/xml content. Everytime I send a request with "Accept=application/xml", I get 406…
Blink
  • 1,408
  • 13
  • 21
3
votes
1 answer

406 error preventing a bot from crawling page

I am using SEMrush for SEO purposes. I am unsure why I am receiving the following error on their site for crawling my page: We couldn't crawl this page using the SEMrushBot user agent due to an HTTP error 406. Nevertheless, we were able to collect…
Paul
  • 3,348
  • 5
  • 32
  • 76
3
votes
2 answers

.Net Core MVC - cannot get 406 - Not Acceptable, always returns 200 OK with Json

I want my application to respect browser accept header and return 406, if it does not match the response format. I have this options set in Mvc configuration: /// /// This method gets called by the runtime. Use this method to add…
3
votes
1 answer

Connecting with ADAL to Microsoft Graph gives 406 error

I am trying to get a ActiveDirectoryClient in a C# client, like this: Uri servicePointUri = new Uri("https://graph.microsoft.com/v1.0/me/messages"); Uri serviceRoot = new Uri(servicePointUri, ); ActiveDirectoryClient…
mpjjonker
  • 917
  • 1
  • 6
  • 28
3
votes
0 answers

Phoenix - JSON API 406 Not Acceptable response

I started a brand new Phoenix project and am using JASerializer for my JSON API. I followed the documentation for what to add to my project, so I have: config/config.esx config :phoenix, :format_encoders, "json-api": Poison config :plug, :mimes,…
3
votes
0 answers

How to make an API throw 406 or 415 codes during content negotiation

When building a RESTful API, it is desirable to issue return codes of 406 (not acceptable) and 415 (Unsupported media type) when doing content negotiation. What is not clear to me is exactly how to return these codes in a WebAPI2 app that is using…
3
votes
2 answers

Get Request fails for .com email addresses because Spring interpretes it as a extensions

(See edit part below 20.08.2015) I had a similar problem recently (Get request only works with trailing slash (spring REST annotations)) and the solution was to add a regex to the value of @RequestMapping (see also Spring MVC @PathVariable getting…
Nina
  • 681
  • 1
  • 10
  • 27
3
votes
1 answer

convert curl to coldfusion cfhttp

I have a curl call that works like a charm: curl -X POST -H 'Content-Type: application/xml' -H "X-ApiVersion: 1.0" -H "X-AccessToken: [api-token]" -d '[xml]' https://www.API.com I've tried to convert it to coldfusion, but the server kicks back a…
Craig L
  • 63
  • 1
  • 7
3
votes
0 answers

"406 Not Acceptable" error when trying to use Composer to install private repo

I'm trying to get my head around the PHP dependency manager Composer, so that I can install a package from a private GitHub repository. I've followed the instructions about using private repositories for a test repo, and I'm getting a weird 406…
Jake Rayson
  • 921
  • 7
  • 20
3
votes
1 answer

Why this XMLHttpRequest cause http 406

It is a XMLHttpRequest to get a json form. I tested it on 3 different host: localhost: http 200 my test VPS host: 200 my shared host godaddy: 406 I have compared the headers again and again. Then I googled and read so many articles the whole day…
Ip ziet
  • 307
  • 2
  • 13
3
votes
1 answer

406 response when NancyFX site tries to server razor views

My NancyFX site, employing cshtml razor views, asp.net and IIS7, works just fine locally. It works via the VS12 built in 'ASP.NET Development Server' and also as a standalone site through my local copy of IIS7. I have ensured my web.config contains…
biofractal
  • 18,963
  • 12
  • 70
  • 116
2
votes
1 answer

Image serving returns 406 (Not Acceptable) when requested from img markup

I'm trying to fetch images from Symfony. /** * @Route("/provide/image/{filename}") */ public function provideImage($filename) { $path = 'myimgdir/' . $filename; $response = new BinaryFileResponse($path); return $response; } When I call this…
Bob
  • 1,495
  • 1
  • 19
  • 24
2
votes
1 answer

Spring Boot 406 status code for PUT Request

Code is @RestController @Component @Slf4j public class ServicesController { @CrossOrigin @PutMapping( consumes = "multipart/form-data", path = "/{id}/{route}/structure_article/{filename:.+}") public…
Tanvi Shah
  • 21
  • 2
2
votes
3 answers

Spring RequestMapping in RestController returns 406

Inside @RestController I have a @RequestMapping which works except I'm getting 406 in client while trying to return POJO class ResponseVO @RequestMapping(value = "path", method = RequestMethod.POST , produces =…
Ori Marko
  • 56,308
  • 23
  • 131
  • 233
2
votes
0 answers

HttpGet returns 406 error after setting Accept header

I have a url with ending &filename=xxxx after hitting it through browser, it redirects to some XXX url start downloading the expected zip file. When I try to hit the same url through Java code, it reutrns 406 Not Acceptable. After search in…
aarav
  • 230
  • 1
  • 4
  • 21
1
2
3
11 12