首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >request进行get请求,为什么params里面的%执行后的时候变成%25?

request进行get请求,为什么params里面的%执行后的时候变成%25?

提问于 2019-04-08 14:27:41
回答 0关注 0查看 770

params是一个有序字典,里面redirect_uri = r'http%3A%2F%2Fqs.test.xxxxx.com%2F',特意加了r,防止转义。

执行完get请求的时候,发现结果一直不通,查看url发现参数变成redirect_uri = 'http%253A%252F%252Fqs.test.xxxxx .com%252F'了,%全部变成%25了,请问是什么原因呢?

代码语言:python
代码运行次数:0
复制
>>>print(params)
OrderedDict([('appid', 'zt7FYIxgm-Waue4L1p'), ('redirect_uri', 'http%3A%2F%2Fqs.test.xxxxx.com%2F'), ('response_type', 'code'), ('scope', 'userinfo,user_id,userprofile'), ('state', 'NKn64fGOTv1L66Eh')])

>>>res = requests.get(url,params=params,headers=headers)
>>>print(res.url)
https://connect.zto.com/oauth2/authorize?appid=zt7FYIxgm-Waue4L1p&redirect_uri=http%253A%252F%252Fqs.test.xxxxx
.com%252F&response_type=code&scope=userinfo%2Cuser_id%2Cuserprofile&state=NKn64fGOTv1L66Eh

回答

和开发者交流更多问题细节吧,去 写回答
相关文章

相似问题

相关问答用户
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档