Skip to content
Prev Previous commit
Next Next commit
chore: updated docs
  • Loading branch information
ayushsharma82 committed Jun 13, 2024
commit ff5e56f56dcd1a57a5a89a0f669a3934a5f9e2ea
21 changes: 20 additions & 1 deletion libraries/ESP8266WebServer/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ Client request handlers

.. code:: cpp

void on();
RequestHandler<ServerType>& on();
bool removeRoute();
void addHandler();
bool removeHandler();
void onNotFound();
void onFileUpload();

Expand All @@ -64,9 +66,26 @@ Client request handlers
.. code:: cpp

server.on("/", handlerFunction);
server.removeRoute("/"); // Removes any route which points to "/" and has HTTP_ANY attribute
server.removeRoute("/", HTTP_GET); // Removes any route which points to "/" and has HTTP_GET attribute
server.onNotFound(handlerFunction); // called when handler is not assigned
server.onFileUpload(handlerFunction); // handle file uploads

Client request filters
^^^^^^^^^^^^^^^^^^^^^^

.. code:: cpp

RequestHandler<ServerType>& setFilter();

*Example:*

More details about this in `Filters.ino` example.

.. code:: cpp

server.on("/", handlerFunction).setFilter(ON_AP_STA)

Sending responses to the client
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down