Chat freely about anything...

User avatar
By AcmeUK
#87475 In general a Web server responds to a PULL request from a browser.

What you are trying to do is PUSH data from the server to a browser client.

Try searching Google for "HTML PUSH"

Have a look here to get you started :- http://www.instructables.com/id/Push-Data-From-ESP-Webserver-to-Client/
User avatar
By fra589
#92515 Hi,
Perhaps it's not too late for a reply...

Code: Select all  server.sendHeader("Location", "/file", true);
  server.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate");
  server.sendHeader("Pragma", "no-cache");
  server.sendHeader("Expires", "-1");
  server.send(302, "text/plain", "");
  server.client().stop(); // Stop is needed because we sent no content length


This force reload as it disable caching on client side.

@++;
User avatar
By mtokeyboard
#96304
freddy-a wrote:The webserver does not actively push pages.
Your browser has to request a page from the webserver.

If you upload a new page to your webserver, nothing is going to trigger your browser (or the webserver) to refresh the page.

You could put a command in your page (the you've opened with your browser) that refreshes the page every ## seconds.

This is the HTML command:
<meta http-equiv="refresh" content="30">

And this would (probably) be the string in your ESP8266 code:
ptr +=" <meta http-equiv=\"refresh\" content=\"30\">\n";

This should be placed within the HEAD tag!



THANKS :D IT HELPED ME !!