local-files

Fetch a file from a local url with Python requests?

Fetch a file from a local url with Python requests? Question: I am using Python’s requests library in one method of my application. The body of the method looks like this: def handle_remote_file(url, **kwargs): response = requests.get(url, …) buff = StringIO.StringIO() buff.write(response.content) … return True I’d like to write some unit tests for that method, …

Total answers: 7