Hotels

付费
Verified
通过 Api Dojo | 已更新 vor 8 Tagen | Travel
人气

9.8 / 10

延迟

2,273ms

服务等级

100%

Health Check

N/A

返回所有讨论

404 respone status please help

Rapid account: Yashnihalani
yashnihalani
एक वर्ष पहले

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 एक वर्ष पहले

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.

加入讨论 - 在下面添加评论:

登录/注册以发布新的评论