Helper functions for common operations.
More...
Helper functions for common operations.
◆ fetch_error_to_string()
Convert error code to human-readable string.
- Parameters
-
- Returns
- Error description string (static, do not free)
- Note
- Memory: Returned string is static, do not free
}
fetch_error_t
Error codes for fetch operations.
Definition fetch.h:341
fetch_error_t fetch_promise_error(const fetch_promise_t *promise)
Get the error code from a rejected promise.
Definition fetch.c:8008
bool fetch_promise_rejected(const fetch_promise_t *promise)
Check if promise was rejected.
Definition fetch.c:8024
const char * fetch_error_to_string(fetch_error_t error)
Convert error code to human-readable string.
Definition fetch.c:9114
◆ fetch_is_valid_url()
bool fetch_is_valid_url |
( |
const char * | url | ) |
|
Check if a URL is valid.
- Parameters
-
url | URL string to validate |
- Returns
- true if URL is valid
}
bool fetch_is_valid_url(const char *url)
Check if a URL is valid.
Definition fetch.c:9103
◆ fetch_method_from_string()
http_method_t fetch_method_from_string |
( |
const char * | method_str | ) |
|
Convert string to HTTP method enum.
- Parameters
-
method_str | Method name string (case-insensitive) |
- Returns
- HTTP method enum (defaults to GET for invalid input)
http_method_t
HTTP request methods.
Definition fetch.h:229
http_method_t fetch_method_from_string(const char *method_str)
Convert string to HTTP method enum.
Definition fetch.c:9077
◆ fetch_method_to_string()
Convert HTTP method enum to string.
- Parameters
-
- Returns
- Method name string (static, do not free)
- Note
- Memory: Returned string is static, do not free
@ HTTP_METHOD_POST
Definition fetch.h:232
const char * fetch_method_to_string(http_method_t method)
Convert HTTP method enum to string.
Definition fetch.c:9052