Skip to content
Advertisement

Tag: python-requests

Why is my website throwing POST error in python?

I’m sending request to League of Legends API for JSON file. In 3 others tries it worked for me, but in last it doesn’t. I have no idea why and can’t find any mistakes. My request for getting JSON file My website function for return the results. Place, where is mistake, is highlighted with comment. Last, but not least, my

Upload Image using POST form data in Python-requests

I’m working with wechat APIs … here I’ve to upload an image to wechat’s server using this API http://admin.wechat.com/wiki/index.php?title=Transferring_Multimedia_Files I’m not able to post data Answer From wechat api doc: Translate the command above to python: Doc: https://docs.python-requests.org/en/master/user/quickstart/#post-a-multipart-encoded-file

Pipelining POST requests with python-requests

Assuming that I can verify that a bunch of POST requests are in fact logically independent, how can I set up HTTP pipelining using python-requests and force it to allow POST requests in the pipeline? Does someone have a working example? P.S. for extra points, how to handle errors for outstanding requests if pipeline suddenly breaks? P.P.S. grequests is not

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 (and not a json-encoded

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 not using requests is a good

Python Requests: Hook or no Hook?

I ‘.get’ a request and process the response like: After reading the package’s docs, I saw that there is a hook functionality which would permit me to do: My questions: When should I use hooks? Or, why should I use hooks? I wish to initiate an object (a parser) after a request’s response is returned using the requests resp.text procedure.

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 such as:

Advertisement