---
title: "ClikaRT::http::DownloadOptions"
sidebar_label: "DownloadOptions"
description: "Options for a download."
---

<!-- Generated by tools/doxygen2mdx from Doxygen XML. Do not edit. -->

<span class="api-kind api-kind--struct">struct</span>

**Header:** `ClikaRT/http/client.h`

The HTTP / HTTPS CLIENT side: fetch a URL to a file, into memory (text or bytes), POST a small body, or DELETE a resource. (The server side is [`ClikaRT/http/server.h`](./index.md#server-h); the [`ClikaRT/http/http.h`](../../index.md#http-h) umbrella pulls in both.)

Options for a download.

## Data members

### bearer\_token {#bearer_token}

<div class="api-signature">

`std::string_view` **`bearer_token`**

</div>

Bearer token for `Authorization: Bearer <token>`. Empty = no auth. Never logged. A non-owning view; keep its backing alive for the call.

<div class="api-declared">

Declared in `ClikaRT/http/client.h`, line 26

</div>

### progress {#progress}

<div class="api-signature">

`std::function<bool(std::uint64_t done, std::uint64_t total)>` **`progress`**

</div>

Progress callback `(bytes_done, bytes_total)`; `bytes_total` is 0 when the server does not report a length. Return `false` to cancel the transfer.

<div class="api-declared">

Declared in `ClikaRT/http/client.h`, line 29

</div>

### connect\_timeout\_sec {#connect_timeout_sec}

<div class="api-signature">

`int` **`connect_timeout_sec`** `= 10`

</div>

TCP connect budget, seconds.

<div class="api-declared">

Declared in `ClikaRT/http/client.h`, line 30

</div>

### read\_timeout\_sec {#read_timeout_sec}

<div class="api-signature">

`int` **`read_timeout_sec`** `= 30`

</div>

socket read budget, seconds

<div class="api-declared">

Declared in `ClikaRT/http/client.h`, line 31

</div>

### follow\_redirects {#follow_redirects}

<div class="api-signature">

`bool` **`follow_redirects`** `= true`

</div>

follow 3xx automatically

<div class="api-declared">

Declared in `ClikaRT/http/client.h`, line 32

</div>

### resume {#resume}

<div class="api-signature">

`bool` **`resume`** `= false`

</div>

[`download_file`](./index.md#download_file) only: continue an existing partial destination with a ranged GET (append on 206; a server that ignores the range restarts the file cleanly), and keep the partial on disk when the attempt fails so a later call resumes it. A 206 whose Content-Range does not start where the partial ends fails the download and leaves the partial untouched. Off (the default) truncates on open and removes the destination on failure.

<div class="api-declared">

Declared in `ClikaRT/http/client.h`, line 39

</div>
