http_get
result = http_get(url)
Input: url · Output: result
What it is
url (string, must include the scheme, e.g. "https://example.com/") is the address to fetch. Issues an HTTP(S) GET request and returns the response body as a string (UTF-8, decoded lossily — the same convention read_all_text/text-mode read_all already use). GET-only in this v1: no custom headers, auth, or POST. A 30-second timeout applies to the whole request (connect + read) — an unreachable host errors clearly rather than hanging forever. A non-2xx response is a clear error naming the actual status code.
Overloads
One call shape — this function is not overloaded.
| Code | Input | Output | Description |
result = http_get(url) | url stringnot documented yet | result Str | Returns a Str: the response body. No status code and no headers come back with it — a call that returns at all succeeded, and everything else raised. |
Examples
From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.
body = http_get("https://example.com/")
print(length(body)) # e.g. 559 -- byte length of the fetched page
559
from concurrency
body = http_get("https://example.com/")
print("len = {length(body)}")
from tour
How it works
that module's own doc comment for the return shape (always Value::Str), timeout (fixed 30s), and error conventions. StreamURL(url) (§ StreamFile/StreamURL polymorphic streams, 2026-08-31) — see net_ops::stream_url's own doc comment.
From the note above this builtin in the interpreter, where the reasoning was written down as it was built.