commit d030697
default
·
2023-03-03 21:40:37 +0000 UTC
parent 45f4902
Changed the way the content-length is set.
1 files changed,
+1,
-3
+1,
-3
1@@ -134,9 +134,7 @@ xs_dict *xs_http_request(const char *method, const char *url,
2 b_size = xs_size(body);
3
4 /* add the content-length header */
5- char tmp[32];
6- sprintf(tmp, "content-length: %d", b_size);
7- list = curl_slist_append(list, tmp);
8+ curl_easy_setopt(curl, CURLOPT_INFILESIZE, b_size);
9
10 pd.data = (char *)body;
11 pd.size = b_size;