Bundle Lightweight embedded web server. Handles inbound HTTP requests with typed access to method, path, headers, and body; Response supports content-type, compression, redirects, and cookies. Compile with -lib net_server.
Handler
Serves Web.Server handlers on the Web.HTTP.Server engine. Subclass and override Process. The adapter wraps the server's request and response so handler code sees the Web.Server API.
Inherits: HttpRequestHandler
Example
class MyHandler from Web.Server.Handler {
New() { Parent(); }
method : public : Process(request : Web.Server.Request, response : Web.Server.Response) ~ Bool {
response->SetContentType("text/plain");
response->WriteBody("hello");
return false;
}
}
Web.Server.Handler->Serve(MyHandler->New()->GetClass(), 8080);Operations
Process # virtual
Handles a request. Subclasses must implement this. Declared virtual, which in Objeck is a declaration without a body: a concrete method here would be bound statically from ProcessGet below, so a subclass override would never run.
method : public : virtual : Process(request:Request, response:Response) ~ BoolParameters
| Name | Type | Description |
|---|---|---|
| request | Request | request |
| response | Response | response |
Return
| Type | Description |
|---|---|
| Bool | true to continue processing, false otherwise |