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

◆ fetch_http_options()

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

HTTP OPTIONS request.

Definition at line 265 of file fetch.cpp.

265 {
266 // Create a new request with OPTIONS method
267 fetch_options options_request(url, RequestOptions("OPTIONS"));
268
269 // Apply any additional options from the provided request
270 const auto& opts = request.options();
271 options_request.timeout(opts.timeout_ms);
272 for (const auto& header : opts.headers) {
273 options_request.header(header.first, header.second);
274 }
275 if (!opts.body.empty()) {
276 options_request.body(opts.body);
277 }
278
279 return execute_fetch_request(url, options_request);
280}
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: