Skip to content

Tag: python-requests

Python Stream Decode Base64 to valid utf8

I’m currently working on a problem, which I just cannot seem to find the proper solution. Maybe you guys can help me, thanks! What I am trying to do Web is returning a JSON (value is encoded in valid BASE64, which was before that ùtf-8) requests.get(url, stream=True streaming from requests (chunks=1020)…

Using Python decorators to retry request

I have multiple functions in my script which does a REST API api requests.As i need to handle the error scenarios i have put a retry mechanism as below. I have several different methods which does similar operation. How can we do it better way to avoid duplication may be using decorators. Answer Instead of us…