[英]I can make HTTP Post requests through my laptop put not through Raspberry Pi connected to my laptop
I am using a Raspberry Pi connected to my laptop through an Ethernet cable. 我正在使用通过以太网电缆连接到笔记本电脑的Raspberry Pi。
I am using Python Requests to make HTTP POST requests to my server which is on the same network. 我正在使用Python请求向位于同一网络上的服务器发出HTTP POST请求。
The Request works using both postman and the python requests module, when I use it on my laptop. 当我在笔记本电脑上使用Request时,它可以同时使用邮递员和python request模块。
For some reason the same doesn't work when trying to post the request using my Raspberry pi which I have connected to my laptop through an Ethernet cable and have SSH'd into. 由于某些原因,当尝试使用Raspberry pi发布请求时,该方法不起作用,我已经通过以太网电缆将其连接到笔记本电脑并进行了SSH连接。
Could there be a firewall issue here, I get an error saying: 这里可能有防火墙问题,我收到一条错误消息:
requests.exceptions.ConnectionError: ('Connection aborted.', error(113, 'No route to host'))
I have tried both the URLlib and request libraries, both give me this error. 我已经尝试了URLlib和请求库,都给了我这个错误。
This is a network configuration issue. 这是网络配置问题。 Your Raspberry PI needs a default gateway setting in the routing table. 您的Raspberry PI在路由表中需要默认网关设置。 Take a look at the network configuration of your laptop and check the gateway setting, use the same for the Raspberry PI and make sure you can ping the gateway form the Raspberry PI. 查看笔记本电脑的网络配置并检查网关设置,将其用于Raspberry PI,并确保可以从Raspberry PI ping通网关。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.