Created
July 18, 2013 06:00
-
-
Save muzizongheng/6027005 to your computer and use it in GitHub Desktop.
http encode/decode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64 | |
from http import cookiejar | |
import urllib.request, urllib.parse, urllib.error | |
url = "http://blog.csdn.net/muzizongheng" | |
en = urllib.parse.quote(url) | |
print(en) | |
de = urllib.parse.unquote(en) | |
print(de) | |
en = "http%3A%2F%2Fblog.csdn.net%2Fmuzizongheng" | |
de = urllib.parse.unquote(en) | |
print(de) | |
data = { | |
'key1':"value1", | |
'key2':"value2" | |
} | |
print(urllib.parse.urlencode(data)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment