2013-05-02 2 views
2

안녕하세요, OAuth 2.0을 통해 사용자를 인증하는 중이고 Access Control-Allow-Origin 오류가 발생합니다 (XMLHttpRequest cannot load https://www.box.com/api/oauth2/token. Origin http://localhost is not allowed by Access-Control-Allow-Origin.). POST 요청 후 :HTTP 요청을 할 때 Access Control-Allow-Origin 오류가 발생했습니다.

var xhr=new XMLHttpRequest(); 
xhr.open('POST',path,true); 
xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded"); 
xhr.onload = function() { 
    var text = xhr.responseText; 
    alert('Response from request to ' + path + ': ' + text); 
}; 
xhr.onerror = function() { 
    alert('Woops, there was an error making the request.'); 
}; 
xhr.send(params); 

어떤 도움을 주시면 감사하겠습니다! CORS, JSONP 및 콜백 추가에 대해 살펴 보았습니다. =? url에 시도했지만 아무것도 시도하지 않았습니다.

답변

1

http://developers.box.com/docs/

박스 API는 응용 프로그램 별 응용 프로그램으로 CORS를 지원합니다. CORS가 필요한 응용 프로그램을 작성하려면 사용 사례에 대한 설명을 첨부하여 문의하십시오.

+0

아아아, 지적 해 주셔서 감사합니다. – user2066880

0

다른 방법은 FAQ의 devs에서 설명한대로 YQL을 사용하는 것입니다.

관련 문제