Basics
Guides
API Reference
Basics
Guides
API Reference
[81:14] (extern: com.lehman.aussom.stdlib.AussomHttpServer) extends: object
HttpServer (int Port = 8080)
Creates and binds the HTTP server to the given port.
Port is an int with the port number to listen on. Defaults to 8080.newHttpServer (int Port)
serveFiles (string UriPath, string LocalDir)
Registers a static file handler that serves files from a local directory.
UriPath is a string with the URI path prefix (e.g. "/").LocalDir is a string with the local directory path to serve files from.this objectaddHandler (string UriPath, callback Handler)
Registers a custom callback handler for the given URI path prefix. The callback receives a request map { method, uri, path, query, headers, body } and must return a response map { code, headers, body }.
UriPath is a string with the URI path prefix (e.g. "/api/").Handler is a callback that handles the request.this objectremoveContext (string UriPath)
Removes a previously registered context by URI path.
UriPath is a string with the URI path prefix to remove.this objectstart ()
Starts the server in a background thread (non-blocking).
this objectstop (int DelaySeconds = 1)
Stops the server, waiting up to DelaySeconds for active exchanges to finish.
DelaySeconds is an int with max seconds to wait. Defaults to 1.this objectgetPort ()
Returns the port number the server is bound to.
An int with the bound port number.[8:14] (extern: com.lehman.aussom.stdlib.AussomHttp) extends: object
Http class implements basic HTTP requests.
setTrustAllCerts (bool TrustAllCerts)
Sets the trust all certs flag and resets the HTTP client. Setting to true isn't recommended for production environments.
TrustAllCerts is a bool with true to trust all certificates and false to not.this objectget (string Url, map Headers = null)
Makes a HTTP GET request to the provided Url and returns a response object.
Url is a string with the URL to request.Headers is an optional map of request headers to set on the call (e.g. { "X-API-KEY": "abc123" }). Values may be strings or lists of strings; lists become repeated headers.A HTTP response object.post (string Url, string Content, string MediaType = "application/json; charset=utf-8", map Headers = null)
Makes a HTTP POST request with the provided arguments.
Url is a string with the URL to request.Content is a string with the POST body content.MediaType is a string with the media type. It defaults to application/json and charset utf-8.Headers is an optional map of request headers to set on the call. Values may be strings or lists of strings; lists become repeated headers.A HTTP response object.put (string Url, string Content, string MediaType = "application/json; charset=utf-8", map Headers = null)
Makes a HTTP PUT request with the provided arguments.
Url is a string with the URL to request.Content is a string with the PUT body content.MediaType is a string with the media type. It defaults to application/json and charset utf-8.Headers is an optional map of request headers to set on the call. Values may be strings or lists of strings; lists become repeated headers.A HTTP response object.patch (string Url, string Content, string MediaType = "application/json; charset=utf-8", map Headers = null)
Makes a HTTP PATCH request with the provided arguments.
Url is a string with the URL to request.Content is a string with the PATCH body content.MediaType is a string with the media type. It defaults to application/json and charset utf-8.Headers is an optional map of request headers to set on the call. Values may be strings or lists of strings; lists become repeated headers.A HTTP response object.delete (string Url, map Headers = null)
Makes a HTTP DELETE request to the provided Url and returns a response object.
Url is a string with the URL to request.Headers is an optional map of request headers to set on the call. Values may be strings or lists of strings; lists become repeated headers.A HTTP response object.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.