devgraphy / airsm-django-restapi

AIRSM 프로젝트의 REST API 기반 Back-end
0 stars 0 forks source link

[27/May/2021 17:50:27] "OPTIONS /users/signup HTTP/1.1" 200 #13

Closed devgraphy closed 3 years ago

devgraphy commented 3 years ago

axios.post를 요청했는데 왜 OPTIONS가 응답하는가

개발자도구 에러 1.

Access to XMLHttpRequest at 'http://localhost:8000/users/signup' from origin 'http://localhost:11564' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

2.

POST http://localhost:8000/users/signup 404 (Not Found)

3.

Uncaught (in promise) Error: Network Error
    at createError (createError.js:16)
    at XMLHttpRequest.handleError (xhr.js:84)
devgraphy commented 3 years ago

https://stackoverflow.com/questions/30361460/sending-response-to-options-in-python-flask-application

devgraphy commented 3 years ago

https://okky.kr/article/498449 같은 이슈 CORS 올바르게 이해하기1 CORS 올바르게 이해하기2

devgraphy commented 3 years ago

첫 번째 이슈는 CORS_ALLOWED_ORIGINS에 https 가 아닌 http로 클라이언트의 도메인을 입력하니 해결 다음 이슈 발생 "POST /users/signup/ HTTP/1.1" 404 2097

devgraphy commented 3 years ago

[28/May/2021 16:18:09] "GET /membership/users/ HTTP/1.1" 200 11058

url문제 였다.