获取对 HTTPS GET 请求的原始、未解析的响应
您将如何获得对 HTTPS 请求的完全未解析的响应?
是否有任何 HTTP 库可以让您获取原始响应,或者使用套接字手动构造请求是唯一的方法吗?
我特别想看看服务器正在发送哪些换行符。
How would you go about getting a completely unparsed response to a HTTPS request?
Are there any HTTP libraries that will allow you to get at the raw response, or is constructing a request manually using sockets the only way?
I'm specifically trying to see what newline characters the server is sending.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
文档示例:
输出
M2Crypto 示例。
Example from the docs:
Output
Example with M2Crypto.
这取决于您要如何处理结果。
httplib.HTTPSConnection
有set_debuglevel
方法,允许将响应数据打印到 stdout(尽管每行都有前缀)。出于调试目的,这正是我所需要的。不确定,这就是你所需要的。It depends on what you are going to do with the result.
httplib.HTTPSConnection
hasset_debuglevel
method which allows printing the response data to stdout (though each line is prefixed). For debugging purposes that was exactly what I needed. Not sure, it is what you need.