-->
Page 1 of 1

http client request and get return value

PostPosted: Wed Feb 17, 2016 12:02 pm
by kamal sonani
http://api.thingspeak.com/apps/thinghttp/send_request?api_key=UJDDO05P40P5XB7I

how to get back return value from this link using nodemcu?
ip-address and port for link = (80,184.106.153.149)

i try this but i cant resolve :| :|

conn=net.createConnection(net.TCP, 0)

conn:on("connection",function(conn, payload)
conn:send("HEAD / HTTP/1.1\r\n"..
"Host: https://api.thingspeak.com/apps/thinght ... L7DOCEHHX9\r\n"..
"Accept: */*\r\n"..
"User-Agent: Mozilla/4.0 (compatible; esp8266 Lua;)"..
"\r\n\r\n")
end)
conn:connect(80,184.106.153.149)

Re: http client request and get return value

PostPosted: Wed Feb 17, 2016 2:02 pm
by martinayotte
Since you are using Lua, it is better to post in the Lua sub-forum ...

Re: http client request and get return value

PostPosted: Wed Feb 17, 2016 2:45 pm
by gaber
Try putting your IP address in quotes, and check if your host listed as HTTPS header is ok since you are using HTTP -- server may reject it.
Also, the conn:on("connect"... I thought had some problem--I could not get it working before..
Not sure if you have been looking at the docs here, but check this out http://nodemcu.readthedocs.org/en/dev/en/

Re: http client request and get return value

PostPosted: Thu Feb 18, 2016 4:55 am
by kamal sonani
gaber wrote:Try putting your IP address in quotes, and check if your host listed as HTTPS header is ok since you are using HTTP -- server may reject it.
Also, the conn:on("connect"... I thought had some problem--I could not get it working before..
Not sure if you have been looking at the docs here, but check this out http://nodemcu.readthedocs.org/en/dev/en/



i just try with it but i cant get any response from web yet>>
[url]api.thingspeak.com/apps/thinghttp/send_request?api_key=UJDDO05P40P5XB7I[/url]
i what get back value from this link
just check at once on your own web