McBasic™Get McBasic™ ↗
Build 881
Runtime API

HTTP and downloads

Separate transport failure, HTTP status and response-body validation. Async functions require Await from an Async procedure.

Read the task-based guide before using an isolated signature. Arguments are positional unless a signature explicitly marks an optional argument.

Http.GetTextAsync#

Request text; failed HTTP transport/status raises a runtime exception.

BASIC-facing contract
Async Function GetTextAsync(url As String) As String

Http.RequestAsync#

Return a JSON status/headers/body envelope. HTTP error statuses are data; transport failures are exceptions.

BASIC-facing contract
Async Function RequestAsync(method As String, url As String, headersJson As String, jsonBody As String, timeoutMilliseconds As Long) As String

Http.CreateCancellationSource#

Create an owned cancellation source. Dispose it after the operation.

BASIC-facing contract
Function CreateCancellationSource() As CancellationSource

Http.RequestWithCancellationAsync#

The same envelope, with explicit caller-controlled cancellation.

BASIC-facing contract
Async Function RequestWithCancellationAsync(method As String, url As String, headersJson As String, jsonBody As String, timeoutMilliseconds As Long, cancellation As CancellationSource) As String

Http.StartDownload#

Start an owned file download. The destination directory must already exist.

BASIC-facing contract
Function StartDownload(url As String, destination As String, timeoutMilliseconds As Long, cancellation As CancellationSource, overwrite As Boolean) As HttpDownload

HttpDownload#

WaitAsync returns the saved byte count. TotalBytes may be unknown; do not invent a percentage.

BASIC-facing contract
BytesReceived, TotalBytes As LongLong (read only)
StatusCode As Long (read only)
IsCompleted As Boolean (read only)
Async Function WaitAsync() As LongLong
Sub Cancel()
Sub Dispose()

CancellationSource#

Cancellation requests stop work cooperatively; cleanup is still required.

BASIC-facing contract
IsCancellationRequested, IsDisposed As Boolean (read only)
Sub Cancel()
Sub Dispose()
Source baseline 20f4bfed6b · Build manifest