0 votes
1 view
in Python by (1.6k points)

I am trying to urlencode this string before I submit.

queryString = 'eventName=' + evt.fields["eventName"] + '&' + 'eventDescription=' + evt.fields["eventDescription"]; 

1 Answer

0 votes
by (25.1k points)

Just create a dictionary with your parameters to be encoded in the urlencode function of urrlib module. e.g:

For python 2: 

import urllib

d = {'a': 'b', 'c': 'd'};

urllib.urlencode(d)

For Python 3

import urllib

d = {'a': 'b', 'c': 'd'};

urllib.parse.urlencode(d)

Related questions

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...