Skip to content

Commit dd50a87

Browse files
authored
example update
1 parent a844987 commit dd50a87

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

README.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ A robust and lightweight framework for buidling IoT APIs using the ESP32 chip. <
44
# Features
55
<ul>
66
<li>Auto Connect to WiFi using Smart Config.</li>
7-
<li>Base API with reset, OTA update functionality and error handlers.</li>
7+
<li>Base API with reset, OTA update functionality.</li>
88
<li>HTTPS OTA updates.</li>
99
<li>API is secured using a client authentication key.</li>
1010
<li>Extremely fast response times.</li>
@@ -77,8 +77,9 @@ void getDeviceInfo(AsyncWebServerRequest* request)
7777
request->send(response);
7878
7979
} else {
80-
// Invalid auth key
81-
handleUnauthorizedRequest(request);
80+
// Invalid or no Auth Key -> Unauthorized request
81+
// handleRequest is defined in HttpResponseHandler.h
82+
handleRequest(request, 401);
8283
}
8384
}
8485
```
@@ -112,12 +113,6 @@ Params: <br>
112113
<li><b>authkey:</b> Client Auth Key.</li>
113114
</ul>
114115
115-
# Base Error Handlers
116-
Defined in ErrorHandlers.h <br><br>
117-
<b> 200 </b> ```void handleSuccess(AsyncWebServerRequest* request); ```<br>
118-
<b> 400 </b> ```void handleBadRequest(AsyncWebServerRequest* request); ```<br>
119-
<b> 401 </b> ```void handleUnauthorizedRequest(AsyncWebServerRequest* request); ```<br>
120-
<b> 412 </b> ```void handlePreconditionFailed(AsyncWebServerRequest* request); ```<br>
121116
122117
# Security
123118
<b>Please assess potential threats before using this library.</b> <br>

0 commit comments

Comments
 (0)