ESPHome 2025.5.0
Loading...
Searching...
No Matches
http_request_host.h
Go to the documentation of this file.
1#pragma once
2
3#include "http_request.h"
4
5#ifdef USE_HOST
6
7#define CPPHTTPLIB_NO_EXCEPTIONS
8#include "httplib.h"
9namespace esphome {
10namespace http_request {
11
12class HttpRequestHost;
14 public:
15 int read(uint8_t *buf, size_t max_len) override;
16 void end() override;
17
18 protected:
19 friend class HttpRequestHost;
20 std::vector<uint8_t> response_body_{};
21};
22
24 public:
25 std::shared_ptr<HttpContainer> perform(std::string url, std::string method, std::string body,
26 std::list<Header> request_headers,
27 std::set<std::string> response_headers) override;
28 void set_ca_path(const char *ca_path) { this->ca_path_ = ca_path; }
29
30 protected:
31 const char *ca_path_{};
32};
33
34} // namespace http_request
35} // namespace esphome
36
37#endif // USE_HOST
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 > response_headers) override
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7