open api를 사용해서 데이터를 받아오려고 하는데
문서에는
curl --request GET \
--url 'https://apis.openapi.sk.com/tmap/pois?version=1&searchKeyword=SK%20T%ED%83%80%EC%9B%8C&page=1&searchType=all&count=20&resCoordType=WGS84GEO&multiPoint=N&searchtypCd=A&reqCoordType=WGS84GEO&poiGroupYn=N' \
--header 'Accept: application/json' \
--header 'appKey: [확인한 appKey값]'
이런식으로 요청하면 되는것 같은데
axios 를 사용해서 요청하려고 하면 어떻게 작성해야 하나요??
const apiRequest = async () => {
const result = await axios.get(
"https://apis.openapi.sk.com/tmap/pois?version=1&searchKeyword=SK%20T%ED%83%80%EC%9B%8C&page=1&searchType=all&count=20&resCoordType=WGS84GEO&multiPoint=N&searchtypCd=A&reqCoordType=WGS84GEO&poiGroupYn=N",
{
header: {
"Accept: application/json",
"appKey: [나의앱키]",
},
}
);
console.log(result);
};
저는 이런식으로 작성해봤는데 에러가 납니다 ㅠㅠ