ESPHome 2025.9.0-dev
Loading...
Searching...
No Matches
http_request_arduino.h
Go to the documentation of this file.
1#pragma once
2
3#include "http_request.h"
4
5#ifdef USE_ARDUINO
6
7#if defined(USE_ESP32) || defined(USE_RP2040)
8#include <HTTPClient.h>
9#include <WiFiClient.h>
10#endif
11#ifdef USE_ESP8266
12#include <ESP8266HTTPClient.h>
13#ifdef USE_HTTP_REQUEST_ESP8266_HTTPS
14#include <WiFiClientSecure.h>
15#endif
16#endif
17
18namespace esphome {
19namespace http_request {
20
21class HttpRequestArduino;
23 public:
24 int read(uint8_t *buf, size_t max_len) override;
25 void end() override;
26
27 protected:
28 friend class HttpRequestArduino;
29 HTTPClient client_{};
30};
31
33 protected:
34 std::shared_ptr<HttpContainer> perform(std::string url, std::string method, std::string body,
35 std::list<Header> request_headers,
36 std::set<std::string> collect_headers) override;
37};
38
39} // namespace http_request
40} // namespace esphome
41
42#endif // USE_ARDUINO
int read(uint8_t *buf, size_t max_len) override
std::shared_ptr< HttpContainer > perform(std::string url, std::string method, std::string body, std::list< Header > request_headers, std::set< std::string > collect_headers) override
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7