http-status-code-406

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

旧时模样 提交于 2019-12-10 18:52:09
问题 (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 problem still exists, but only for email addresses ending on .com or .org. This is very weird. Shortly, I use Spring Annotations building a REST Service. I have a GET request with three parameters, the

Error 406 with IIS 6

牧云@^-^@ 提交于 2019-12-10 18:16:47
问题 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 "image/jpg", rather it only includes "image/jpeg" and "image/gif". So, I stripped all of the png files out of the site and replaced them with gif and jpeg files, renaming any ".jpg" to ".jpeg". I

ODataController returning HTTP 406 Not Acceptable

筅森魡賤 提交于 2019-12-06 01:34:16
问题 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 actually works. Here's my WebApiConfig: using System; using System.Collections.Generic; using System.Linq; using System.Web.Http; using System.Web.OData.Builder; using System.Web.OData.Extensions;

Spring XML 406 error

百般思念 提交于 2019-12-05 09:46:28
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 java.util.Random; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation

ODataController returning HTTP 406 Not Acceptable

两盒软妹~` 提交于 2019-12-04 06:08:46
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 actually works. Here's my WebApiConfig: using System; using System.Collections.Generic; using System.Linq; using System.Web.Http; using System.Web.OData.Builder; using System.Web.OData.Extensions; namespace MyProject { public static class WebApiConfig { public static void Register(HttpConfiguration

Google App Script external API return error 406

若如初见. 提交于 2019-12-02 09:53:29
I'm trying to fetch a URL using optional advanced parameters in GAS: function myFunction() { var options = {}; options = { headers: { Authorization: 'Bearer ?????', 'Content-Type': 'application/json', }, }; UrlFetchApp.fetch(<url>, options); } I always get: Request failed for returned code 406 (line 52, file "Project"). HTTPResponse: SyntaxError: Empty JSON string I did the same fetching in Excel Power Query: let Source = Json.Document(Web.Contents(<URL>, [Headers=[Authorization="Bearer ?????????????", ContentType="application/json"]])), And it works, it works also using Postman... What's the

406 Not Acceptable error GET parameter issue?

喜夏-厌秋 提交于 2019-11-29 13:02:13
Can anyone please tell me why the following URL returns a 406 error: http://kolek.to/functions/remote-upload.php?url=http%3A%2F%2Fben-major.co.uk%2Fhosting%2Fbm-equipment%2Faxe-2.jpg&item_id=2 Removing the ?url= parameter seems to make everything fine: http://kolek.to/functions/remote-upload.php?item_id=2 For your reference, the content of remote-upload.php is as follows: <?php require_once('../models/api.php'); $request_url = urldecode($_REQUEST['url']); $item_id = $_REQUEST['item_id']; echo $item_id; ?> I think that this is due to the security filter from your server (I see in the response

Spring does not ignore file extension

拟墨画扇 提交于 2019-11-29 08:01:32
In my Spring XML I have the following snippet: <bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"> <property name="useDefaultSuffixPattern" value="false"/> </bean> <mvc:annotation-driven> <mvc:message-converters> <bean class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter"> <property name="objectMapper" ref="objectMapper" /> </bean> </mvc:message-converters> </mvc:annotation-driven> 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

406 Not Acceptable error GET parameter issue?

倖福魔咒の 提交于 2019-11-28 06:39:59
问题 Can anyone please tell me why the following URL returns a 406 error: http://kolek.to/functions/remote-upload.php?url=http%3A%2F%2Fben-major.co.uk%2Fhosting%2Fbm-equipment%2Faxe-2.jpg&item_id=2 Removing the ?url= parameter seems to make everything fine: http://kolek.to/functions/remote-upload.php?item_id=2 For your reference, the content of remote-upload.php is as follows: <?php require_once('../models/api.php'); $request_url = urldecode($_REQUEST['url']); $item_id = $_REQUEST['item_id']; echo

What is “406-Not Acceptable Response” in HTTP?

别说谁变了你拦得住时间么 提交于 2019-11-25 23:18:32
问题 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 saved. What is the reason for this error, is there anything I need to specify in my header? My request: URL --- http://localhost:3000/exercises.json Header: Content-Type - application/json Raw data: { \"exercise\": { \"subbodypart_ids\": [ \"1\", \"2\"