8#include "AudioLogger.h"
10#define CHUNK_SIZE 1024
44 LOGI(
"setHost %s", host);
81 virtual int post(
Url &
url,
const char *mime,
const char *data,
int len = -1) {
93 virtual int put(
Url &
url,
const char *mime,
const char *data,
int len = -1) {
106 const char *data =
nullptr,
int len = -1) {
113 const char *data =
nullptr,
int len = -1) {
121 const char *data =
nullptr,
int len = -1) {
138 int result =
read(str, len);
140 LOGE(
"HttpRequest::read error");
187 LOGI(
"no CONTENT_LENGTH found in reply");
208 const char *data,
int lenData = -1) {
211 if (data !=
nullptr && len <= 0) {
218 if (len > 0 && data !=
nullptr) {
219 LOGI(
"Writing data: %d bytes", len);
228 Stream &stream,
int len = -1) {
242 LOGE(
"The client has not been defined");
252 LOGE(
"Connect failed");
258 LOGI(
"process is already connected");
261#if defined(ESP32) && defined(ARDUINO)
262 LOGI(
"Free heap: %u", (
unsigned)
ESP.getFreeHeap());
285 int total_written = 0;
290 total_written += written;
295 LOGI(
"Total bytes read %d vs written %d", total, total_written);
325 LOGI(
"Request written ... waiting for reply");
333 LOGE(
"HttpRequest: Failed to open chunked reader");
@ HEX
Definition Arduino.h:54
#define TRACED()
Definition AudioLoggerIDF.h:31
#define LOGI(...)
Definition AudioLoggerIDF.h:28
#define LOGD(...)
Definition AudioLoggerIDF.h:27
#define LOGE(...)
Definition AudioLoggerIDF.h:30
#define CHUNK_SIZE
Definition HttpRequest.h:10
MethodID
supported http methods
Definition HttpTypes.h:3
@ HEAD
Definition HttpTypes.h:6
@ GET
Definition HttpTypes.h:5
@ POST
Definition HttpTypes.h:7
@ DELETE
Definition HttpTypes.h:9
@ PUT
Definition HttpTypes.h:8
bool connect(const char *ip, int port)
Definition Arduino.h:168
bool connected()
Definition Arduino.h:167
virtual int read(uint8_t *buffer, size_t len)
Definition Arduino.h:165
void stop()
Definition Arduino.h:164
virtual size_t write(const uint8_t *data, size_t len)
Definition Arduino.h:120
virtual void flush()
Definition Arduino.h:130
virtual size_t readBytes(uint8_t *data, size_t len)
Definition Arduino.h:140
virtual int available()
Definition Arduino.h:139
#define URL_CLIENT_TIMEOUT
Definition esp8266.h:23