简体   繁体   English

我可以通过笔记本电脑发出HTTP Post请求,而不是通过连接到笔记本电脑的Raspberry Pi发出请求

[英]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.

相关问题 Opencv 在我的笔记本电脑上为我的项目工作,但停止在树莓派上工作 - Opencv is working for my project on my laptop but stop working on raspberry pi 笔记本电脑无法通过串行通信接收Raspberry Pi发送的数据 - Laptop can't receive data sent by Raspberry Pi through serial communication 如何将树莓派中的文本(URL)远程传输到我的笔记本电脑 - How to transfer a text (url) from raspberry pi to my laptop remotely 连接到我自己的笔记本电脑上在树莓派上运行的MySQL - Connect to MySQL running on raspberry pi in my own laptop 无法通过 Android 应用访问我的笔记本电脑的本地主机 - Can't access my laptop's localhost through an Android app 给定时间后如何将笔记本电脑置于睡眠模式? - How do I put my laptop into sleepmode after a given time? 有什么方法可以在Windows笔记本电脑上的Raspberry Pi 3 Model B上下载OpenCV? - Is there any way I can download OpenCV on Raspberry Pi 3 Model B on a Windows laptop? 我似乎无法在我的笔记本电脑上进行多处理 - I can't seem to get multiprocessing to work on my laptop Python requests 模块适用于我的 Windows 笔记本电脑,但不适用于 AWS - Python requests module works on my Windows laptop but not on AWS 如何将(request.post)pandas 数据帧/json 发送到我的 raspberry-pi 网络服务器? - How can I send (request.post) pandas dataframe/json to my raspberry-pi webserver?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM