I'm using DoJo 1.6.1 for accessing my REST web service. To get the response in JSON I need to set the Aceept
header field to application/json
.
According to the DoJo documentation this is done by setting the headers
property on the request, like to following:
var xhrArgs = {
url: "http://localhost/myservice",
he开发者_开发百科aders: { "Accept": "application/json" },
handleAs: "json",
load: successCallback,
error: errorCallback
}
var deferred = dojo.xhrGet(xhrArgs);
I also used dojo.io.script.get(jsonpArgs);
with the same issue: accept is of the value */*
on the server side. I'm using Firefox 5.0.1 (also tried with Safari and Firefox on Windows).
Any suggestions what the problem is? Thanks in advance! :)
精彩评论