我不断收到以下错误,似乎无法找出我在做什么,任何帮助将不胜感激。
SyntaxError: Unexpected end of JSON input
at parse (<anonymous>)
at Ut (jquery-3.3.1.min.js:2)
at k (jquery-3.3.1.min.js:2)
at XMLHttpRequest.<anonymous>
var jsonData = {
"artist": artistName,
"album": albumName,
"track": trackTitle,
"baseUrl": spotifyLink,
"mediaType": "Music",
"title": trackTitle,
"code": artistName,
"domainId": domainID
};
jsonData = JSON.stringify(jsonData);
$.ajax(
'https://api.linkfire.com/campaigns/boards/' + boardID + '/links', {
type: 'POST',
dataType: 'json',
beforeSend: function(xhr) {
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("Authorization", "Bearer " + window.access_token);
},
data: jsonData,
complete: function(response) {
console.log(response);
},
error: function(jqXHR, textStatus, errorThrown) {
console.log(errorThrown, textStatus, jqXHR);
}
}
);