Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am trying to send web request to my php code via linux running on raspberry pi. I am using putty to access the OS. When I am running the code, I am getting gai error-2. Below is my code:

<pre>import requests
values = {'"firstname":' "abc ", '"lastname":' "xyz"}
r = requests.post('http://rts.msmq.site/security.php', data=values)


I am unable to figure out the problem. Can someone let me know what could be the issue? I am using linux.

What I have tried:

I tried other libraries including urllib still it is not working..
ping for the URL works fine.
nslookup returns:
Server: UnKnown Address: 2a02:908:2:a::1 Non-authoritative answer: Name: rts.msmq.site Address: 50.87.147.175

Request for the same PHP file can be sent from matlab
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900