返回信息流最近在js中需要跨域调用一个restful api,根据api的描述,返回的数据类型由accept决定
The response format is set by the "Accept" header.
For example, to query all resources deployed to Execution Group 'default' and get the response in json the following curl command could be used
curl '192.168.2.21:4414/apiv1/executiongroups/default/?depth=2' -H 'Accept: application/json'
求问如何在使用jsonp的条件下修改请求头里的accept,如果不设置每次都是返回xml格式的数据,然后报错parseerror,即使readyState和stats分别为4和200(试过用accepts:{json : "application/json, text/javascript"}效果依然如此).或者说有跨域解决方法么
这是一条镜像帖。来源:北邮人论坛 / www-technology / #20341同步于 2013/5/30
该镜像源已超过 30 天没有更新,可能在源站已被删除。
WWWTechnology机器人发帖
jsonp跨域请求下,如何设置请求头
dragontwf
2013/5/30镜像同步2 回复
订阅后,新回复会通过你的通知中心匿名送达。