I am currently doing a HTTP Post request to a server in Python 2.7 with requests.post()
which takes around 700ms. There is also absolutely no proxy server which could cause delays but still I am bypassing any proxies because it seems to be an issue of that library.
Nevertheless I was curious about that time because in my opinion it takes very long for an answer with about 230 characters. That is why I tried the same request in Postman. The result was that the request in Postman took less than 100ms! Which is much more appropriate for the task I have to do. It is all about time.
I want to know if there is any specific parameter in requests.post()
which I have to set or is this function just that slow?
The request looks like this currently (very basic stuff):
req = requests.post(url, json={"Username": username, "Password": password, "TerminalNo": terminalno)})
json = req.json()
Header from the server if needed:
cache-control →private
content-length →228
content-type →application/json; charset=utf-8
date →Mon, 30 Jul 2018 17:58:05 GMT
server →Microsoft-IIS/7.5
x-aspnet-version →2.0.50727
x-powered-by →ASP.NET