diff options
author | default <nobody@localhost> | 2023-02-02 03:49:38 +0100 |
---|---|---|
committer | default <nobody@localhost> | 2023-02-02 03:49:38 +0100 |
commit | 463439283a3f346a8869df6d17a70f20a0a02419 (patch) | |
tree | 8c9ec3c9c2552a8dab6ee55bceca9f5951ae8788 /xs_curl.h | |
parent | ec07b0c59d0313faedd147d08a65ade0feaf88b9 (diff) |
Minor header tweaks.
Diffstat (limited to 'xs_curl.h')
-rw-r--r-- | xs_curl.h | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -4,8 +4,9 @@ #define _XS_CURL_H -xs_dict *xs_http_request(char *method, char *url, xs_dict *headers, - xs_str *body, int b_size, int *status, +xs_dict *xs_http_request(const char *method, const char *url, + const xs_dict *headers, + const xs_str *body, int b_size, int *status, xs_str **payload, int *p_size, int timeout); #ifdef XS_IMPLEMENTATION @@ -83,8 +84,9 @@ static int _post_callback(char *buffer, size_t size, } -xs_dict *xs_http_request(char *method, char *url, xs_dict *headers, - xs_str *body, int b_size, int *status, +xs_dict *xs_http_request(const char *method, const char *url, + const xs_dict *headers, + const xs_str *body, int b_size, int *status, xs_str **payload, int *p_size, int timeout) /* does an HTTP request */ { @@ -136,7 +138,7 @@ xs_dict *xs_http_request(char *method, char *url, xs_dict *headers, sprintf(tmp, "content-length: %d", b_size); list = curl_slist_append(list, tmp); - pd.data = body; + pd.data = (char *)body; pd.size = b_size; pd.offset = 0; @@ -146,7 +148,7 @@ xs_dict *xs_http_request(char *method, char *url, xs_dict *headers, } /* fill the request headers */ - p = headers; + p = (xs_dict *)headers; while (xs_dict_iter(&p, &k, &v)) { xs *h = xs_fmt("%s: %s", k, v); |