27 lines
970 B
C
27 lines
970 B
C
|
|
// retoor <retoor@molodetz.nl>
|
||
|
|
|
||
|
|
#ifndef R_HTTP_CLIENT_H
|
||
|
|
#define R_HTTP_CLIENT_H
|
||
|
|
|
||
|
|
#include "r_error.h"
|
||
|
|
#include <stdbool.h>
|
||
|
|
|
||
|
|
typedef struct http_client_t *http_client_handle;
|
||
|
|
|
||
|
|
http_client_handle http_client_create(const char *bearer_token);
|
||
|
|
void http_client_destroy(http_client_handle client);
|
||
|
|
|
||
|
|
void http_client_set_show_spinner(http_client_handle client, bool show);
|
||
|
|
void http_client_set_timeout(http_client_handle client, long timeout_seconds);
|
||
|
|
void http_client_set_connect_timeout(http_client_handle client, long timeout_seconds);
|
||
|
|
|
||
|
|
r_status_t http_post(http_client_handle client, const char *url,
|
||
|
|
const char *data, char **response);
|
||
|
|
r_status_t http_get(http_client_handle client, const char *url, char **response);
|
||
|
|
|
||
|
|
r_status_t http_post_simple(const char *url, const char *bearer_token,
|
||
|
|
const char *data, char **response);
|
||
|
|
r_status_t http_get_simple(const char *url, const char *bearer_token, char **response);
|
||
|
|
|
||
|
|
#endif
|