HttpServerConnection.h
Go to the documentation of this file.
110 virtual void sendError(const String& message = nullptr, HttpStatus code = HTTP_STATUS_BAD_REQUEST);
void close() override
int onMessageBegin(http_parser *parser) override
Called when a new incoming data is beginning to come.
Provides http base used for client and server connections.
Definition: HttpConnection.h:27
void setCloseOnContentError(bool close=true)
Definition: HttpServerConnection.h:83
int onMessageComplete(http_parser *parser) override
Called when the incoming data is complete.
Represents either an incoming or outgoing response to a HTTP request.
Definition: HttpResponse.h:25
void setUpgradeCallback(HttpServerProtocolUpgradeCallback callback)
Definition: HttpServerConnection.h:73
Class to map URL paths to classes which handle them.
Definition: HttpResourceTree.h:26
int onBody(const char *at, size_t length) override
Called when a piece of body data is received.
virtual void sendError(const String &message=nullptr, HttpStatus code=HTTP_STATUS_BAD_REQUEST)
void onReadyToSendData(TcpConnectionEvent sourceEvent) override
HttpServerConnection(tcp_pcb *clientTcp)
Definition: HttpServerConnection.h:36
bool send(const char *data, uint16_t len, bool forceCloseAfterSent=false)
virtual void shutdown(HttpServerConnection &connection)
Takes care to cleanup the connection.
Definition: HttpResource.h:43
void * userData
use to pass user data between requests
Definition: HttpServerConnection.h:117
void * args
Used to store data that should be valid during a single request.
Definition: HttpRequest.h:292
HttpRequest * getRequest() override
Returns pointer to the current request.
Definition: HttpServerConnection.h:78
~HttpServerConnection()
Definition: HttpServerConnection.h:40
bool onHttpError(HttpError error) override
Called when there was an error.
bool onProtocolUpgrade(http_parser *parser) override
Called when the HTTP protocol should be upgraded.
Definition: HttpServerConnection.h:97
Instances of this class are registered with an HttpServer for a specific URL.
Definition: HttpResource.h:33
Definition: HttpServerConnection.h:33
void setResourceTree(HttpResourceTree *resourceTree)
Definition: HttpServerConnection.h:51
int onHeadersComplete(const HttpHeaders &headers) override
Called when all headers are received.
Definition: Delegate.h:20
void setBodyParsers(const BodyParsers *bodyParsers)
Definition: HttpServerConnection.h:56