Terrance/SkPy

How to set timeout for requests to API?

Closed this issue · 2 comments

I need to send requests through the proxies. Proxies often turn out to be inoperative and requests wait a long time for a response from the server. The standard method is to set timeout and also this params: max_retries, dely_between_retries. Is it possible to somehow pass this params to the API? For example, how to set them in contacts.search() method?

I only found how to set a timeout in a session. sess.conn.timeout but it doesn't work for requests.

I'd really prefer to keep SkPy unaware of proxies and let requests handle it, with the session object available to those who know what they're doing. AIUI requests' session timeout should extend to proxies too.

There's some other interesting things you can do with the session like max retries, here's a page with some examples.

Thanks, I didn't know about the methods described in the article. It was useful for me. I tried to use the advice from the article and now everything works as it should :)