ESPHome 2026.5.1
Loading...
Searching...
No Matches
http_request.h
Go to the documentation of this file.
1#pragma once
2
3#include <list>
4#include <memory>
5#include <set>
6#include <utility>
7#include <vector>
8
16#include "esphome/core/log.h"
17
18namespace esphome::http_request {
19
20struct Header {
21 std::string name;
22 std::string value;
23};
24
25// Some common HTTP status codes
53
60inline bool is_redirect(int const status) {
61 switch (status) {
67 return true;
68 default:
69 return false;
70 }
71}
72
81inline bool is_success(int const status) { return status >= HTTP_STATUS_OK && status < HTTP_STATUS_MULTIPLE_CHOICES; }
82
84inline bool should_collect_header(const std::vector<std::string> &lower_case_collect_headers,
85 const std::string &lower_header_name) {
86 for (const auto &h : lower_case_collect_headers) {
87 if (h == lower_header_name)
88 return true;
89 }
90 return false;
91}
92
93/*
94 * HTTP Container Read Semantics
95 * =============================
96 *
97 * IMPORTANT: These semantics differ from standard BSD sockets!
98 *
99 * BSD socket read() returns:
100 * > 0: bytes read
101 * == 0: connection closed (EOF)
102 * < 0: error (check errno)
103 *
104 * HttpContainer::read() returns:
105 * > 0: bytes read successfully
106 * == 0: no data available yet OR all content read
107 * (caller should check bytes_read vs content_length)
108 * < 0: error or connection closed (caller should EXIT)
109 * HTTP_ERROR_CONNECTION_CLOSED (-1) = connection closed prematurely
110 * other negative values = platform-specific errors
111 *
112 * Platform behaviors:
113 * - ESP-IDF: blocking reads, 0 only returned when all content read
114 * - Arduino: non-blocking, 0 means "no data yet" or "all content read"
115 *
116 * Chunked responses that complete in a reasonable time work correctly on both
117 * platforms. The limitation below applies only to *streaming* chunked
118 * responses where data arrives slowly over a long period.
119 *
120 * Streaming chunked responses are NOT supported (all platforms):
121 * The read helpers (http_read_loop_result, http_read_fully) block the main
122 * event loop until all response data is received. For streaming responses
123 * where data trickles in slowly (e.g., TTS streaming via ffmpeg proxy),
124 * this starves the event loop on both ESP-IDF and Arduino. If data arrives
125 * just often enough to avoid the caller's timeout, the loop runs
126 * indefinitely. If data stops entirely, ESP-IDF fails with
127 * -ESP_ERR_HTTP_EAGAIN (transport timeout) while Arduino spins with
128 * delay(1) until the caller's timeout fires. Supporting streaming requires
129 * a non-blocking incremental read pattern that yields back to the event
130 * loop between chunks. Components that need streaming should use
131 * esp_http_client directly on a separate FreeRTOS task with
132 * esp_http_client_is_complete_data_received() for completion detection
133 * (see audio_reader.cpp for an example).
134 *
135 * Chunked transfer encoding - platform differences:
136 * - ESP-IDF HttpContainer:
137 * HttpContainerIDF overrides is_read_complete() to call
138 * esp_http_client_is_complete_data_received(), which is the
139 * authoritative completion check for both chunked and non-chunked
140 * transfers. When esp_http_client_read() returns 0 for a completed
141 * chunked response, read() returns 0 and is_read_complete() returns
142 * true, so callers get COMPLETE from http_read_loop_result().
143 *
144 * - Arduino HttpContainer:
145 * Chunked responses are decoded internally (see
146 * HttpContainerArduino::read_chunked_()). When the final chunk arrives,
147 * is_chunked_ is cleared and content_length is set to bytes_read_.
148 * Completion is then detected via is_read_complete(), and a subsequent
149 * read() returns 0 to indicate "all content read" (not
150 * HTTP_ERROR_CONNECTION_CLOSED).
151 *
152 * Use the helper functions below instead of checking return values directly:
153 * - http_read_loop_result(): for manual loops with per-chunk processing
154 * - http_read_fully(): for simple "read N bytes into buffer" operations
155 */
156
159static constexpr int HTTP_ERROR_CONNECTION_CLOSED = -1;
160
162enum class HttpReadStatus : uint8_t {
163 OK,
164 ERROR,
165 TIMEOUT,
166};
167
173
175enum class HttpReadLoopResult : uint8_t {
176 DATA,
177 COMPLETE,
178 RETRY,
179 ERROR,
180 TIMEOUT,
181};
182
189inline HttpReadLoopResult http_read_loop_result(int bytes_read_or_error, uint32_t &last_data_time, uint32_t timeout_ms,
190 bool is_read_complete) {
191 if (bytes_read_or_error > 0) {
192 last_data_time = millis();
194 }
195 if (bytes_read_or_error < 0) {
197 }
198 // bytes_read_or_error == 0: either "no data yet" or "all content read"
199 if (is_read_complete) {
201 }
202 if (millis() - last_data_time >= timeout_ms) {
204 }
205 delay(1); // Small delay to prevent tight spinning
207}
208
209class HttpRequestComponent;
210
211class HttpContainer : public Parented<HttpRequestComponent> {
212 public:
213 virtual ~HttpContainer() = default;
214 size_t content_length{0};
215 int status_code{-1};
217
245 virtual int read(uint8_t *buf, size_t max_len) = 0;
246 virtual void end() = 0;
247
248 void set_secure(bool secure) { this->secure_ = secure; }
249 void set_chunked(bool chunked) { this->is_chunked_ = chunked; }
250
251 size_t get_bytes_read() const { return this->bytes_read_; }
252
259 virtual bool is_read_complete() const {
260 // Per RFC 9112, these responses have no body:
261 // - 1xx (Informational), 204 No Content, 205 Reset Content, 304 Not Modified
262 if ((this->status_code >= 100 && this->status_code < 200) || this->status_code == HTTP_STATUS_NO_CONTENT ||
264 return true;
265 }
266 // For non-chunked responses, complete when bytes_read >= content_length
267 // This handles both Content-Length: 0 and Content-Length: N cases
268 return !this->is_chunked_ && this->bytes_read_ >= this->content_length;
269 }
270
271 std::string get_response_header(const std::string &header_name);
272
273 protected:
274 size_t bytes_read_{0};
275 bool secure_{false};
276 bool is_chunked_{false};
277 std::vector<Header> response_headers_{};
278};
279
288inline HttpReadResult http_read_fully(HttpContainer *container, uint8_t *buffer, size_t total_size, size_t chunk_size,
289 uint32_t timeout_ms) {
290 size_t read_index = 0;
291 uint32_t last_data_time = millis();
292
293 while (read_index < total_size) {
294 int read_bytes_or_error = container->read(buffer + read_index, std::min(chunk_size, total_size - read_index));
295
296 App.feed_wdt();
297 yield();
298
299 auto result = http_read_loop_result(read_bytes_or_error, last_data_time, timeout_ms, container->is_read_complete());
300 if (result == HttpReadLoopResult::RETRY)
301 continue;
302 if (result == HttpReadLoopResult::COMPLETE)
303 break; // Server sent less data than requested, but transfer is complete
304 if (result == HttpReadLoopResult::ERROR)
305 return {HttpReadStatus::ERROR, read_bytes_or_error};
306 if (result == HttpReadLoopResult::TIMEOUT)
307 return {HttpReadStatus::TIMEOUT, 0};
308
309 read_index += read_bytes_or_error;
310 }
311 return {HttpReadStatus::OK, 0};
312}
313
314class HttpRequestResponseTrigger : public Trigger<std::shared_ptr<HttpContainer>, std::string &> {
315 public:
316 void process(const std::shared_ptr<HttpContainer> &container, std::string &response_body) {
317 this->trigger(container, response_body);
318 }
319};
320
322 public:
323 void dump_config() override;
324 float get_setup_priority() const override { return setup_priority::AFTER_WIFI; }
325
326 void set_useragent(const char *useragent) { this->useragent_ = useragent; }
327 void set_timeout(uint32_t timeout) { this->timeout_ = timeout; }
328 uint32_t get_timeout() const { return this->timeout_; }
329 void set_watchdog_timeout(uint32_t watchdog_timeout) { this->watchdog_timeout_ = watchdog_timeout; }
331 void set_follow_redirects(bool follow_redirects) { this->follow_redirects_ = follow_redirects; }
332 void set_redirect_limit(uint16_t limit) { this->redirect_limit_ = limit; }
333
334 std::shared_ptr<HttpContainer> get(const std::string &url) {
335 return this->start(url, "GET", "", std::vector<Header>{});
336 }
337 std::shared_ptr<HttpContainer> get(const std::string &url, const std::vector<Header> &request_headers) {
338 return this->start(url, "GET", "", request_headers);
339 }
340 std::shared_ptr<HttpContainer> get(const std::string &url, const std::vector<Header> &request_headers,
341 const std::vector<std::string> &lower_case_collect_headers) {
342 return this->start(url, "GET", "", request_headers, lower_case_collect_headers);
343 }
344 std::shared_ptr<HttpContainer> post(const std::string &url, const std::string &body) {
345 return this->start(url, "POST", body, std::vector<Header>{});
346 }
347 std::shared_ptr<HttpContainer> post(const std::string &url, const std::string &body,
348 const std::vector<Header> &request_headers) {
349 return this->start(url, "POST", body, request_headers);
350 }
351 std::shared_ptr<HttpContainer> post(const std::string &url, const std::string &body,
352 const std::vector<Header> &request_headers,
353 const std::vector<std::string> &lower_case_collect_headers) {
354 return this->start(url, "POST", body, request_headers, lower_case_collect_headers);
355 }
356
357 // Remove before 2027.1.0
358 ESPDEPRECATED("Pass request_headers as std::vector<Header> instead of std::list. Removed in 2027.1.0.", "2026.7.0")
359 std::shared_ptr<HttpContainer> get(const std::string &url, const std::list<Header> &request_headers) {
360 return this->get(url, std::vector<Header>(request_headers.begin(), request_headers.end()));
361 }
362 // Remove before 2027.1.0
363 ESPDEPRECATED("Pass request_headers as std::vector<Header> instead of std::list. Removed in 2027.1.0.", "2026.7.0")
364 std::shared_ptr<HttpContainer> get(const std::string &url, const std::list<Header> &request_headers,
365 const std::vector<std::string> &collect_headers) {
366 return this->get(url, std::vector<Header>(request_headers.begin(), request_headers.end()), collect_headers);
367 }
368 // Remove before 2027.1.0
369 ESPDEPRECATED("Pass request_headers as std::vector<Header> instead of std::list. Removed in 2027.1.0.", "2026.7.0")
370 std::shared_ptr<HttpContainer> post(const std::string &url, const std::string &body,
371 const std::list<Header> &request_headers) {
372 return this->post(url, body, std::vector<Header>(request_headers.begin(), request_headers.end()));
373 }
374 // Remove before 2027.1.0
375 ESPDEPRECATED("Pass request_headers as std::vector<Header> instead of std::list. Removed in 2027.1.0.", "2026.7.0")
376 std::shared_ptr<HttpContainer> post(const std::string &url, const std::string &body,
377 const std::list<Header> &request_headers,
378 const std::vector<std::string> &collect_headers) {
379 return this->post(url, body, std::vector<Header>(request_headers.begin(), request_headers.end()), collect_headers);
380 }
381
382 std::shared_ptr<HttpContainer> start(const std::string &url, const std::string &method, const std::string &body,
383 const std::vector<Header> &request_headers) {
384 // Call perform() directly to avoid ambiguity with the deprecated overloads
385 return this->perform(url, method, body, request_headers, {});
386 }
387
388 // Remove before 2027.1.0
389 ESPDEPRECATED("Pass request_headers as std::vector<Header> instead of std::list. Removed in 2027.1.0.", "2026.7.0")
390 std::shared_ptr<HttpContainer> start(const std::string &url, const std::string &method, const std::string &body,
391 const std::list<Header> &request_headers) {
392 return this->start(url, method, body, std::vector<Header>(request_headers.begin(), request_headers.end()));
393 }
394
395 // Remove before 2027.1.0
396 ESPDEPRECATED("Pass collect_headers as std::vector<std::string> instead of std::set. Removed in 2027.1.0.",
397 "2026.7.0")
398 std::shared_ptr<HttpContainer> start(const std::string &url, const std::string &method, const std::string &body,
399 const std::vector<Header> &request_headers,
400 const std::set<std::string> &collect_headers) {
401 std::vector<std::string> lower;
402 lower.reserve(collect_headers.size());
403 for (const auto &h : collect_headers) {
404 lower.push_back(str_lower_case(h)); // NOLINT
405 }
406 return this->perform(url, method, body, request_headers, lower);
407 }
408
409 // Remove before 2027.1.0
410 ESPDEPRECATED("Pass request_headers as std::vector<Header> instead of std::list, and collect_headers as "
411 "std::vector<std::string> instead of std::set. Removed in 2027.1.0.",
412 "2026.7.0")
413 std::shared_ptr<HttpContainer> start(const std::string &url, const std::string &method, const std::string &body,
414 const std::list<Header> &request_headers,
415 const std::set<std::string> &collect_headers) {
416 std::vector<std::string> lower;
417 lower.reserve(collect_headers.size());
418 for (const auto &h : collect_headers) {
419 lower.push_back(str_lower_case(h)); // NOLINT
420 }
421 return this->perform(url, method, body, std::vector<Header>(request_headers.begin(), request_headers.end()), lower);
422 }
423
424 // Remove before 2027.1.0
425 ESPDEPRECATED("Pass request_headers as std::vector<Header> instead of std::list. Removed in 2027.1.0.", "2026.7.0")
426 std::shared_ptr<HttpContainer> start(const std::string &url, const std::string &method, const std::string &body,
427 const std::list<Header> &request_headers,
428 const std::vector<std::string> &lower_case_collect_headers) {
429 return this->perform(url, method, body, std::vector<Header>(request_headers.begin(), request_headers.end()),
430 lower_case_collect_headers);
431 }
432
433 std::shared_ptr<HttpContainer> start(const std::string &url, const std::string &method, const std::string &body,
434 const std::vector<Header> &request_headers,
435 const std::vector<std::string> &lower_case_collect_headers) {
436 return this->perform(url, method, body, request_headers, lower_case_collect_headers);
437 }
438
439 protected:
440 virtual std::shared_ptr<HttpContainer> perform(const std::string &url, const std::string &method,
441 const std::string &body, const std::vector<Header> &request_headers,
442 const std::vector<std::string> &lower_case_collect_headers) = 0;
443 const char *useragent_{nullptr};
445 uint16_t redirect_limit_{};
448};
449
450template<typename... Ts> class HttpRequestSendAction : public Action<Ts...> {
451 public:
453 TEMPLATABLE_VALUE(std::string, url)
454 TEMPLATABLE_VALUE(const char *, method)
455 TEMPLATABLE_VALUE(std::string, body)
456#ifdef USE_HTTP_REQUEST_RESPONSE
457 TEMPLATABLE_VALUE(bool, capture_response)
458#endif
459
460 void init_request_headers(size_t count) { this->request_headers_.init(count); }
462 this->request_headers_.push_back({key, value});
463 }
464
465 void add_collect_header(const char *value) { this->lower_case_collect_headers_.emplace_back(value); }
466
467 void init_json(size_t count) { this->json_.init(count); }
468 void add_json(const char *key, TemplatableValue<std::string, Ts...> value) { this->json_.push_back({key, value}); }
469
470 void set_json(std::function<void(Ts..., JsonObject)> json_func) { this->json_func_ = json_func; }
471
472#ifdef USE_HTTP_REQUEST_RESPONSE
476#endif
478
479 Trigger<Ts...> *get_error_trigger() { return &this->error_trigger_; }
480
481 void set_max_response_buffer_size(size_t max_response_buffer_size) {
482 this->max_response_buffer_size_ = max_response_buffer_size;
483 }
484
485 void play(const Ts &...x) override {
486 std::string body;
487 if (this->body_.has_value()) {
488 body = this->body_.value(x...);
489 }
490 if (!this->json_.empty()) {
491 body = json::build_json([this, x...](JsonObject root) { this->encode_json_(x..., root); });
492 }
493 if (this->json_func_ != nullptr) {
494 body = json::build_json([this, x...](JsonObject root) { this->json_func_(x..., root); });
495 }
496 std::vector<Header> request_headers;
497 request_headers.reserve(this->request_headers_.size());
498 for (const auto &[key, val] : this->request_headers_) {
499 request_headers.push_back({key, val.value(x...)});
500 }
501
502 auto container = this->parent_->start(this->url_.value(x...), this->method_.value(x...), body, request_headers,
503 this->lower_case_collect_headers_);
504
505 auto captured_args = std::make_tuple(x...);
506
507 if (container == nullptr) {
508 std::apply([this](Ts... captured_args_inner) { this->error_trigger_.trigger(captured_args_inner...); },
509 captured_args);
510 return;
511 }
512
513 size_t max_length = this->max_response_buffer_size_;
514#ifdef USE_HTTP_REQUEST_RESPONSE
515 if (this->capture_response_.value(x...)) {
516 std::string response_body;
517 RAMAllocator<uint8_t> allocator;
518 uint8_t *buf = allocator.allocate(max_length);
519 if (buf != nullptr) {
520 // NOTE: HttpContainer::read() has non-BSD socket semantics - see top of this file
521 // Use http_read_loop_result() helper instead of checking return values directly
522 size_t read_index = 0;
523 uint32_t last_data_time = millis();
524 const uint32_t read_timeout = this->parent_->get_timeout();
525 while (container->get_bytes_read() < max_length) {
526 int read_or_error = container->read(buf + read_index, std::min<size_t>(max_length - read_index, 512));
527 App.feed_wdt();
528 yield();
529 auto result =
530 http_read_loop_result(read_or_error, last_data_time, read_timeout, container->is_read_complete());
531 if (result == HttpReadLoopResult::RETRY)
532 continue;
533 if (result != HttpReadLoopResult::DATA)
534 break; // COMPLETE, ERROR, or TIMEOUT
535 read_index += read_or_error;
536 }
537 response_body.reserve(read_index);
538 response_body.assign((char *) buf, read_index);
539 allocator.deallocate(buf, max_length);
540 }
541 std::apply(
542 [this, &container, &response_body](Ts... captured_args_inner) {
543 this->success_trigger_with_response_.trigger(container, response_body, captured_args_inner...);
544 },
545 captured_args);
546 } else
547#endif
548 {
549 std::apply([this, &container](
550 Ts... captured_args_inner) { this->success_trigger_.trigger(container, captured_args_inner...); },
551 captured_args);
552 }
553 container->end();
554 }
555
556 protected:
557 void encode_json_(Ts... x, JsonObject root) {
558 for (const auto &item : this->json_) {
559 auto val = item.second;
560 root[item.first] = val.value(x...);
561 }
562 }
564 FixedVector<std::pair<const char *, TemplatableFn<const char *, Ts...>>> request_headers_{};
565 std::vector<std::string> lower_case_collect_headers_{"content-type", "content-length"};
566 FixedVector<std::pair<const char *, TemplatableValue<std::string, Ts...>>> json_{};
567 std::function<void(Ts..., JsonObject)> json_func_{nullptr};
568#ifdef USE_HTTP_REQUEST_RESPONSE
570#endif
573
574 size_t max_response_buffer_size_{SIZE_MAX};
575};
576
577} // namespace esphome::http_request
Heap-allocating helper functions.
uint8_t h
Definition bl0906.h:2
uint8_t status
Definition bl0942.h:8
void feed_wdt()
Feed the task watchdog.
Fixed-capacity vector - allocates once at runtime, never reallocates This avoids std::vector template...
Definition helpers.h:529
Helper class to easily give an object a parent of type T.
Definition helpers.h:1861
Function-pointer-only templatable storage (4 bytes on 32-bit).
Definition automation.h:40
Primary TemplatableValue: stores either a constant value or a function pointer.
Definition automation.h:115
std::string get_response_header(const std::string &header_name)
virtual int read(uint8_t *buf, size_t max_len)=0
Read data from the HTTP response body.
virtual bool is_read_complete() const
Check if all expected content has been read.
std::vector< Header > response_headers_
int status_code
-1 indicates no response received yet
bool is_chunked_
True if response uses chunked transfer encoding.
ESPDEPRECATED("Pass request_headers as std::vector<Header> instead of std::list. Removed in 2027.1.0.", "2026.7.0") std
std::shared_ptr< HttpContainer > post(const std::string &url, const std::string &body)
void set_useragent(const char *useragent)
ESPDEPRECATED("Pass request_headers as std::vector<Header> instead of std::list, and collect_headers as " "std::vector<std::string> instead of std::set. Removed in 2027.1.0.", "2026.7.0") std
std::shared_ptr< HttpContainer > start(const std::string &url, const std::string &method, const std::string &body, const std::vector< Header > &request_headers)
std::shared_ptr< HttpContainer > post(const std::string &url, const std::string &body, const std::vector< Header > &request_headers, const std::vector< std::string > &lower_case_collect_headers)
void set_follow_redirects(bool follow_redirects)
std::shared_ptr< HttpContainer > get(const std::string &url, const std::vector< Header > &request_headers, const std::vector< std::string > &lower_case_collect_headers)
void set_watchdog_timeout(uint32_t watchdog_timeout)
ESPDEPRECATED("Pass collect_headers as std::vector<std::string> instead of std::set. Removed in 2027.1.0.", "2026.7.0") std
std::shared_ptr< HttpContainer > post(const std::string &url, const std::string &body, const std::vector< Header > &request_headers)
std::shared_ptr< HttpContainer > start(const std::string &url, const std::string &method, const std::string &body, const std::vector< Header > &request_headers, const std::vector< std::string > &lower_case_collect_headers)
std::shared_ptr< HttpContainer > get(const std::string &url)
virtual std::shared_ptr< HttpContainer > perform(const std::string &url, const std::string &method, const std::string &body, const std::vector< Header > &request_headers, const std::vector< std::string > &lower_case_collect_headers)=0
std::shared_ptr< HttpContainer > get(const std::string &url, const std::vector< Header > &request_headers)
void process(const std::shared_ptr< HttpContainer > &container, std::string &response_body)
void set_max_response_buffer_size(size_t max_response_buffer_size)
TEMPLATABLE_VALUE(std::string, url) TEMPLATABLE_VALUE(const char *
Trigger< std::shared_ptr< HttpContainer >, std::string &, Ts... > success_trigger_with_response_
method capture_response void init_request_headers(size_t count)
FixedVector< std::pair< const char *, TemplatableFn< const char *, Ts... > > > request_headers_
std::function< void(Ts..., JsonObject)> json_func_
Trigger< std::shared_ptr< HttpContainer >, Ts... > success_trigger_
std::vector< std::string > lower_case_collect_headers_
void set_json(std::function< void(Ts..., JsonObject)> json_func)
void add_json(const char *key, TemplatableValue< std::string, Ts... > value)
Trigger< std::shared_ptr< HttpContainer >, std::string &, Ts... > * get_success_trigger_with_response()
void encode_json_(Ts... x, JsonObject root)
void add_request_header(const char *key, TemplatableFn< const char *, Ts... > value)
Trigger< std::shared_ptr< HttpContainer >, Ts... > * get_success_trigger()
HttpRequestSendAction(HttpRequestComponent *parent)
FixedVector< std::pair< const char *, TemplatableValue< std::string, Ts... > > > json_
void yield(void)
mopeka_std_values val[3]
bool should_collect_header(const std::vector< std::string > &lower_case_collect_headers, const std::string &lower_header_name)
Check if a header name should be collected (linear scan, fine for small lists)
HttpReadLoopResult
Result of processing a non-blocking read with timeout (for manual loops)
@ TIMEOUT
Timeout waiting for data, caller should exit loop.
@ COMPLETE
All content has been read, caller should exit loop.
@ ERROR
Read error, caller should exit loop.
@ RETRY
No data yet, already delayed, caller should continue loop.
@ DATA
Data was read, process it.
bool is_success(int const status)
Checks if the given HTTP status code indicates a successful request.
HttpReadLoopResult http_read_loop_result(int bytes_read_or_error, uint32_t &last_data_time, uint32_t timeout_ms, bool is_read_complete)
Process a read result with timeout tracking and delay handling.
bool is_redirect(int const status)
Returns true if the HTTP status code is a redirect.
HttpReadResult http_read_fully(HttpContainer *container, uint8_t *buffer, size_t total_size, size_t chunk_size, uint32_t timeout_ms)
Read data from HTTP container into buffer with timeout handling Handles feed_wdt, yield,...
HttpReadStatus
Status of a read operation.
@ TIMEOUT
Timeout waiting for data.
@ OK
Read completed successfully.
SerializationBuffer build_json(const json_build_t &f)
Build a JSON string with the provided json build function.
Definition json_util.cpp:17
constexpr float AFTER_WIFI
For components that should be initialized after WiFi is connected.
Definition component.h:53
std::string str_lower_case(const std::string &str)
Convert the string to lower case.
if(written< 0)
Definition helpers.h:1047
void HOT delay(uint32_t ms)
Definition hal.cpp:85
uint32_t IRAM_ATTR HOT millis()
Definition hal.cpp:28
Application App
Global storage of Application pointer - only one Application can exist.
for(uint32_t *p=scan_start;p< stack_top &&p< scan_start+64 &&bt_count< MAX_BACKTRACE;p++)
static void uint32_t
Result of an HTTP read operation.
HttpReadStatus status
Status of the read operation.
int error_code
Error code from read() on failure, 0 on success.
uint16_t x
Definition tt21100.cpp:5