Hotels

PAYANT
Verified
Par Api Dojo | Mise à jour 14日前 | Travel
Popularité

9.8 / 10

Latence

2,272ms

Niveau de service

100%

Health Check

N/A

Retour à toutes les discussions

404 respone status please help

Rapid account: Yashnihalani
yashnihalani
1年前

i am trying to hit by search endpoint .
please check my code snippet below.
(Ruby on rails)

def request_api(url)
response = Excon.get(
url,
headers: {
‘X-RapidAPI-Host’ => URI.parse(url).host,
‘X-RapidAPI-Key’ => ‘MY_KEY’
}
)
puts(response.status)

return nil if response.status != 200
JSON.parse(response.body)

end
def find_city(name)
request_api(
https://hotels4.p.rapidapi.com/locations/search/#{URI.encode(name)}
)
end

Rapid account: Apidojo
apidojo Commented 1年前

Hello,

1/ I am sorry that I cannot help you with coding.
2/ You are using a deprecated endpoint.
3/ The requested URL is totally wrong. It should be “…/locations/v3/search?q=chiang mai” . I am not sure why you put “…/#…” in the URL?!

Regards.

Participez à la discussion - ajoutez un commentaire ci-dessous:

Connectez-vous / Inscrivez-vous pour publier de nouveaux commentaires