Chat freely about the open source Javascript projects for ESP8266

User avatar
By Erni
#32047 Thanks kolban,

I think I am beginning to understand this new way of thinking (I am used to Arduinos procedural way of doing things)
So do you think this is the way to do it ?:

Code: Select allESP8266WiFi.init();

var hostname="www.eecs.mit.edu";

ESP8266WiFi.getHostByName(hostname, function(ipAddress){

var http = require("http");

  http.get({host: ESP8266WiFi.getAddressAsString(ipAddress), port: 80, path: "/"},
    function(response) {
    print("get callback!");
    response.on('data', function(data) {
      print(data);
    });
    response.on('close', function() {
       print("The response connection closed");
    });
});
 
});
User avatar
By gonsays
#34160 Hello,

This example is great! Can I find a certain string on the data variable?

I would like to do a HTTP GET to a php file, can I identify if a certain string (example: "State1") is on the php file?