ESPHome  2024.11.3
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 #endif
10 #ifdef USE_ESP8266
11 #include <ESP8266HTTPClient.h>
12 #ifdef USE_HTTP_REQUEST_ESP8266_HTTPS
13 #include <WiFiClientSecure.h>
14 #endif
15 #endif
16 
17 namespace esphome {
18 namespace http_request {
19 
20 class HttpRequestArduino;
22  public:
23  int read(uint8_t *buf, size_t max_len) override;
24  void end() override;
25 
26  protected:
27  friend class HttpRequestArduino;
28  HTTPClient client_{};
29 };
30 
32  public:
33  std::shared_ptr<HttpContainer> start(std::string url, std::string method, std::string body,
34  std::list<Header> headers) override;
35 };
36 
37 } // namespace http_request
38 } // namespace esphome
39 
40 #endif // USE_ARDUINO
int read(uint8_t *buf, size_t max_len) override
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7