开发者

403 Developer Inactive on an HTTP pull

I am trying to query some XML from开发者_运维百科 a hotel database using Ruby, and am getting the results:

403 Developer Inactive

I used the code:

require 'net/http'

url = URI.parse('URL of the HTTP query')
req = Net::HTTP::Get.new(url.path)
res = Net::HTTP.start(url.host, url.port) {|http|
  http.request(req)
}
puts res.body

I would give the actual URL, but it contains the API key/etc...so I really cannot divulge it.

Is there anything wrong with the code or might it be on the company needing to activate the key?

Thanks


403 is the HTTP status code FORBIDDEN, which leads me to believe you have a problem authenticating your API request, maybe because of a wrong key or something.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜