Page 1 of 1

Need Webserver to send plain text

Posted: Sun Jul 01, 2018 10:08 am
by herbie
Hello,

I´ve built myself an Arduino BME_280 weatherstation (humidity,airpressure,temparature) and my Arduino webserver sends the tree values in html. That´s not a problem with a webbrowser - but for a short time I have a NodeMCU lua Amica module configured as a receiver and when I get the values the whole html-code is shown on the display :cry: :cry: :cry:
What can I do about it - I tried to find a way to reconfigure the webserver to send plain text but failed. I´d need the webserver to show html /for the browser) and plain text (for the nodemcu). Has anybody an idea how to do that??

thanks in advance!!!

Re: Need Webserver to send plain text

Posted: Sun Jul 01, 2018 4:05 pm
by kolban
I get the sense that your NodeMCU component is asking the remote server for data and what the remote server is sending back is an HTML page. What I think you desire is that the NodeMCU component requests data and just the data come back to it without HTML formatting instructions. This could be achieved by making a REST call from NodeMCU to the server and getting back a JSON encoded payload of just the data. Your Web Server app hosted on the server could expose two paths. One which returns HTML and one which returns JSON.

Re: Need Webserver to send plain text

Posted: Sun Jul 01, 2018 5:42 pm
by herbie
Thanks a lot Mr. Kolban - that helped!!!!!!!