HttpServerConnection.h
Go to the documentation of this file.
106 virtual void sendError(const String& message = nullptr, enum http_status code = HTTP_STATUS_BAD_REQUEST);
~HttpServerConnection()
Definition: HttpServerConnection.h:40
int onMessageBegin(http_parser *parser) override
Called when a new incoming data is beginning to come.
bool onHttpError(http_errno error) override
Called when there was an error.
void close() override
int onMessageComplete(http_parser *parser) override
Called when the incoming data is complete.
Definition: HttpServerConnection.h:33
bool onProtocolUpgrade(http_parser *parser) override
Called when the HTTP protocol should be upgraded.
Definition: HttpServerConnection.h:93
Definition: Delegate.h:20
int onHeadersComplete(const HttpHeaders &headers) override
Called when all headers are received.
Delegate< bool()> HttpServerProtocolUpgradeCallback
Definition: HttpServerConnection.h:31
Definition: HttpResource.h:30
bool send(const char *data, uint16_t len, bool forceCloseAfterSent=false)
void onReadyToSendData(TcpConnectionEvent sourceEvent) override
HttpServerConnection(tcp_pcb *clientTcp)
Definition: HttpServerConnection.h:36
Delegate< void(HttpServerConnection &connection)> HttpServerConnectionDelegate
Definition: HttpServerConnection.h:27
void setResourceTree(HttpResourceTree *resourceTree)
Definition: HttpServerConnection.h:51
void setBodyParsers(const BodyParsers *bodyParsers)
Definition: HttpServerConnection.h:56
void * userData
use to pass user data between requests
Definition: HttpServerConnection.h:113
int onBody(const char *at, size_t length) override
Called when a piece of body data is received.
Class to map URL paths to classes which handle them.
Definition: HttpResourceTree.h:24
Definition: HttpRequest.h:35
HttpRequest * getRequest() override
Returns pointer to the current request.
Definition: HttpServerConnection.h:74
virtual void shutdown(HttpServerConnection &connection)
Takes care to cleanup the connection.
Definition: HttpResource.h:40
void setCloseOnContentError(bool close=true)
Definition: HttpServerConnection.h:79
Provides http base used for client and server connections.
Definition: HttpConnection.h:27
virtual void sendError(const String &message=nullptr, enum http_status code=HTTP_STATUS_BAD_REQUEST)
void setUpgradeCallback(HttpServerProtocolUpgradeCallback callback)
Definition: HttpServerConnection.h:69
Definition: HttpCommon.h:38
Definition: HttpResponse.h:20