An open API service indexing awesome lists of open source software.

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

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