libfetch 0.0.0
A lightweight asynchronous HTTP/1.1 client library implementing a subset of the WHATWG Fetch API.
Loading...
Searching...
No Matches
Convenience Macros

Shortcuts for common operations. More...

Macros

#define FETCH_GET(url)
 Make a simple GET request (BLOCKING)
 
#define FETCH_ASYNC_GET(url)
 Make a simple async GET request (NON-BLOCKING)
 
#define FETCH_IS_OK(response)
 Check if response is successful.
 
#define FETCH_PROMISE_IS_DONE(promise)
 Check if promise is done (fulfilled or rejected)
 

Detailed Description

Shortcuts for common operations.

Macro Definition Documentation

◆ FETCH_ASYNC_GET

#define FETCH_ASYNC_GET ( url)
Value:
fetch_async(url, NULL)
fetch_promise_t * fetch_async(const char *url, fetch_init_t *init)
Make an asynchronous HTTP request (NON-BLOCKING)
Definition fetch.c:7764

Make a simple async GET request (NON-BLOCKING)

◆ FETCH_GET

#define FETCH_GET ( url)
Value:
fetch(url, NULL)
fetch_response_t * fetch(const char *url, fetch_init_t *init)
Make a synchronous HTTP request (BLOCKING)
Definition fetch.c:7835

Make a simple GET request (BLOCKING)

◆ FETCH_IS_OK

#define FETCH_IS_OK ( response)
Value:
((response) != NULL && fetch_response_ok(response))
bool fetch_response_ok(const fetch_response_t *response)
Check if response is successful (2xx status)
Definition fetch.c:8369

Check if response is successful.

◆ FETCH_PROMISE_IS_DONE

#define FETCH_PROMISE_IS_DONE ( promise)
Value:
((promise) != NULL && fetch_promise_poll(promise))
bool fetch_promise_poll(fetch_promise_t *promise)
Check if a promise has completed (NON-BLOCKING)
Definition fetch.c:7900

Check if promise is done (fulfilled or rejected)