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

◆ fetch_patch()

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

HTTP PATCH request.

Definition at line 282 of file fetch.cpp.

282 {
283 // Create a new request with PATCH method
284 fetch_options patch_request(url, RequestOptions("PATCH"));
285
286 // Apply any additional options from the provided request
287 const auto& opts = request.options();
288 patch_request.timeout(opts.timeout_ms);
289 for (const auto& header : opts.headers) {
290 patch_request.header(header.first, header.second);
291 }
292 if (!opts.body.empty()) {
293 patch_request.body(opts.body);
294 }
295
296 return execute_fetch_request(url, patch_request);
297}
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: