commit 00c986a460d482a528b6067fb2ec5397e4af9aab
parent 7bcb5ff6405ee0c4054545cc3529b31a2380a0a2
Author: Florian Dold <florian@dold.me>
Date: Thu, 3 Aug 2023 23:33:22 +0200
support HTTP DELETE request
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/quickjs/quickjs-libc.c b/quickjs/quickjs-libc.c
@@ -2394,6 +2394,8 @@ static JSValue js_os_fetchHttp(JSContext *ctx, JSValueConst this_val,
if (!req_context->client_has_accept_header) {
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_CUSTOMREQUEST, "DELETE");
} else if (0 == strcasecmp(method_str, "post")) {
JSValue data;
uint8_t *data_ptr;