aerbey
July 14, 2017, 10:13am
1
Hello,
I have particle photon dev board.
I want it to connect my wifi and make get request to local website for example:
192.168.1.103/test.html
i cant make it with webhook. Im trying to use HttpClient library but i cant make it work.
How can i make simple get request to html file hosted in local intranet.
Thanks for your advises.
Moors7
July 14, 2017, 10:35am
2
What have you tried so far?
aerbey
July 14, 2017, 11:47am
3
in header part of code im sending:
http_header_t headers[] = {
{ "Content-Type", "text/html" },
{ "Accept" , "*/*"},
{ NULL, NULL }
};
and host configuration:
request.hostname = "http://192.168.1.106";
request.port = 80;
request.path = "/";
requested adress is returning html.
When i look result from serial monitor it is:
Response status: -1
Try dropping the protocol prefix “http://” as this is not part of the host name.
If this doesn’t help, try setting the IP address as IPAddress
is this is also not a host name.
request.ip = IPAddress(192,168,1,106);
2 Likes
aerbey
July 14, 2017, 12:23pm
5
Hello ScruffR,
Thanks for your reply. You saved my time. I tried as you said and its worked.
2 Likes