I am using a proxy which I have made on my own so as to perform the map export tasks. I have noticed that GET/POST requests use the content-type header: application/x-www-form-urlencoded.
However sometimes, when it uses GET request the application/x-www-form-urlencoded is not added and I am getting a 415 error from my proxy. More specifically I am getting :
WARN | JAXRSUtils | No message body reader has been found for request class MultivaluedMap, ContentType : application/octet-stream.
Do you have any idea why the esri request does not use that header? Also, any ideas how could I force the print task execute and the proxy so as to use the specific content type?
Here is my code:
require(["esri/tasks/PrintTask","dojo/_base/json","esri/config","esri/urlUtils" ], function(PrintTask,JSON, esriConfig,urlUtils) { mapExportService = "http://blablabla/execute" urlUtils.addProxyRule({ urlPrefix: mapExportService, proxyUrl: "rest/api/download/proxy" }); var printTask = new esri.tasks.PrintTask(mapExportService); var Web_Map_as_JSON = JSON.toJson(printTask._getPrintDefinition($scope.map)); var template = new esri.tasks.PrintTemplate(); template.format = data.format; template.layout = ""; template.layout = "A4 Landscape"; var params = new esri.tasks.PrintParameters(); params.map = $scope.map; params.template = template; printTask.execute(params, printResult, errorHandler); });
أكثر...
However sometimes, when it uses GET request the application/x-www-form-urlencoded is not added and I am getting a 415 error from my proxy. More specifically I am getting :
WARN | JAXRSUtils | No message body reader has been found for request class MultivaluedMap, ContentType : application/octet-stream.
Do you have any idea why the esri request does not use that header? Also, any ideas how could I force the print task execute and the proxy so as to use the specific content type?
Here is my code:
require(["esri/tasks/PrintTask","dojo/_base/json","esri/config","esri/urlUtils" ], function(PrintTask,JSON, esriConfig,urlUtils) { mapExportService = "http://blablabla/execute" urlUtils.addProxyRule({ urlPrefix: mapExportService, proxyUrl: "rest/api/download/proxy" }); var printTask = new esri.tasks.PrintTask(mapExportService); var Web_Map_as_JSON = JSON.toJson(printTask._getPrintDefinition($scope.map)); var template = new esri.tasks.PrintTemplate(); template.format = data.format; template.layout = ""; template.layout = "A4 Landscape"; var params = new esri.tasks.PrintParameters(); params.map = $scope.map; params.template = template; printTask.execute(params, printResult, errorHandler); });
أكثر...