From d0306975c5acb0263816b8ef3f453bb5770d376f Mon Sep 17 00:00:00 2001 From: default Date: Fri, 3 Mar 2023 22:40:37 +0100 Subject: [PATCH] Changed the way the content-length is set. --- xs_curl.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/xs_curl.h b/xs_curl.h index 1ac0e13..3291499 100644 --- a/xs_curl.h +++ b/xs_curl.h @@ -134,9 +134,7 @@ xs_dict *xs_http_request(const char *method, const char *url, b_size = xs_size(body); /* add the content-length header */ - char tmp[32]; - sprintf(tmp, "content-length: %d", b_size); - list = curl_slist_append(list, tmp); + curl_easy_setopt(curl, CURLOPT_INFILESIZE, b_size); pd.data = (char *)body; pd.size = b_size;