Foxy Fox
Foxy Fox

Reputation: 491

How to post two (several) arguments via requests.post() in Python?

I need to post two arguments: .xls file, and one more constant (e.g. 1000)

this is how I tried to do it, but it failed: requests.post('http://13.59.5.143:8082/blablabla', 'data.xls', 1000)

I also tried this, and it doesn`t work too:

What is the right way to post 2 arguments using Python requests lib?

If not requests lib, what are other possible solutions?

Upvotes: 0

Views: 101

Answers (1)

laticoda
laticoda

Reputation: 118

import requests

payload = {'file':'data.xls', 'store_id':1000}
r = requests.get('http://13.59.5.143:8082/blablabla', params=payload)

Upvotes: 2

Related Questions