Answer the question
In order to leave comments, you need to log in
How to pass array to url?
>>> import urllib.parse
>>> data = {
... "comments[]":"one",
... "comments[]":"two",
... "comments[]":"three"
... }
>>> data
{'comments[]': 'three'}
>>> urllib.parse.urlencode(data)
'comments%5B%5D=three'
>>>
'comments%5B%5D=one&comments%5B%5D=two&comments%5B%5D=three'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question