Skip to main content

ClikaRT::http::DownloadOptions

struct

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; the ClikaRT/http/http.h umbrella pulls in both.)

Options for a download.

Data members

bearer_token

std::string_view bearer_token

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

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

progress

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

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

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

connect_timeout_sec

int connect_timeout_sec = 10

TCP connect budget, seconds.

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

read_timeout_sec

int read_timeout_sec = 30

socket read budget, seconds

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

follow_redirects

bool follow_redirects = true

follow 3xx automatically

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

resume

bool resume = false

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. Off (the default) truncates on open and removes the destination on failure.

Declared in ClikaRT/http/client.h, line 38