https://github.com/mr-addict/esp32-async-webserver-api
ESP32 Async Webserver API with SSD1306
https://github.com/mr-addict/esp32-async-webserver-api
arduino async-webserver esp32
Last synced: 11 days ago
JSON representation
ESP32 Async Webserver API with SSD1306
- Host: GitHub
- URL: https://github.com/mr-addict/esp32-async-webserver-api
- Owner: MR-Addict
- Created: 2023-05-17T17:56:31.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-17T18:43:18.000Z (almost 3 years ago)
- Last Synced: 2025-03-01T23:29:11.796Z (about 1 year ago)
- Topics: arduino, async-webserver, esp32
- Language: C++
- Homepage:
- Size: 1000 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ESP32 Async Webserver With SSD1306
## 1. Libraries
You can find all of them in **libraries** folder.
```cpp
#include
#include
#include
#include
#include
```
## 2. API
| Endpoint | Method | Description |
| :------- | :----- | :------------------------- |
| /api | GET | Get sensor status and name |
| /api | PUT | Set sensor name |
## 3. Examples
**Curl**
```sh
# get status and name
curl esp32-ip-address/api
# update name
curl -X PUT esp32-ip-address/api -d "name=01"
```
**Fetch**
```js
// get data
function handleClick() {
fetch("http://esp32-ip-address/api")
.then((res) => res.json())
.then((res) => console.log(res));
}
// put data
function handleSubmit(event) {
event.preventDefault();
const data = new FormData();
data.append("name":"01");
fetch("http://esp32-ip-address/api", { method: "PUT", body: data })
.then((res) => res.json())
.then((res) => console.log(res));
}
```
## 4. Demo Video
https://github.com/MR-Addict/esp32-async-webserver-api/assets/75357598/cd468b28-57a9-4a3d-8380-d391eefce8e7