【问题标题】:Survey JS get survey results response in Json instead of XML调查 JS 在 Json 而不是 XML 中获取调查结果响应
【发布时间】:2021-03-31 22:54:35
【问题描述】:
【问题讨论】:
标签:
javascript
json
xml
surveyjs
【解决方案1】:
我认为您需要确保您的请求有一个值为“application/json”的“Accept”标头。
例如,如果你使用 jQuery,你可以这样做:
var settings = {
"url": "https://api.surveyjs.io/private/Surveys/getSurveyPublicResults/{id}?from={from}&till={till}",
"method": "GET",
"timeout": 0,
"headers": {
"Accept": "application/json; charset=utf-8"
},
};
$.ajax(settings).done(function (response) {
console.log(response);
});