python 2.x
import urllib
# 构建数据编码
data = urllib.urlencode({
'email':'用户名','password':'密码'})
Direct use in python 3.x will prompt
AttributeError: module 'urllib' has no attribute 'urlencode'
Solution
python 3.x is placed in urllib, the calling method needs to be changed
urllib.parse.urlencode()
import urllib
# 构建数据编码
data = urllib.parse.urlencode({
'email':'用户名','password':'密码'})