Interface for HTTP request handlers.
More...
#include <httpd.hpp>
Interface for HTTP request handlers.
Implement HandleRequest to process requests and write responses. A single router instance is shared across all connections; implementations must be stateless or protect shared state explicitly (though a single-threaded event loop means no concurrent calls in practice).
}
};
Represents an incoming HTTP/1.1 request.
Definition httpd.hpp:53
Builds and sends an HTTP/1.1 response.
Definition httpd.hpp:126
void SetStatus(int statusCode)
Sets the HTTP status code (default is 200). Must be called before SendHeaders.
Definition httpd.cpp:283
TFuture< void > WriteBodyFull(const std::string &data)
Sends headers (with Content-Length) and the full body in one call.
Definition httpd.cpp:356
TFuture< void > SendHeaders()
Sends the status line and all accumulated headers to the client.
Definition httpd.cpp:305
void SetHeader(const std::string &name, const std::string &value)
Adds or replaces a response header. Must be called before SendHeaders.
Definition httpd.cpp:287
Interface for HTTP request handlers.
Definition httpd.hpp:194
Owned coroutine handle that carries a result of type T.
Definition corochain.hpp:185
The documentation for this struct was generated from the following file: