To get a response back you simply send a request such as:
http://api.wunderground.com/api/yourAPI ... cisco.json
and you get as json page in return.
My code is:
conn=net.createConnection(net.TCP, 0)
conn:on("connection",function(conn, payload)
conn:send("GET /api/yourAPIkeyGoesHere/conditions/q/CA/San_Francisco.json\r\n\r\n")
end)
conn:on("receive", function(conn, payload)
print(payload)
conn:close()
end)
t = tmr.now()
conn:connect(80,'api.wunderground.com') and yet all I get back is:
> HTTP/1.0 400 Bad Request
Server: AkamaiGHost
Mime-Version: 1.0
Content-Type: text/html
Content-Length: 216
Expires: Fri, 27 Feb 2015 13:14:34 GMT
Date: Fri, 27 Feb 2015 13:14:34 GMT
Connection: close
<HTML><HEAD>
<TITLE>Bad Request</TITLE>
</HEAD><BODY>
<H1>Bad Request</H1>
Your browser sent a request that this server could not understand.<P>
Reference #7.1d4e7b5c.1425042874.0
</BODY>
</HTML>
What am I doing wrong please?
Thanks,
Mike