Skip to content

Commit

Permalink
Update to dev pkgsearch again
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborcsardi committed Sep 24, 2024
1 parent edf766a commit 78e40fa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/library/pkgsearch/DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1.9000
NeedsCompilation: no
Packaged: 2024-09-24 07:38:50 UTC; gaborcsardi
Packaged: 2024-09-24 07:46:37 UTC; gaborcsardi
Author: Gábor Csárdi [aut, cre],
Maëlle Salmon [aut] (<https://orcid.org/0000-0002-2815-0399>),
R Consortium [fnd]
Expand Down
8 changes: 6 additions & 2 deletions src/library/pkgsearch/R/http.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,18 @@ get_default_curl_options <- function(options) {
)
}

http_get <- function(url) {
curl::curl_fetch_memory(url)
http_get <- function(url, options = list()) {
handle <- curl::new_handle(url = url)
options <- get_default_curl_options(options)
curl::handle_setopt(handle, .list = options)
curl::curl_fetch_memory(url, handle = handle)
}

http_post <- function(url, body, headers = character(), options = list()) {
if (!is.raw(body)) body <- charToRaw(body)
handle <- curl::new_handle(url = url)
curl::handle_setheaders(handle, .list = headers)
options <- get_default_curl_options(options)
curl::handle_setopt(
handle,
customrequest = "POST",
Expand Down

0 comments on commit 78e40fa

Please sign in to comment.