MCPcopy Create free account
hub / github.com/FastLED/FastLED / fetch_get

Function fetch_get

src/fl/net/http/fetch.cpp.hpp:510–525  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

508// ========== Public API Functions ==========
509
510fl::task::Promise<Response> fetch_get(const fl::string& url, const FetchOptions& request) {
511 // Create a new request with GET method
512 FetchOptions get_request(url, RequestOptions("GET"));
513
514 // Apply any additional options from the provided request
515 const auto& opts = request.options();
516 get_request.timeout(opts.timeout_ms);
517 for (const auto& header : opts.headers) {
518 get_request.header(header.first, header.second);
519 }
520 if (!opts.body.empty()) {
521 get_request.body(opts.body);
522 }
523
524 return execute_fetch_request(url, get_request);
525}
526
527fl::task::Promise<Response> fetch_post(const fl::string& url, const FetchOptions& request) {
528 // Create a new request with POST method

Callers 9

mainFunction · 0.85
runTestMethod · 0.85
test_json_endpointFunction · 0.85
test_get_endpointFunction · 0.85
test_ping_endpointFunction · 0.85
test_promise_approachFunction · 0.85
test_await_approachFunction · 0.85
test_json_responseFunction · 0.85
test_json_awaitFunction · 0.85

Calls 4

RequestOptionsClass · 0.85
execute_fetch_requestFunction · 0.85
headerMethod · 0.80
emptyMethod · 0.45

Tested by 8

runTestMethod · 0.68
test_json_endpointFunction · 0.68
test_get_endpointFunction · 0.68
test_ping_endpointFunction · 0.68
test_promise_approachFunction · 0.68
test_await_approachFunction · 0.68
test_json_responseFunction · 0.68
test_json_awaitFunction · 0.68