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 = "http://MyURL.com/TemperatureData/TemperatureData.asmx/PostTempData?Key=T8GNS68SN19ASDVBXT&MAC="; httpstring = httpstring + WiFi.macAddress(); httpstring = httpstring + "&Temp=" + f + "&Humidity=" + h; HTTPClient http; http.begin(httpstring); http.addHeader("Content-Type", "text/plain"); int httpCode = http.POST(""); String payload = http.getString(); http.end(); Serial.println(payload);
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.