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.
Async Function GetTextAsync(url As String) As StringHttp.RequestAsync#
Return a JSON status/headers/body envelope. HTTP error statuses are data; transport failures are exceptions.
Async Function RequestAsync(method As String, url As String, headersJson As String, jsonBody As String, timeoutMilliseconds As Long) As StringHttp.CreateCancellationSource#
Create an owned cancellation source. Dispose it after the operation.
Function CreateCancellationSource() As CancellationSourceHttp.RequestWithCancellationAsync#
The same envelope, with explicit caller-controlled cancellation.
Async Function RequestWithCancellationAsync(method As String, url As String, headersJson As String, jsonBody As String, timeoutMilliseconds As Long, cancellation As CancellationSource) As StringHttp.StartDownload#
Start an owned file download. The destination directory must already exist.
Function StartDownload(url As String, destination As String, timeoutMilliseconds As Long, cancellation As CancellationSource, overwrite As Boolean) As HttpDownloadHttpDownload#
WaitAsync returns the saved byte count. TotalBytes may be unknown; do not invent a percentage.
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.
IsCancellationRequested, IsDisposed As Boolean (read only)
Sub Cancel()
Sub Dispose()20f4bfed6b · Build manifest