![]() |
Retro Rocket OS
BASIC-Powered Operating System
|
The HTTP library provides simple URL parsing helpers and minimal client-side HTTP request routines (HTTP/1.0 with Connection: close). Responses are stored in an internal buffer for later inspection.
The following publicly documented procedures and functions are available via this library.
Return the scheme (e.g. http, https, ws, wss, ftp) or an empty string if none.
Return the fragment (text after #) or an empty string if none.
Return the query string (text after ?, excluding #…) or an empty string if none.
Return the path component beginning with /. Returns / for bare hosts and an empty string if not applicable.
Return the host portion of the authority. Supports IPv4/hostnames and bracketed IPv6. Returns an empty string if not present.
Return the explicit port if present; otherwise the default for the scheme (http/ws=80, https/wss=443, ftp=21). Returns 0 if no scheme is recognised and no explicit port is present.
Look up a single query parameter value by name. Returns the value if present, an empty string if the key appears with no value, or an empty string if the key is absent.
Perform a GET request to url$. The full response (headers + body) is captured internally.
Perform a HEAD request. Only headers are expected; body may be empty.
Perform a POST with postdata$ as the raw request body. Content-Length is set automatically.
Perform a PUT with putdata$ as the raw request body.
Perform a PATCH with patchdata$ as the raw request body.
Perform a DELETE request.
Low-level entry point used by the above helpers. Builds the request line and minimal headers (Host, Connection: close, optional Content-Length) and sends the request over HTTP, or HTTPS when the scheme/port implies HTTPS. The full response is stored for later retrieval.
Return a specific portion of the most recent response. part$ must be one of:
If no response is available, or the requested part does not exist, an empty string is returned.
This performs a simple GET, prints the numeric status code, then prints the body.