작성한 질문수
(2024 최신 업데이트)리액트 : 프론트엔드 개발자로 가는 마지막 단계
20. 네번째 포트폴리오 프로젝트
작성
·
235
0
useParams로 id를 가져왔는데 그다음 가져온 id에 맞는 이미지나 정보는 어떻게 가져와야 될까요...?
답변 2
감사합니다!
안녕하세요
이 api를 이용하시면 각각의 영화 디테일 정보를 가져올 수 있습니다
https://developers.themoviedb.org/3/movies/get-movie-details
path parameter 값으로 movie_id를 받고있죠
url 끝에 영화id값을 넣어주시고 api호출해주시면 됩니다
위 api로 id를 넣고 호출하면 아래와 같은 error가 납니다
Access to fetch at 'https://developers.themoviedb.org/3/movies/get-movie-details/movies/663712' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
어느 부분이 잘못 된 것 인지 알려주세요
위 api로 id를 넣고 호출하면 아래와 같은 error가 납니다
Access to fetch at 'https://developers.themoviedb.org/3/movies/get-movie-details/movies/663712' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
어느 부분이 잘못 된 것 인지 알려주세요