Please tell me how to do urlencode!

Asked 2 years ago, Updated 2 years ago, 31 views

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

How can I urlencode this string before submitting?

python urlencode

2022-09-21 17:07

1 Answers

You can hand over dict(mapping) or 2-tuple() as a factor to urlencode().

import urllib
f = { 'eventName' : 'myEvent', 'eventDescription' : "cool event"}
urllib.urlencode(f) #'eventName=myEvent&eventDescription=cool+event'


2022-09-21 17:07

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.