ESP8266
|
Classes | |
struct | RequestArgument |
Public Types | |
typedef std::function< void(void)> | THandlerFunction |
Public Member Functions | |
ESP8266WebServer (IPAddress addr, int port=80) | |
ESP8266WebServer (int port=80) | |
~ESP8266WebServer () | |
void | begin () |
void | handleClient () |
void | close () |
void | stop () |
bool | authenticate (const char *username, const char *password) |
void | requestAuthentication () |
void | on (const char *uri, THandlerFunction handler) |
void | on (const char *uri, HTTPMethod method, THandlerFunction fn) |
void | on (const char *uri, HTTPMethod method, THandlerFunction fn, THandlerFunction ufn) |
void | addHandler (RequestHandler *handler) |
void | serveStatic (const char *uri, fs::FS &fs, const char *path, const char *cache_header=NULL) |
void | onNotFound (THandlerFunction fn) |
void | onFileUpload (THandlerFunction fn) |
String | uri () |
HTTPMethod | method () |
WiFiClient | client () |
HTTPUpload & | upload () |
String | arg (const char *name) |
String | arg (int i) |
String | argName (int i) |
int | args () |
bool | hasArg (const char *name) |
void | collectHeaders (const char *headerKeys[], const size_t headerKeysCount) |
String | header (const char *name) |
String | header (int i) |
String | headerName (int i) |
int | headers () |
bool | hasHeader (const char *name) |
String | hostHeader () |
void | send (int code, const char *content_type=NULL, const String &content=String("")) |
void | send (int code, char *content_type, const String &content) |
void | send (int code, const String &content_type, const String &content) |
void | send_P (int code, PGM_P content_type, PGM_P content) |
void | send_P (int code, PGM_P content_type, PGM_P content, size_t contentLength) |
void | setContentLength (size_t contentLength) |
void | sendHeader (const String &name, const String &value, bool first=false) |
void | sendContent (const String &content) |
void | sendContent_P (PGM_P content) |
void | sendContent_P (PGM_P content, size_t size) |
template<typename T > | |
size_t | streamFile (T &file, const String &contentType) |
Protected Member Functions | |
void | _addRequestHandler (RequestHandler *handler) |
void | _handleRequest () |
bool | _parseRequest (WiFiClient &client) |
void | _parseArguments (String data) |
bool | _parseForm (WiFiClient &client, String boundary, uint32_t len) |
bool | _parseFormUploadAborted () |
void | _uploadWriteByte (uint8_t b) |
uint8_t | _uploadReadByte (WiFiClient &client) |
void | _prepareHeader (String &response, int code, const char *content_type, size_t contentLength) |
bool | _collectHeader (const char *headerName, const char *headerValue) |
String | urlDecode (const String &text) |
Static Protected Member Functions | |
static const char * | _responseCodeToString (int code) |
Protected Attributes | |
WiFiServer | _server |
WiFiClient | _currentClient |
HTTPMethod | _currentMethod |
String | _currentUri |
RequestHandler * | _currentHandler |
RequestHandler * | _firstHandler |
RequestHandler * | _lastHandler |
THandlerFunction | _notFoundHandler |
THandlerFunction | _fileUploadHandler |
int | _currentArgCount |
RequestArgument * | _currentArgs |
HTTPUpload | _currentUpload |
int | _headerKeysCount |
RequestArgument * | _currentHeaders |
size_t | _contentLength |
String | _responseHeaders |
String | _hostHeader |
typedef std::function<void(void)> ESP8266WebServer::THandlerFunction |
ESP8266WebServer::ESP8266WebServer | ( | IPAddress | addr, |
int | port = 80 |
||
) |
ESP8266WebServer::ESP8266WebServer | ( | int | port = 80 | ) |
ESP8266WebServer::~ESP8266WebServer | ( | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
protected |
|
protected |
void ESP8266WebServer::addHandler | ( | RequestHandler * | handler | ) |
String ESP8266WebServer::arg | ( | const char * | name | ) |
String ESP8266WebServer::arg | ( | int | i | ) |
String ESP8266WebServer::argName | ( | int | i | ) |
int ESP8266WebServer::args | ( | ) |
bool ESP8266WebServer::authenticate | ( | const char * | username, |
const char * | password | ||
) |
void ESP8266WebServer::begin | ( | ) |
WiFiClient ESP8266WebServer::client | ( | ) |
void ESP8266WebServer::close | ( | ) |
void ESP8266WebServer::collectHeaders | ( | const char * | headerKeys[], |
const size_t | headerKeysCount | ||
) |
void ESP8266WebServer::handleClient | ( | ) |
bool ESP8266WebServer::hasArg | ( | const char * | name | ) |
bool ESP8266WebServer::hasHeader | ( | const char * | name | ) |
String ESP8266WebServer::header | ( | const char * | name | ) |
String ESP8266WebServer::header | ( | int | i | ) |
String ESP8266WebServer::headerName | ( | int | i | ) |
int ESP8266WebServer::headers | ( | ) |
String ESP8266WebServer::hostHeader | ( | ) |
HTTPMethod ESP8266WebServer::method | ( | ) |
void ESP8266WebServer::on | ( | const char * | uri, |
ESP8266WebServer::THandlerFunction | handler | ||
) |
void ESP8266WebServer::on | ( | const char * | uri, |
HTTPMethod | method, | ||
ESP8266WebServer::THandlerFunction | fn | ||
) |
void ESP8266WebServer::on | ( | const char * | uri, |
HTTPMethod | method, | ||
ESP8266WebServer::THandlerFunction | fn, | ||
ESP8266WebServer::THandlerFunction | ufn | ||
) |
void ESP8266WebServer::onFileUpload | ( | THandlerFunction | fn | ) |
void ESP8266WebServer::onNotFound | ( | THandlerFunction | fn | ) |
void ESP8266WebServer::requestAuthentication | ( | ) |
void ESP8266WebServer::send | ( | int | code, |
const char * | content_type = NULL , |
||
const String & | content = String("") |
||
) |
void ESP8266WebServer::send | ( | int | code, |
char * | content_type, | ||
const String & | content | ||
) |
void ESP8266WebServer::send | ( | int | code, |
const String & | content_type, | ||
const String & | content | ||
) |
void ESP8266WebServer::send_P | ( | int | code, |
PGM_P | content_type, | ||
PGM_P | content | ||
) |
void ESP8266WebServer::send_P | ( | int | code, |
PGM_P | content_type, | ||
PGM_P | content, | ||
size_t | contentLength | ||
) |
void ESP8266WebServer::sendContent | ( | const String & | content | ) |
void ESP8266WebServer::sendContent_P | ( | PGM_P | content | ) |
void ESP8266WebServer::sendContent_P | ( | PGM_P | content, |
size_t | size | ||
) |
void ESP8266WebServer::sendHeader | ( | const String & | name, |
const String & | value, | ||
bool | first = false |
||
) |
void ESP8266WebServer::serveStatic | ( | const char * | uri, |
fs::FS & | fs, | ||
const char * | path, | ||
const char * | cache_header = NULL |
||
) |
void ESP8266WebServer::setContentLength | ( | size_t | contentLength | ) |
void ESP8266WebServer::stop | ( | ) |
size_t ESP8266WebServer::streamFile | ( | T & | file, |
const String & | contentType | ||
) |
HTTPUpload& ESP8266WebServer::upload | ( | ) |
String ESP8266WebServer::uri | ( | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |