ESP8266 and an ASMX web service

I've written an ASMX web service to log temp/humidity data and am trying to get my ESP8266 to connect and send that data. It doesn't need to get any data as that will be consumed by an android app that I'll write later.

The service can be manually used by doing:

I have no problem doing that local or remotely, but I'm having no luck getting the NodeMCU to send that. I've tried a number of different examples and haven't found any that are really what I need. Mostly because I'm NOT a web guy. I don't know if there are headers I need to send, or anything like that I'm guessing. I know it's connecting to the site fine (in some examples) but it never sends anything, or errors out if it does.

    String httpstring = "";
    httpstring = httpstring + WiFi.macAddress();
    httpstring = httpstring + "&Temp=" + f + "&Humidity=" + h;

    HTTPClient http;


    http.addHeader("Content-Type", "text/plain");

    int httpCode = http.POST("");

    String payload = http.getString();


There's a snippet of one that was throwing an error about content length. But I'm guessing I am not doing it correctly to begin with.

Any help would be appreciated.

It would appear that you do not understand the difference between a GET request, where all the data goes in the URL and a POST request, where some of the data is sent separately.

The first thing you need to determine is whether the ASMX service expects you to make a GET request or a POST request.

The second thing to do is to make the proper type of request.

Well that gives me SOMETHING to go on apparently. Thanks. :slight_smile:

Coulda just said to change your .POST to .GET though. (ok, and get rid of the header line as well but...) :smiley:

Coulda just said to change your .POST to .GET though. (ok, and get rid of the header line as well but...) :smiley:

Why would I say that if the ASMX service expected you to make a POST request?