Quantcast
Channel: User Bijan - Stack Overflow
Viewing all articles
Browse latest Browse all 99

Python Requests POST Array in JSON Format [closed]

$
0
0

I am making a POST request to a website with this data:

payload = offset=0&q=&filters=&code%5B%5D=1234&code%5B%5D=5678response = requests.post(url, data=payload)

However I want to POST this as JSON data because I will be changing some of the query parameters. I tried doing:

payload = {'offset': 0,'q': '','filters': '','code[]': 1234,'code[]': 5678,}response = requests.post(url, json=payload)

But it looks like my filters did not do anything. What is the proper way to pass this as JSON?


Viewing all articles
Browse latest Browse all 99

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>