FastLED 3.9.15
Loading...
Searching...
No Matches

◆ fetch_head()

fl::promise< response > fl::fetch_head ( const fl::string & url,
const fetch_options & request )

HTTP HEAD request.

Definition at line 248 of file fetch.cpp.

248 {
249 // Create a new request with HEAD method
250 fetch_options head_request(url, RequestOptions("HEAD"));
251
252 // Apply any additional options from the provided request
253 const auto& opts = request.options();
254 head_request.timeout(opts.timeout_ms);
255 for (const auto& header : opts.headers) {
256 head_request.header(header.first, header.second);
257 }
258 if (!opts.body.empty()) {
259 head_request.body(opts.body);
260 }
261
262 return execute_fetch_request(url, head_request);
263}
const RequestOptions & options() const
Get the options for this request.
Definition fetch.h:241
Fetch options builder (fluent interface)
Definition fetch.h:200
fl::promise< response > execute_fetch_request(const fl::string &url, const fetch_options &request)
Internal helper to execute a fetch request and return a promise.
Definition fetch.cpp:72
Request options (matches JavaScript fetch RequestInit)
Definition fetch.h:189

References fl::fetch_options::body(), execute_fetch_request(), fl::fetch_options::header(), fl::fetch_options::options(), and fl::fetch_options::timeout().

+ Here is the call graph for this function: