我在从shipstation的api获取数据时遇到问题。我可以看到数据是在网络和预览选项卡下提取的。但是当我尝试将“数据”传递到控制台时,我收到一条解析器错误消息。任何帮助,将不胜感激。谢谢!
var URL = 'http://ssapi.shipstation.com/carriers/';
$.ajax({
type: "GET",
url: URL,
contentType: "application/json; charset=\"utf-8\"",
xhrFields: {withCredentials: true},
dataType: 'json',
success: function (data) {
var output = JSON.parse(data);
console.log('success ' + data + " parsed: " + output);
$('#results').append('<p>' + output + '</p>');
},
// Display errors if any.
error: function(req, err){ console.log('Error Type: ' + err); }
});