首页 > 编程语言 > 详细

CentOS7阿里云服务器,python程序requests无法正常post网站(报502)

时间:2019-06-06 15:11:53      阅读:485      评论:0      收藏:0      [点我收藏+]

import requests

url1 = "http://overseas-appapi-test.5i5j.com/site/index"
data1 = {"language": "en-us"}

res = requests.get(url1,data1)
print(res.url)
print(res.status_code)
print(res.text)

  技术分享图片

 

技术分享图片

 

技术分享图片

 

 技术分享图片

 

解决办法:

(automationVenv) [root@67 automationtest]# nano /etc/hosts

  技术分享图片

技术分享图片

测试结果:

可以正常访问了

技术分享图片

 

参考

问题分析与定位:

:https://bbs.csdn.net/topics/392505040

centos7配置hosts并使其生效 

https://www.cnblogs.com/hujichen/p/5414785.html

 

CentOS7阿里云服务器,python程序requests无法正常post网站(报502)

原文:https://www.cnblogs.com/kaerxifa/p/10984773.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!