Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export(curl_help)
export(curl_translate)
export(example_github_client)
export(example_url)
export(is_online)
export(iterate_with_cursor)
export(iterate_with_link_url)
export(iterate_with_offset)
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# httr2 (development version)

* Export `is_online()` as thin wrapper around `curl::has_internet()` (#512).
* `curl_translate()` now translates cookie headers to `req_cookies_set()` (#431).
* `curl_transform()` will now use `req_body_json_modify()` for JSON data (#258).
* `resp_stream_is_complete()` tells you if there is still data remaining to be streamed (#559).
Expand Down
11 changes: 11 additions & 0 deletions R/is-online.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#' Is your computer currently online?
#'
#' This function uses some cheap heuristics to determine if your computer is
#' currently online. It's a simple wrapper around [curl::has_internet()]
#' exported from httr2 for convenience.
#'
#' @export
#' is_online()
is_online <- function() {
curl::has_internet()

Check warning on line 10 in R/is-online.R

View check run for this annotation

Codecov / codecov/patch

R/is-online.R#L10

Added line #L10 was not covered by tests
}
166 changes: 83 additions & 83 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,90 +12,90 @@ development:
mode: auto

reference:
- title: Requests
subtitle: Create and modify
contents:
- request
- req_body
- req_cookie_preserve
- req_headers
- req_method
- req_options
- req_progress
- req_proxy
- req_template
- req_timeout
- req_url
- req_user_agent

- subtitle: Debugging/testing
contents:
- last_request
- req_dry_run
- req_verbose
- with_mock
- with_verbosity

- subtitle: Authentication
contents:
- starts_with("req_auth")
- starts_with("req_oauth")

- title: Perform a request
contents:
- req_perform
- req_perform_stream
- req_perform_connection
- req_perform_promise

- subtitle: Control the process
desc: >
These functions don't modify the HTTP request that is sent to the server,
but affect the overall process of `req_perform()`.
contents:
- req_cache
- req_error
- req_throttle
- req_retry

- title: Perform multiple requests
contents:
- req_perform_iterative
- req_perform_parallel
- req_perform_sequential
- starts_with("iterate_")
- starts_with("resps_")

- title: Handle the response
contents:
- starts_with("resp_")

- title: URL manipulation
contents:
- starts_with("url_")

- title: Miscellaenous helpers
contents:
- curl_translate
- secrets
- obfuscate

- title: OAuth
desc: >
These functions implement the low-level components of OAuth.
contents:
- starts_with("oauth_")
- -starts_with("req_oauth")
- title: Requests
subtitle: Create and modify
contents:
- request
- req_body
- req_cookie_preserve
- req_headers
- req_method
- req_options
- req_progress
- req_proxy
- req_template
- req_timeout
- req_url
- req_user_agent

- subtitle: Debugging/testing
contents:
- last_request
- req_dry_run
- req_verbose
- with_mock
- with_verbosity

- subtitle: Authentication
contents:
- starts_with("req_auth")
- starts_with("req_oauth")

- title: Perform a request
contents:
- req_perform
- req_perform_stream
- req_perform_connection
- req_perform_promise

- subtitle: Control the process
desc: >
These functions don't modify the HTTP request that is sent to the server,
but affect the overall process of `req_perform()`.
contents:
- req_cache
- req_error
- req_throttle
- req_retry

- title: Perform multiple requests
contents:
- req_perform_iterative
- req_perform_parallel
- req_perform_sequential
- starts_with("iterate_")
- starts_with("resps_")

- title: Handle the response
contents:
- starts_with("resp_")

- title: URL manipulation
contents:
- starts_with("url_")

- title: Miscellaenous helpers
contents:
- curl_translate
- is_online
- secrets
- obfuscate

- title: OAuth
desc: >
These functions implement the low-level components of OAuth.
contents:
- starts_with("oauth_")
- -starts_with("req_oauth")

articles:
- title: Using httr2
navbar: ~
contents:
- articles/wrapping-apis
- articles/oauth

- title: Using httr2
navbar: ~
contents:
- articles/wrapping-apis
- articles/oauth

news:
releases:
- text: "httr2 1.0.0"
href: https://www.tidyverse.org/blog/2023/11/httr2-1-0-0/
releases:
- text: "httr2 1.0.0"
href: https://www.tidyverse.org/blog/2023/11/httr2-1-0-0/
13 changes: 13 additions & 0 deletions man/is_online.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading