How to measure server response time for Python requests POST-request?
问题 I create requests POST-requests like this, where I specify timeout threshold: response = requests.post(url, data=post_fields, timeout=timeout) However, to determine a "good" threshold value, I would like to benchmark the server response time in advance. How do I compute the minimum and maximum response times for the server? 回答1: The Response object as returned by requests.post() has a property called elapsed , which give the time delta between the Request was sent and the Response was