31 lines
446 B
C
31 lines
446 B
C
/**
|
|
* HTTP client
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <stddef.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C"
|
|
{
|
|
#endif
|
|
|
|
typedef struct
|
|
{
|
|
char *url;
|
|
char *root_ca;
|
|
} http_request_opts;
|
|
|
|
/**
|
|
* Perform an HTTP request.
|
|
*
|
|
* Returns NULL in case of failure or the response else. The memory
|
|
* must be released by the caller.
|
|
*/
|
|
char *http_client_exec(const http_request_opts *opts);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|