I'm trying to create http post data to be sent out. I normally use a dictionary for this. But normally all fields are different.
The new server expects 3 entries with the same name but different value as below.
But python dictionaries doesn't seem to like the same key name being used for the 3 different values. So what is the best way to do what I want?
data = urllib.parse.urlencode({
'val1':'1',
'val1':'2',
'val1':'3',
})
....
response = self.opener.open(url, data) # data only seem to contain 'val1':'3'
I've read about returning an array as the value with the 3 different arguments ie: {'val1':['1','2','3']} but will the url opener know to split that out to three different fields?