Skip to content

Commit 26be1e3

Browse files
authored
Update Berry.md, webserver.remove_route
Adding description based on comments and code in xdrv_52_3_berry_webserver.ino Any caveats missing, @s-hadinger ?
1 parent bd39c04 commit 26be1e3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/Berry.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,8 @@ Low-level functions if you want to display custom pages and content:
11051105

11061106
General Function|Parameters and details
11071107
:---|:---
1108-
on<a class="cmnd" id="ws_on"></a>|`(prefix:string, callback:closure [, method:int]) -> nil`<br>Attaches a handler (any closure or function) to a prefix. An optional `method` argument (defaults to `webserver.HTTP_ANY` specifies the HTTP methods to be received (ANY, GET, POST, OPTIONS, POST)<BR>WARNING - this should be called only when receiving `web_add_handler` event. If called before the WebServer is set up and Wi-Fi on, it will crash. For debug purpose, it can be called later when you are sure that Wi-Fi or Ethernet is up.
1108+
on<a class="cmnd" id="ws_on"></a>|`(prefix:string, callback:closure [, method:int]) -> nil`<br>Attaches a handler (any closure or function) to a prefix. An optional `method` argument (defaults to `webserver.HTTP_ANY`) specifies the HTTP methods to be received (ANY, GET, POST, OPTIONS, POST)<BR>WARNING - this should be called only when receiving `web_add_handler` event. If called before the WebServer is set up and Wi-Fi on, it will crash. For debug purpose, it can be called later when you are sure that Wi-Fi or Ethernet is up.
1109+
remove_route<a class="cmnd" id="ws_remove_route"></a>|`(prefix:string [, method:int]) -> bool<br>Remove a handler already added with `webserver.on()`. Does nothing if the handler does not exist or was already removed.
11091110
state<a class="cmnd" id="ws_state"></a>|`() -> int`<br>Returns the internal state of Tasmota web server. Possible values are `webserver.HTTP_OFF`, `webserver.HTTP_USER`, `webserver.HTTP_ADMIN`, `webserver.HTTP_MANAGER`, `webserver.HTTP_MANAGER_RESET_ONLY`.
11101111
content_open<a class="cmnd" id="ws_content_open"></a>|`(http_code:int, mimetype:string) -> nil`<br>Sets http code and mime type for the response
11111112
content_start<a class="cmnd" id="ws_content_start"></a>|`(string) -> nil`<br>Start response page with title

0 commit comments

Comments
 (0)