开发者

How to add HTTPHeader to XJSONDataSource?

Tried this, but no luck, even do not know whether it is write way of implementation.

    Map<String, String> headers = new LinkedHashMap<String, String>();
    headers.put("Accept", "application/json");

    DSRequest reque开发者_JAVA技巧st = new DSRequest();
    request.setHttpHeaders(headers);       

    XJSONDataSource ds = new XJSONDataSource();
    ds.setDataProtocol(DSProtocol.GETPARAMS);
    ds.setRequestProperties(request);
            ds.setDataURL("http://cross_domain");
    ds.fetchData();

I am trying for cross-domain calls to JSON services, if anyone have good example or tutorial please feel free to refer. Thanks in advance for your help.


Removed headers from above code and started working seamlessly. I guess XJSONDataSource does not like headers.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜