Skip to content

Tag: python-requests

ValueError: Data must not be a string

I am trying to do the following with requests: However, I get the following error: Note that if I remove the files parameter, it works as needed. Why won’t requests allow me to send a json-encoded string for data if files is included? Note that if I change data to be just the normal python dictionary (a…

Timeout for python requests.get entire response

I’m gathering statistics on a list of websites and I’m using requests for it for simplicity. Here is my code: Now, I want requests.get to timeout after 10 seconds so the loop doesn’t get stuck. This question has been of interest before too but none of the answers are clean. I hear that maybe…

Progress of Python requests post

I am uploading a large file using the Python requests package, and I can’t find any way to give data back about the progress of the upload. I have seen a number of progress meters for downloading a file, but these will not work for a file upload. The ideal solution would be some sort of callback method …