简体   繁体   中英

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.

I am using Python Requests to make HTTP POST requests to my server which is on the same network.

The Request works using both postman and the python requests module, when I use it on my laptop.

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.

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.

This is a network configuration issue. Your Raspberry PI needs a default gateway setting in the routing table. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM