GeoDB Cities

부분 유료
Verified
분류별 Michael Mogley | 업데이트됨 לפני 21 ימים | Data
인기

9.9 / 10

지연 시간

54ms

서비스 수준

100%

Health Check

100%

모든 토론으로 돌아가기

Expected format for axios.get - Fixed

Rapid account: Michelehobson
michelehobson
לפני 6 חודשים

Hi,

I am doing a project for school and one of the requirements is that I use the axios.get method.
I’ve tried a variety of combinations, but it keeps returning 401 unauthorized.

I’ve tried:
const countries = await axios.get(https://wft-geo-db.p.rapidapi.com/v1/geo/countries?X-RapidAPI-Key=${key}?X-RapidAPI-Host=${host});

key and host both work when I use the code supplied by GeoDb.
Does anyone know how the string should be formatted? Also, when using the GeoDb code it only returned five countries. Any idea why?
Thank you

Rapid account: Wirefreethought
wirefreethought Commented לפני 6 חודשים

I believe the default page-size limit imposted by the GeoDB client is 5. You are getting the first page of country results. To see the next, set the offset appropriately. You can increase the limit to 10 on the Basic plan.

Rapid account: Wirefreethought
wirefreethought Commented לפני 6 חודשים

The key and host params are request headers. They should NOT appear in the query string. You need to submit them as headers in the axios.get call.

아래에 의견을 추가하고 토론에 참여하세요.

새 댓글을 게시하려면 로그인 / 가입