代码

  • urlencodedstring
1
2
3
query_string = 'access_token=CB4C8F99D9B3E4AD376E7CF179CFA470&expires_in=7776000&refresh_token=4CCB49CAD66A9506F0621CE8E427F492'
data = urlparse.parse_qs(query_string)
access_token = data['access_token'][0]
  • dicturlencoded
1
2
params = {'criterias[]': ['member', 'issue']}
urllib.urlencode(params, True)

参考

  1. https://docs.python.org/2/library/urlparse.html

留言