dimanche 30 mars 2014

Include list in Python request data


Vote count:

0




I'm using the Requests library to PUT data to the Pipeline Deals API, and the data requires that I PUT a list for a value in the request data.


Their example: "custom_label_83": [ 28, 29 ].


The issue is that when I PUT that example, I end up with only 29 being PUT, because the body of the request (after being encoded) is like this:



custom_label_83%5D=28&custom_fields%5D%5Bcustom_label_83%5D=29


As a result, the field is set twice, with the final result being 29, instead of both. I would like the body of the PUT request to be something like this:



custom_label_83%5D=28,29


How do I do that?



asked 24 secs ago






Aucun commentaire:

Enregistrer un commentaire