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

◆ fetch_http_options()

fl::task::Promise< Response > fl::net::http::fetch_http_options ( const fl::string & url,
const FetchOptions & request )

HTTP OPTIONS request.

Definition at line 595 of file fetch.cpp.hpp.

595 {
596 // Create a new request with OPTIONS method
597 FetchOptions options_request(url, RequestOptions("OPTIONS"));
598
599 // Apply any additional options from the provided request
600 const auto& opts = request.options();
601 options_request.timeout(opts.timeout_ms);
602 for (const auto& header : opts.headers) {
603 options_request.header(header.first, header.second);
604 }
605 if (!opts.body.empty()) {
606 options_request.body(opts.body);
607 }
608
609 return execute_fetch_request(url, options_request);
610}
const RequestOptions & options() const
Get the options for this request.
Definition fetch.h:236
Fetch options builder (fluent interface)
Definition fetch.h:195
Definition url.h:15
fl::task::Promise< Response > execute_fetch_request(const fl::string &url, const FetchOptions &request)
Internal helper to execute a fetch request and return a promise.
Request options (matches JavaScript fetch RequestInit)
Definition fetch.h:184

References fl::net::http::FetchOptions::body(), execute_fetch_request(), fl::net::http::FetchOptions::header(), fl::net::http::FetchOptions::options(), and fl::net::http::FetchOptions::timeout().

+ Here is the call graph for this function: