Questions tagged [http-status-code-406]

1

votes
0

answer
78

Views

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 internet, I have tried following attempts HttpUriRequest r...
aarav
1

votes
1

answer
262

Views

Spring-boot Actuator endpoints - 406 Not Acceptable

I am getting a 406 Not Acceptable error for my spring-boot actuator endpoints like /health, /env, /info etc I am using spring-boot version 1.5.8 Accessing endpoints like http://localhost:6061/health http://localhost:6061/env Here is bits of my gradle build file buildscript { ext {...
user9176614
1

votes
0

answer
74

Views

EventSource in Angular 6 with JWT - 406 Not Acceptable

I would like to detect events from a URL address in my web application. I implemented it with Spring (backend) and Angular (frontend). I use JWT to sign in. In one of the components, I want to check if a POST method was sent by some user (to check if a notification was added to a database via POST m...
plkpiotr
0

votes
0

answer
3

Views

Error 406 despite providing correct accept/contenttype header for VMware REST API with .NET HTTPClient?

I'm working as an intern on a controll Application(c# WPF) for the VMware workstation REST API to: 'GET' Get the list of currently available VMs on the server. (Done) 'GET' Get the power-status of any VM via ID. (Done) 'PUT' Get any VM to boot. (WIP) 'PUT' Get any VM to shutdown. (WIP) I'm currently...
Sebastian Behrens
1

votes
5

answer
27.1k

Views

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 = getCarById(4); System.out.println(c); } public static...
ndrizza
1

votes
1

answer
412

Views

Spring MVC + RestController gives 406 for resources

i am configuring my project for a small rest app. I am using Spring 4.2.2.RELEASE I have a problem when i create a controller annotated with @RestController or I add @ResponseBody. The css or js resources just stop working and send the error 406 Not aceptable. I read that it is dued to the message c...
jaxkodex
1

votes
1

answer
164

Views

Plivo inbound SMS blocked by Modsec?

Oh, boy - this is a new one for me. I've had a Plivo-powered SMS application running (more or less flawlessly) for several months. 2 days ago, for no reason, it stopped responding to my inbound texts. I didn't have a lot of time to figure it out then, but I finally got time to look at things and i...
Helpful
1

votes
1

answer
1.2k

Views

Why i receive HttpClientErrorException 406 if mediaType is set?

Collegues, i have the method which should send post request into web service public void postPmnt(Document doc) throws TransformerException, HttpServerErrorException { RestTemplate rt = new RestTemplate(); String uri = new String(environment.getProperty('rest.server.endpoint') + environment.getPrope...
May12
1

votes
1

answer
0

Views

Jooby Webserver Always throwing error “406 Not acceptable: text/html”

I'm setting up a simple Jooby Webserver. I have a App.java and a home.html file. For now, the only thing i want it to do, is that if you open the home page it shows a html page saying 'Hello World'. However, I'm always getting the error 'org.jooby.Err: Not Acceptable(406): text/html'. I created the...
abilnf
1

votes
1

answer
518

Views

What could possibly be causing a 406 on an identicaly .json post call?

I'm using a heavy javascript based app that uses a drag and drop feature. It works well. But if I add a dynamic object to the page ( which has the exact same attributes and variables as the other objects ), it drags, but on drop, the POST returns a 406. I'm completely unsure of what could be happeni...
Trip
1

votes
2

answer
732

Views

API kitchen POSTing to drupal service

So I am using http://apikitchen.com/ to debug an issue I am having with a drupal service. I use: http://vmstage.dop.com/mobile/user/login.json as the URL to test. Method is POST and add two parameters: username password Set the username and password as whatever you like. It will return 401 Unauthori...
Ronnie
1

votes
1

answer
867

Views

Drupal8 REST-api for taxonomy terms do not work

I am writing an Angular2 web app with Drupal8 in the backend. I need to convert taxonomy id's to their respective labels, for that I want to use the API endpoint '/taxonomy/term/{taxonomy_term}'. I have enabled the correct REST-API and given access to all roles, however when I try to access that end...
rasmusrim
1

votes
1

answer
2.7k

Views

AngularJS 406 not acceptable http post request

I have a problem with a Post query that I use for a form. I get a '406 not acceptable' error every time I try to validate my form, and Object.data is blank.. var edit = function(form){ var token = window.localStorage.getItem('token'); $ionicLoading.show(); return $http({ method : 'POST', url :...
DaxDev
2

votes
2

answer
6.7k

Views

Spring MVC: jackson-mapper-asl not work with Spring 4

I am trying to convert List of objects into json with the help of jackson-mapper-asl libraries, but in response i got http 406 error. jackson-mapper-asl libraries are on my class path. Following is my Spring MVC controller code: @RequestMapping(value='/find-sub-categories/{parentId}', method=Reques...
Harmeet Singh Taara
5

votes
1

answer
6.2k

Views

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 several tutorials), but I haven't found anything that act...
JDB
11

votes
3

answer
19.3k

Views

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 this considered a bug or the 4.1.1 requires differ...
Dino Tw
1

votes
2

answer
2.3k

Views

Which Status Code for “client requested wrong format”?

Which HTTP Status Code is the best to use for 'Client requested a wrong format', e.g. the client requested format=json and the data is only available as XML? I tend to use 406 but this refers to the Accept heders, whereas the format is given as parameter in the query string in my usecase. Is 406 the...
Florian
3

votes
1

answer
1.4k

Views

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 the correct razor sections. If I deploy this site t...
biofractal
1

votes
2

answer
1.6k

Views

How do I bypass Accept header validation in IIS?

I have a Nancy website hosted on ASP.Net with a number of custom routes. These routes include mappings which look like file paths (e.g. /path/to/xml_file.xml), but that resolve to HTML files which should display in the browser. For most files, this works correctly. However, with XML files (and pos...
erdomke
3

votes
4

answer
7.8k

Views

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 help is appreciated. GreetingController.java: import j...
sparks
2

votes
0

answer
590

Views

POST request returning 406 error

I am using processing to do a simple POST request on a server. I have tried with many accept header configurations and I keep getting Error - 406 Not Acceptable. However, when I do requests with postman (chrome plugin) I get no errors. I get errors with this code, which I irresponsibly tweaked from...
Sergio
3

votes
1

answer
2k

Views

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 format. Also I don't see Spring framework docs have a M...
robin bajaj
4

votes
1

answer
4.2k

Views

Spring does not ignore file extension

In my Spring XML I have the following snippet: From what I understand, this means that Spring should NOT register 'abc.*' and 'abc/' when I have a mapping for 'abc'. In one of my controllers I have a method which writes an image to the response: @RequestMapping(value='{path}', method=RequestMethod.G...
user2221343
3

votes
1

answer
957

Views

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 406 error on me. I've tried throwing everything I can...
Craig L
1

votes
4

answer
7.1k

Views

Getting HTTP 406 while calling external site from within servlet

I have the following code in my servlet: /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ public void doIt(HttpServletRequest request, HttpServletResponse response) throws Ser...
3

votes
2

answer
6.2k

Views

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 error. Everytime I send it with some different 'Acce...
Blink
2

votes
1

answer
2.5k

Views

An appropriate representation of the requested resource /page.php could not be found on this server

In a page in my website I have a link as below: Go to the page.php When I click the link, I get the following error: 406 Not Acceptable An appropriate representation of the requested resource /page.php could not be found on this server. This is the header information which I captured via Live H...
ALH
3

votes
1

answer
2.2k

Views

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 MobileOK validator doesn't include 'image/png' or...
bdares
2

votes
1

answer
527

Views

Rails, Devise Invitations 406 Unacceptable error with STI

There are similar questions but I've gone over them and none of them have applied. I am using Devise and Devise invitations. Rails 3.2.6. The tricky thing is I have two user models. User and a single table inheritance setup where Artist inherits from User. I have two invitations controllers to a...
ScotterC
2

votes
0

answer
95

Views

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 attribute routing. I have seen examples on how to us...
mcwrath
2

votes
1

answer
600

Views

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 response generated on the server side: Response resp...
angularJsNewbie
5

votes
3

answer
626

Views

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 mobile side I get a 406 error. (I tried this after s...
tvalent2
2

votes
3

answer
65

Views

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 = MediaType.APPLICATION_JSON_VALUE) public @ResponseBody ResponseEntity path( ... Response...
user7294900
2

votes
1

answer
1k

Views

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 activeDirectoryClient = new ActiveDirectoryClient(serviceRoot, async () => await Ac...
mpjjonker
2

votes
2

answer
78

Views

Unauthorize response turning into 406 using OData

I just upgraded to Microsoft.AspNet.OData v6.0.0, and started encountering 406 status codes. I was able to fix most of them by changing using System.Web.Http.OData; to using System.Web.OData;, however I'm still having issues with custom error responses. When an authorization/exception filter sets th...
Brett Allen
3

votes
1

answer
1.5k

Views

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 long.. but still can figure out why.. Few suspicious p...
Ip ziet
3

votes
0

answer
393

Views

“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 error which is: The requested resource is only capable...
Jake Rayson
3

votes
2

answer
388

Views

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 truncated). But now we have realised that the proble...
Nina
2

votes
0

answer
328

Views

Why is PHP cURL on Linux changing the Content-Type request header?

It seems PHP's built-in cURL module changes the header fields before sending them. I developed a small class to communicate with an encoder device trough HTTP requests, using cURL to do the task. The code works fine under Windows, however, when I run it under Debian, the device responds with an HTTP...
Gergely Lukacsy

View additional questions