채팅 API를 Viber에 통합하기 위해 나머지 API에 따라 일부 코드를 프로그래밍했습니다., 왜 구문 분석 및 누락 된 인증 토큰 오류가 있습니까?
그것의 핵심 부분은 - :
$.ajax({
url : url ,
dataType : "jsonp",
type : 'POST',
jsonpCallback: 'fn',
headers: {
'X-Viber-Auth-Token': '45a53f0fcb325002-41552d1f93cd0d0f-1a8d7fa78758d158'
},
data : {
"url": "",
"event_types": ["delivered", "seen", "failed", "subscribed","unsubscribed", "conversation_started"]
},
success : function (data) {
//console.log(data);
},
error : function (data, errorThrown) {
//console.log(data);
alert(errorThrown);
}
});
내가 구문 분석 오류가 점점 오전과 구문 분석 오류는 "catch되지 않은 구문 에러 : 예기치 않은 토큰". - : https://manveer695.github.io/hello-world/viberStuff.html에서 코드를 방문하여 직접 오류를 확인할 수 있습니다.
구문 오류 또는 다른 문제가 있습니까? 미리 감사드립니다. :)
복제본에서 말하는 문제는 응답이 JSONP가 아니지만'dataType : "jsonp"'를 설정한다는 것입니다. 하지만 JSONP는 사용자 정의 HTTP 헤더 및 POST 요청과 호환되지 않습니다. – Quentin