http-status-code-406

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

一个人想着一个人 提交于 2020-01-04 06:06:07
问题 In a page in my website I have a link as below: <a href="page.php?ref=selectquiz">Go to the page.php</a> 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 HTTP headers: EDIT: That's really weird, because when I convert the parameter value from selectquiz to: selectq selectqu ... selectquiz it's not working, but when

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

一个人想着一个人 提交于 2020-01-04 06:05:14
问题 In a page in my website I have a link as below: <a href="page.php?ref=selectquiz">Go to the page.php</a> 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 HTTP headers: EDIT: That's really weird, because when I convert the parameter value from selectquiz to: selectq selectqu ... selectquiz it's not working, but when

Spring XML 406 error

痞子三分冷 提交于 2020-01-02 05:29:10
问题 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

Spring does not ignore file extension

时间秒杀一切 提交于 2019-12-29 07:10:05
问题 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

Why substring “com.” in GoogleScript convert to “(class)”

柔情痞子 提交于 2019-12-24 20:16:51
问题 Today, the Google script has stopped representing the line normally. In case of occurrence of a line "com." or "org." - substring is replaced by a certain class "(class)". How to fix the problem? function myFunction2() { var t = "testcom.io"; t = t + '1'; t=t; } screenshot from editor https://i.stack.imgur.com/hldbz.png The logger shows the result as well as you do. But during the debugging, the value of the variable T changes. Because of this error, URL Feth does not work. A full script was

Google App Script external API return error 406

…衆ロ難τιáo~ 提交于 2019-12-20 06:26:30
问题 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 ?????

Spring 4.1.1 RELEASE and @ResponseBody return HTTP 406

荒凉一梦 提交于 2019-12-17 19:38:12
问题 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 different configuration? the latest jackson jar is already in the classpath <dependency> <groupId>org.codehaus.jackson</groupId> <artifactId>jackson-mapper-asl</artifactId> <version>1.9.13</version> <

Getting HTTP 406 while calling external site from within servlet

白昼怎懂夜的黑 提交于 2019-12-11 10:57:10
问题 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 ServletException, IOException { URL url = new URL("http://some.url.that.works.well.nl/q=hello&ie=nl&cx=hdyehgfyegywjehdkwed:7364du7"); URLConnection conn = url.openConnection(); conn.connect();

Spring REST consumption results in HTTP Status 406 - Not Acceptable

做~自己de王妃 提交于 2019-12-10 19:59:18
问题 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 @ResponseBody Car getCarById(int id){ return new RestTemplate().getForObject("http://localhost:8080/rest/cars/{id}", Car.class, id); } Here's the code of the Controller which maps the request: