로그인버튼을 누른뒤 → 토큰을 받아서 그토큰을 이용해서 send버튼을 눌렀을때 나에게 메시지 보내기를 이용할려고 하는데요
localhost에서 카카오restapi 도메인을 호출해서 문제인거 같은데 (크로스도메인 문제 ) 이럴때는 어떻게 해결해야하나요??
‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://localhost:3000’ is therefore not allowed access. The response had HTTP status code 400.
해당 소스는 아래와 같습니다.
$(’#send’).click(function(){
$.ajax({
url:'https://kapi.kakao.com/v1/api/talk/memo/send',
type:'post',
data:{'template_id' :'4024',' Header': 'Authorization: Bearer '+sTocken},
success:function(data){
$('#time').text(data);
}
})
})