public sendBinary(request as HttpRequest, maxBytes as Long = 16777216l) as HttpBinaryResponse
Sends a request without decoding the entity bytes as text. TLS, redirects, timeout and cancellation use the same transport as send. Bodies exceeding maxBytes are rejected with IOException. This API retains the bounded response in memory; use a streaming downloader for large files.
| Parameter | Description |
|---|---|
request | Immutable request (its optional body retains normal send semantics). |
maxBytes | Maximum response bytes, between 0 and 64 MiB. |
Status, headers and exact binary content.
response = HttpClient().sendBinary(HttpRequest(url), maxBytes=1048576l)