ESPHome  2024.12.2
Public Member Functions | Protected Member Functions | Protected Attributes
esphome::web_server_idf::AsyncWebServerRequest Class Reference

#include <web_server_idf.h>

Public Member Functions

 ~AsyncWebServerRequest ()
 
http_method method () const
 
std::string url () const
 
std::string host () const
 
size_t contentLength () const
 
bool authenticate (const char *username, const char *password) const
 
void requestAuthentication (const char *realm=nullptr) const
 
void redirect (const std::string &url)
 
void send (AsyncWebServerResponse *response)
 
void send (int code, const char *content_type=nullptr, const char *content=nullptr)
 
AsyncWebServerResponsebeginResponse (int code, const char *content_type)
 
AsyncWebServerResponsebeginResponse (int code, const char *content_type, const std::string &content)
 
AsyncWebServerResponsebeginResponse_P (int code, const char *content_type, const uint8_t *data, const size_t data_size)
 
AsyncResponseStreambeginResponseStream (const char *content_type)
 
bool hasParam (const std::string &name)
 
AsyncWebParametergetParam (const std::string &name)
 
bool hasArg (const char *name)
 
std::string arg (const std::string &name)
 
 operator httpd_req_t * () const
 
optional< std::string > get_header (const char *name) const
 
bool hasHeader (const char *name) const
 

Protected Member Functions

 AsyncWebServerRequest (httpd_req_t *req)
 
 AsyncWebServerRequest (httpd_req_t *req, std::string post_query)
 
void init_response_ (AsyncWebServerResponse *rsp, int code, const char *content_type)
 

Protected Attributes

httpd_req_t * req_
 
AsyncWebServerResponsersp_ {}
 
std::map< std::string, AsyncWebParameter * > params_
 
std::string post_query_
 

Detailed Description

Definition at line 96 of file web_server_idf.h.

Constructor & Destructor Documentation

◆ ~AsyncWebServerRequest()

esphome::web_server_idf::AsyncWebServerRequest::~AsyncWebServerRequest ( )

Definition at line 127 of file web_server_idf.cpp.

◆ AsyncWebServerRequest() [1/2]

esphome::web_server_idf::AsyncWebServerRequest::AsyncWebServerRequest ( httpd_req_t *  req)
inlineprotected

Definition at line 167 of file web_server_idf.h.

◆ AsyncWebServerRequest() [2/2]

esphome::web_server_idf::AsyncWebServerRequest::AsyncWebServerRequest ( httpd_req_t *  req,
std::string  post_query 
)
inlineprotected

Definition at line 168 of file web_server_idf.h.

Member Function Documentation

◆ arg()

std::string esphome::web_server_idf::AsyncWebServerRequest::arg ( const std::string &  name)
inline

Definition at line 149 of file web_server_idf.h.

◆ authenticate()

bool esphome::web_server_idf::AsyncWebServerRequest::authenticate ( const char *  username,
const char *  password 
) const

Definition at line 188 of file web_server_idf.cpp.

◆ beginResponse() [1/2]

AsyncWebServerResponse* esphome::web_server_idf::AsyncWebServerRequest::beginResponse ( int  code,
const char *  content_type 
)
inline

Definition at line 117 of file web_server_idf.h.

◆ beginResponse() [2/2]

AsyncWebServerResponse* esphome::web_server_idf::AsyncWebServerRequest::beginResponse ( int  code,
const char *  content_type,
const std::string &  content 
)
inline

Definition at line 123 of file web_server_idf.h.

◆ beginResponse_P()

AsyncWebServerResponse* esphome::web_server_idf::AsyncWebServerRequest::beginResponse_P ( int  code,
const char *  content_type,
const uint8_t *  data,
const size_t  data_size 
)
inline

Definition at line 129 of file web_server_idf.h.

◆ beginResponseStream()

AsyncResponseStream* esphome::web_server_idf::AsyncWebServerRequest::beginResponseStream ( const char *  content_type)
inline

Definition at line 136 of file web_server_idf.h.

◆ contentLength()

size_t esphome::web_server_idf::AsyncWebServerRequest::contentLength ( ) const
inline

Definition at line 106 of file web_server_idf.h.

◆ get_header()

optional< std::string > esphome::web_server_idf::AsyncWebServerRequest::get_header ( const char *  name) const

Definition at line 136 of file web_server_idf.cpp.

◆ getParam()

AsyncWebParameter * esphome::web_server_idf::AsyncWebServerRequest::getParam ( const std::string &  name)

Definition at line 227 of file web_server_idf.cpp.

◆ hasArg()

bool esphome::web_server_idf::AsyncWebServerRequest::hasArg ( const char *  name)
inline

Definition at line 148 of file web_server_idf.h.

◆ hasHeader()

bool esphome::web_server_idf::AsyncWebServerRequest::hasHeader ( const char *  name) const

Definition at line 134 of file web_server_idf.cpp.

◆ hasParam()

bool esphome::web_server_idf::AsyncWebServerRequest::hasParam ( const std::string &  name)
inline

Definition at line 143 of file web_server_idf.h.

◆ host()

std::string esphome::web_server_idf::AsyncWebServerRequest::host ( ) const

Definition at line 148 of file web_server_idf.cpp.

◆ init_response_()

void esphome::web_server_idf::AsyncWebServerRequest::init_response_ ( AsyncWebServerResponse rsp,
int  code,
const char *  content_type 
)
protected

Definition at line 169 of file web_server_idf.cpp.

◆ method()

http_method esphome::web_server_idf::AsyncWebServerRequest::method ( ) const
inline

Definition at line 102 of file web_server_idf.h.

◆ operator httpd_req_t *()

esphome::web_server_idf::AsyncWebServerRequest::operator httpd_req_t * ( ) const
inline

Definition at line 157 of file web_server_idf.h.

◆ redirect()

void esphome::web_server_idf::AsyncWebServerRequest::redirect ( const std::string &  url)

Definition at line 163 of file web_server_idf.cpp.

◆ requestAuthentication()

void esphome::web_server_idf::AsyncWebServerRequest::requestAuthentication ( const char *  realm = nullptr) const

Definition at line 220 of file web_server_idf.cpp.

◆ send() [1/2]

void esphome::web_server_idf::AsyncWebServerRequest::send ( AsyncWebServerResponse response)

Definition at line 150 of file web_server_idf.cpp.

◆ send() [2/2]

void esphome::web_server_idf::AsyncWebServerRequest::send ( int  code,
const char *  content_type = nullptr,
const char *  content = nullptr 
)

Definition at line 154 of file web_server_idf.cpp.

◆ url()

std::string esphome::web_server_idf::AsyncWebServerRequest::url ( ) const

Definition at line 140 of file web_server_idf.cpp.

Field Documentation

◆ params_

std::map<std::string, AsyncWebParameter *> esphome::web_server_idf::AsyncWebServerRequest::params_
protected

Definition at line 165 of file web_server_idf.h.

◆ post_query_

std::string esphome::web_server_idf::AsyncWebServerRequest::post_query_
protected

Definition at line 166 of file web_server_idf.h.

◆ req_

httpd_req_t* esphome::web_server_idf::AsyncWebServerRequest::req_
protected

Definition at line 163 of file web_server_idf.h.

◆ rsp_

AsyncWebServerResponse* esphome::web_server_idf::AsyncWebServerRequest::rsp_ {}
protected

Definition at line 164 of file web_server_idf.h.


The documentation for this class was generated from the following files: