How to urlencode a querystring in Python?

后端 未结 13 1725
猫巷女王i
猫巷女王i 2020-11-22 11:19

I am trying to urlencode this string before I submit.

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


        
13条回答
  •  盖世英雄少女心
    2020-11-22 11:44

    Try this:

    urllib.pathname2url(stringToURLEncode)
    

    urlencode won't work because it only works on dictionaries. quote_plus didn't produce the correct output.

提交回复
热议问题