ESP32 HTTPS Server
httpsserver::HTTPResponse Class Reference

Represents the response stream of an HTTP request. More...

#include <HTTPResponse.hpp>

Inheritance diagram for httpsserver::HTTPResponse:
Collaboration diagram for httpsserver::HTTPResponse:

Public Member Functions

 HTTPResponse (ConnectionContext *con)
 
void setStatusCode (uint16_t statusCode)
 
void setStatusText (std::string const &statusText)
 
uint16_t getStatusCode ()
 
std::string getStatusText ()
 
void setHeader (std::string const &name, std::string const &value)
 
std::string getHeader (std::string const &name)
 
bool isHeaderWritten ()
 
void printStd (std::string const &str)
 
size_t write (const uint8_t *buffer, size_t size)
 
size_t write (uint8_t)
 
void error ()
 
bool isResponseBuffered ()
 
void finalize ()
 

Public Attributes

ConnectionContext_con
 

Detailed Description

Represents the response stream of an HTTP request.

Member Function Documentation

◆ error()

void httpsserver::HTTPResponse::error ( )

This method can be called to cancel the ongoing transmission and send the error page (if possible)

◆ printStd()

void httpsserver::HTTPResponse::printStd ( std::string const &  str)

Writes a string to the response. May be called several times.

◆ write() [1/2]

size_t httpsserver::HTTPResponse::write ( const uint8_t *  buffer,
size_t  size 
)

Writes bytes to the response. May be called several times.

◆ write() [2/2]

size_t httpsserver::HTTPResponse::write ( uint8_t  b)

Writes a single byte to the response.


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