
[API] CORS 에러발생과 해결법 (feat. 프록시 서버 활용)
기타
2022. 2. 2. 03:54
오늘 API를 통해 데이터를 받아오는 것을 공부하고 있는데, CORS에러가 떴다.. 공공데이터포털에서 데이터를 받아오는데, 아래와 같이 URL요청을 하니 에러가 발생했다. methods : { search : function(){ var self = this; var url = apiURL + '?serviceKey=' +apiKey + '&pageNo=' + this.pageNo + '&numOfRows=' + this.numOfRows + '&nrsry_type=' + this.nrsryType; axios.get(url).then(function(result) { // url호출 -> 공공데이터포털로 데이터 요청을 보낸다. (request) self.apiList = result.data.items..