EgretDoc
Back to Home
Location:system/aio.http

Module

Module documentation.

moduleaio.http

Classes

Classes and inheritance.

classaio.http::Url
@brief`Url` type.
@details`Url` encapsulates state and operations exported by the system module. It commonly stores runtime handles, protocol state, buffers, configuration, or collection data. Its methods define the primary behavior for the type. If the type owns external resources, prefer `dispose` or `close` for deterministic release.
class Url {
    /*
    @brief `scheme` field.

Functions

Free functions and class methods.

functionaio.http::ping
Signaturefunc ping() -> String
func ping() -> String {
    return "pong";
}
@briefProvides the system library operation `ping`.
@detailsExecutes the `ping` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@returnReturns the operation result as `String`.
functionaio.http::Url.init
Signaturefunc init(self: Url, scheme: String, host: String, port: Int, path: String) -> Void
    func init(self: Url, scheme: String, host: String, port: Int, path: String) -> Void {
        self.scheme = scheme;
        self.host = host;
@briefInitializes a `Url` instance.
@detailsEstablishes the initial field state for `Url` so other methods can be called safely. Constructor logic should keep fields consistent and avoid leaking partially initialized resources.
@param
  • selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
  • schemeURL or protocol scheme such as `http`, `https`, or a database protocol name.
  • hostHost name or listen address.
  • portPort number.
  • pathFile or directory path.
@returnVoid
functionaio.http::Url.deinit
Signaturefunc deinit(self: Url) -> Void
    func deinit(self: Url) -> Void {
    }
}
@briefReleases fallback resources at the end of the `Url` lifetime.
@detailsThis destructor hook is called by object lifetime management to clean up underlying resources that were not released explicitly. Normal application code should prefer `dispose`, `close`, or the module-specific close function to release resources at a deterministic time.
@param
  • selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnVoid
functionaio.http::find_substr_from
Signaturefunc find_substr_from(s: String, pat: String, start: Int) -> Int
func find_substr_from(s: String, pat: String, start: Int) -> Int {
    let n: Int = std.len(s);
    let m: Int = std.len(pat);
@briefFinds a matching position or element with `find_substr_from`.
@detailsExecutes the `find_substr_from` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • sInput string.
  • patPattern string used for matching keys, text, routes, or protocol fields.
  • startZero-based starting index, byte offset, or range boundary for the operation.
@returnReturns the operation result as `Int`.
functionaio.http::find_substr
Signaturefunc find_substr(s: String, pat: String) -> Int
func find_substr(s: String, pat: String) -> Int {
    return find_substr_from(s, pat, 0);
}
@briefFinds a matching position or element with `find_substr`.
@detailsExecutes the `find_substr` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • sInput string.
  • patPattern string used for matching keys, text, routes, or protocol fields.
@returnReturns the operation result as `Int`.
functionaio.http::parse_url
Signaturefunc parse_url(url: String) -> Url
func parse_url(url: String) -> Url {
    let scheme: String = "http";
    let rest: String = url;
@briefParses input data with `parse_url`.
@detailsExecutes the `parse_url` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • urlTarget URL string.
@returnReturns the operation result as `Url`.
functionaio.http::decode_chunked
Signaturefunc decode_chunked(body: String) -> String
func decode_chunked(body: String) -> String {
    let out: String = "";
    let i: Int = 0;
@briefDecodes input data with `decode_chunked`.
@detailsExecutes the `decode_chunked` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • bodyRequest or response body content carried by the protocol message.
@returnReturns the operation result as `String`.
functionaio.http::header_value
Signaturefunc header_value(headers_lc: String, key_lc: String) -> String
func header_value(headers_lc: String, key_lc: String) -> String {
    let k: String = (key_lc + ":");
    let p: Int = find_substr(headers_lc, k);
@briefProvides the system library operation `header_value`.
@detailsExecutes the `header_value` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • headers_lcHeader map keyed by lower-case header names for case-insensitive lookup.
  • key_lcKey name, key material, or key collection used by the operation.
@returnReturns the operation result as `String`.

Variables

Class fields (var).

varaio.http::Url.scheme
TypeString
@brief`scheme` field.
@detailsHolds the `scheme` value for each `Url` instance. The field type is `String`, and constructors and methods keep it synchronized with the object's runtime state.
    var scheme: String;
    /*
    @brief `host` field.
varaio.http::Url.host
TypeString
@brief`host` field.
@detailsStores a host name or network address. The field type is `String`, and it is maintained by the constructors and methods of `Url`.
    var host: String;
    /*
    @brief `port` field.
varaio.http::Url.port
TypeInt
@brief`port` field.
@detailsStores a port number. The field type is `Int`, and it is maintained by the constructors and methods of `Url`.
    var port: Int;
    /*
    @brief `path` field.
varaio.http::Url.path
TypeString
@brief`path` field.
@detailsStores the associated filesystem path. The field type is `String`, and it is maintained by the constructors and methods of `Url`.
    var path: String;

    /*