Adding timeout to http request (sync and async)

It does not work for async calls. That is why I had to use the other approaches.