Ruby HTTPClient 检查 cookie 是否已发送
我收到“400 无效请求方法”。对于下面的 GET 请求。 难道是因为我以某种方式设置了 cookie(服务器要求的)错误?我该如何检查? 还能是什么? (这是针对 OpenX 的)
url = URI.parse("https://some.domain/path")
cookie = WebAgent::Cookie.new
cookie.name = "some_token"
cookie.value = "some_value"
cookie.url = url
clnt = HTTPClient.new
clnt.cookie_manager.add(cookie)
clnt.get(url)
I am getting a "400 Invalid request method." for the GET request below.
Could that be because I somehow set the cookie (that is demanded by the server) wrong? How can I check that?
What else could it be? (This is for OpenX)
url = URI.parse("https://some.domain/path")
cookie = WebAgent::Cookie.new
cookie.name = "some_token"
cookie.value = "some_value"
cookie.url = url
clnt = HTTPClient.new
clnt.cookie_manager.add(cookie)
clnt.get(url)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
错误在最后一行:应该显示 clnt.put(url) 。
The error is in the last line: it should say clnt.put(url) there.