ASPL لباتASPL 0.7.0

Search documentation

Search starts with current English documentation · ASPL 0.7.0

Enter a complete name such as read_line, or words about a topic.

    العربية
    Source files

    Open one UTF-8 .aspl or .لبات file, up to 1 MiB, in a new draft. It stays in this browser and does not run automatically.

    Handle a refused connection as a result

    ASPL 0.7.0 · Current release

    Native only. Handle a refused connection as a result, with exact supplied sources, requirements, commands and outcomes.

    On this page

    Prepare the native host

    Requires no listener on 127.0.0.1:9. A listener changes the expected result. The fixture uses an ephemeral closed local port.

    Follow the deployment guide for certificates, CA selection, working directories and the complete upstream workflow.

    Follow the HTTP guide and API reference. Keep the original filenames and the modules of the selected source variant. Save Arabic and English variants in separate directories. TLS inputs are supplied by the reader, with no bundled certificates or keys. No other data assets are required.

    Arabic source

    Native only · ASPL 0.7.0 · Arabic source

    Execution: Native only · ASPL 0.7.0

    Prerequisites:
    • Native only. Published ASPL 0.7.0 on x86-64 Linux with glibc 2.34 or later. No input lines. Requires no listener on 127.0.0.1:9. A listener changes the expected result. The fixture uses an ephemeral closed local port.

    Input: No input lines are required.

    استورد أساسي::ويب.
    دالة ابدأ_الرئيسية() -> ص64 {
        دع طلب_صادر = ويب::أنشئ_طلب("GET", "http://127.0.0.1:9/")::قيمة.
        دع رد = ويب::اطلب(طلب_صادر, ويب::خيارات_طلب()).
        إذا رد::نجاح { أرجع 1. }
        اطبع(رد::الخطأ::الرمز).
        إذا رد::الخطأ::الرمز ليس يطابق "http.connect_failed" { أرجع 2. }
        أرجع 0.
    }
    

    Follow the Linux instructions to run this example. Download the source to keep a copy.

    Download رفض.لبات

    Expected outcomes
    {
      "native": {
        "check": 0,
        "status": 0,
        "output": "http.connect_failed"
      }
    }

    English source

    Native only · ASPL 0.7.0 · English source

    Execution: Native only · ASPL 0.7.0

    Prerequisites:
    • Native only. Published ASPL 0.7.0 on x86-64 Linux with glibc 2.34 or later. No input lines. Requires no listener on 127.0.0.1:9. A listener changes the expected result. The fixture uses an ephemeral closed local port.

    Input: No input lines are required.

    import core::http;
    fn start_main() -> i64 {
        let outbound = http::client_request("GET", "http://127.0.0.1:9/")::value;
        let reply = http::request(outbound, http::client_options());
        if reply::ok { return 1; }
        print(reply::error::code);
        if reply::error::code not matches "http.connect_failed" { return 2; }
        return 0;
    }
    

    Follow the Linux instructions to run this example. Download the source to keep a copy.

    Download refusal.aspl

    Expected outcomes
    {
      "native": {
        "check": 0,
        "status": 0,
        "output": "http.connect_failed"
      }
    }

    Commands and outcomes

    ar:

    aspl check ar/refusal.aspl
    aspl run ar/refusal.aspl
    aspl build -o http-refusal-ar-program ar/refusal.aspl
    ./http-refusal-ar-program

    en:

    aspl check en/refusal.aspl
    aspl run en/refusal.aspl
    aspl build -o http-refusal-en-program en/refusal.aspl
    ./http-refusal-en-program

    Run these commands from the parent of the separate ar/en source directories. With the stated port closed, the program checks the failed result, prints http.connect_failed without a trailing newline and returns 0. It does not start a service. Expected outcome details above come from the catalog. See the HTTP collection.

    Historical normative scope

    • Historical specification, English source

      Historical MVP foreign-operation background only; native HTTP and explicit serving/state APIs are later extensions audited against published 0.7.0, not MVP requirements

    Browse pages