使用Python的requests
库,是否有可能获得接收和发送数据的确切时间戳,例如报头或有效负载数据?你知道吗
示例:
import requests
url = 'http://mytest.url'
headers = {'User-Agent': 'My Agent'}
payload = 'Hello World'
response = requests.post(url, payload, headers)
print response
输出(注意,报头和有效负载数据可能有不同的接收时间戳!)地址:
2019/10/09 13:00.05.12345 >> POST http://mytest.url HTTP/1.1
2019/10/09 13:00.05.67890 >> User-Agent: My Agent
2019/10/09 13:00.06.12345 >> Hello World
2019/10/09 13:00.10.12345 << HTTP/1.1 200 OK
2019/10/09 13:00.11.12345 << Connection: Keep Alive
2019/10/09 13:00.12.12345 << Hello My Agent
问候, 史蒂夫
目前没有回答
相关问题 更多 >
编程相关推荐