From ec07b0c59d0313faedd147d08a65ade0feaf88b9 Mon Sep 17 00:00:00 2001 From: default Date: Thu, 2 Feb 2023 03:37:17 +0100 Subject: Backport from xs. --- xs_curl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'xs_curl.h') diff --git a/xs_curl.h b/xs_curl.h index 45f3a91..2637c02 100644 --- a/xs_curl.h +++ b/xs_curl.h @@ -124,8 +124,8 @@ xs_dict *xs_http_request(char *method, char *url, xs_dict *headers, curl_easy_setopt(curl, CURLOPT_WRITEDATA, &ipd); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, _data_callback); - if (strcmp(method, "POST") == 0) { - curl_easy_setopt(curl, CURLOPT_POST, 1L); + if (strcmp(method, "POST") == 0 || strcmp(method, "PUT") == 0) { + curl_easy_setopt(curl, method[1] == 'O' ? CURLOPT_POST : CURLOPT_PUT, 1L); if (body != NULL) { if (b_size <= 0) -- cgit v1.2.3