commit 98d91318c7ea8ef9b7e7f78749485a50f52a3bfb
parent 00c986a460d482a528b6067fb2ec5397e4af9aab
Author: Florian Dold <florian@dold.me>
Date: Thu, 3 Aug 2023 23:40:33 +0200
first set CURLOPT_HTTPGET
Diffstat:
1 file changed, 1 insertion(+), 0 deletions(-)
diff --git a/quickjs/quickjs-libc.c b/quickjs/quickjs-libc.c
@@ -2395,6 +2395,7 @@ static JSValue js_os_fetchHttp(JSContext *ctx, JSValueConst this_val,
req_context->headers = curl_slist_append (req_context->headers, "Accept: application/json");
}
} else if (0 == strcasecmp(method_str, "delete")) {
+ curl_easy_setopt(req_context->curl, CURLOPT_HTTPGET, 1L);
curl_easy_setopt(req_context->curl, CURLOPT_CUSTOMREQUEST, "DELETE");
} else if (0 == strcasecmp(method_str, "post")) {
JSValue data;