stackexchange-api

JSONP request returning error: “Uncaught SyntaxError: Unexpected token :”

。_饼干妹妹 提交于 2019-11-26 19:59:10
问题 So I'm trying to make a request to the Stack Exchange API with the following jQuery code: $.ajax({ type: 'POST', url: 'http://api.stackoverflow.com/1.1/stats', dataType: 'jsonp', success: function() { console.log('Success!'); }, error: function() { console.log('Uh Oh!'); } }); But when I open the file on my machine, in either FireFox or Chrome, and make the request, I get this error: Resource interpreted as Script but transferred with MIME type application/json. Uncaught SyntaxError:

How to parse gzip encoded response with RestTemplate from Spring-Web

二次信任 提交于 2019-11-26 16:18:32
问题 After I modified Consuming a RESTful Web Service example to call get users by id from api.stackexchange.com I get JsonParseException: com.fasterxml.jackson.core.JsonParseException: Illegal character ((CTRL-CHAR, code 31)): only regular white space (\r, \n, \t) is allowed between tokens Response from api.stackexchange.com is gzip compressed. How to add support for gzip compressed response into Spring-Web RestTemplate? I am using Spring boot parent ver. 1.3.1.RELEASE hence Spring-Web 4.2.4