新手问题 RestClient 发送请求,遭遇 302 跳转如何解决?

chancedoor · 2013年05月15日 · 最后由 yesmeck 回复于 2013年05月15日 · 6804 次阅读

我要发送请求到一个网站,它接到请求后跳转到一个页面,这个页面里包含我需要的结果,现在response=RestClient.post url, post_params , headers会 302 Found 咋搞?

https://github.com/rest-client/rest-client#result-handling

RestClient.post(url) { |response, request, result, &block|
  if [301, 302].include? response.code
    response.follow_redirection(request, result, &block)
  else
    response.return!(request, result, &block)
  end
}
huacnlee [该话题已被删除] 提及了此话题。 07月27日 16:17
需要 登录 后方可回复, 如果你还没有账号请 注册新账号