https://github.com/timmoth/httprequester
Small library for making http requests from a Raspberry Pi Pico running Arduino core
https://github.com/timmoth/httprequester
Last synced: 10 months ago
JSON representation
Small library for making http requests from a Raspberry Pi Pico running Arduino core
- Host: GitHub
- URL: https://github.com/timmoth/httprequester
- Owner: Timmoth
- Created: 2022-11-07T19:36:09.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-11-09T16:26:57.000Z (over 3 years ago)
- Last Synced: 2025-03-26T11:35:59.024Z (over 1 year ago)
- Language: C++
- Size: 12.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# HttpRequester
Small library that helps make HTTP requests on an ESP32 device.
Originally written to help reduce boiler plate code around making HTTP requests for my IOT projects using a Raspberry Pi Pico w.
### Usage:
------------
- clone the repo to the Arduino libraries directory
`cd C:\Users\\Documents\libraries
`
`git clone https://github.com/Timmoth/HttpRequester.git
`
- Add Arduino pico to your board manager (file->preferences->additional board manager urls) paste the following url
`https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json`
- Include library in your project
```c
#include
```
- Connect to your WiFi network
```c
WiFi.mode(WIFI_STA);
WiFiMulti.addAP(ssid, password);
while ((WiFiMulti.run() != WL_CONNECTED)) {
Serial.println("connecting...");
}
```
- make request
```c
HttpResponse* postResponse = requester->Post("/api/user", "{\"name\":\"Tim\"}", "application/json");
if (postResponse == NULL || !postResponse->IsSuccess()) {
return;
}
Serial.println("Response: " + postResponse->Body);
```
### Tests:
------------
Tests are written using [ElkTest](https://github.com/Timmoth/ElkTest "ElkTester") see project readme for more instructions.
### Upcoming:
- Accomadate HTTP requests
- Investigate validating SSL certs
- Improve documentation
- Add more tests
- Make available to the Arduino IDE Library manager