CORS error 질문점요~

CORS error 질문점요~

QA

CORS error 질문점요~

답변 1

본문

a.com    b.com

두개의 도메인이 있습니다

XMLHttpRequest 를 활용해서 

데이터를  A -> B로  전송시

별다른 수정없이 전송하면  잘 넘어갑니다~

근데  여기에  setRequestHeader("임의헤더", "임의값")  을 추가해서 전송을하면

CORS error  가 발생하는데요...  임의로  헤더에  사용자값을 넣어서 전송은 못하는건가요?

 

php CURL, 포스트맨에서 테스트로 임의로 헤더 추가해서 하면 잘되든데....

자바스크립트로는 안되는건가요?

 

 

 

이 질문에 댓글 쓰기 :

답변 1

https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors

 For security reasons, specifics about what went wrong with a CORS request are not available to JavaScript code. All the code knows is that an error occurred. The only way to determine what specifically went wrong is to look at the browser's console for details.

참고하세요.

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 6
© SIRSOFT
현재 페이지 제일 처음으로