kurtgn
kurtgn

Reputation: 8732

python requests - posting multiple values with same key, combined with regular keys

I need to reproduce the following POST form structure: enter image description here

from what I found, I can represent multiple values of sites key this way: how to post multiple value with same key in python requests?

but how to combine this multi-valued key with regular keys action and extype? I can't use a regular dict for parameters anymore.

Upvotes: 0

Views: 878

Answers (1)

Daniel Roseman
Daniel Roseman

Reputation: 599926

I don't understand why you can't use a "regular dict". On the contrary:

params = {'sites[]': [951, 1007, ...], 'action': 'set', 'extype': 'exclude'}
requests.post('url', data=params)

Upvotes: 1

Related Questions