s = requests.session()
s.get('http://foo.bar/')
s.post('http://foo.bar/')
The above code stops execution if the get
or post
method fail due to any reason. What I want it to do is that it should retry the get
or post
method until there is no exception.
Is there a way to put a wrapper on the requests.session()
object so that all calls to its methods do a retry on any error?
I'm a newbie to Python so I don't know how to do this.