Skip to content

Commit 42e8249

Browse files
committed
Add http_delete() to embedded async
1 parent bb8c2d5 commit 42e8249

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

R/aaa-async.R

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2679,6 +2679,24 @@ http_post <- function(url, data, headers = character(), file = NULL,
26792679

26802680
http_post <- mark_as_async(http_post)
26812681

2682+
http_delete <- function(url, headers = character(), file = NULL,
2683+
options = list()) {
2684+
url; headers; options;
2685+
2686+
make_deferred_http(
2687+
function() {
2688+
assert_that(is_string(url))
2689+
handle <- new_handle(url = url)
2690+
handle_setheaders(handle, .list = headers)
2691+
handle_setopt(handle, customrequest = "DELETE", .list = options)
2692+
list(handle = handle, options = options)
2693+
},
2694+
file
2695+
)
2696+
}
2697+
2698+
http_delete <- mark_as_async(http_delete)
2699+
26822700
#' @importFrom utils modifyList
26832701

26842702
get_default_curl_options <- function(options) {

0 commit comments

Comments
 (0)