0

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:

  • requests.post('http://13.59.5.143:8082/blablabla', ['data.xls', 1000])
  • requests.post('http://13.59.5.143:8082/blablabla', {'file':'data.xls' ; 'store_id':1000)

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

If not requests lib, what are other possible solutions?

1 Answer 1

2
import requests

payload = {'file':'data.xls', 'store_id':1000}
r = requests.get('http://13.59.5.143:8082/blablabla', params=payload)
Sign up to request clarification or add additional context in comments.

3 Comments

While this code may answer the question, providing additional context regarding why and/or how this code answers the question improves its long-term value. How to Answer
Watch-out for down-voters if you don't provide context (from which we can learn).
i fixed a syntax error, look at the wrong bracker ] in {'file':'data.xls' ; 'store_id':1000])

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.