开发者

DoJo Toolkit additional headers not set on request

开发者 https://www.devze.com 2023-03-27 18:03 出处:网络
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.

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! :)

0

精彩评论

暂无评论...
验证码 换一张
取 消