From 853acc36ddc628e35df572550fe14bf3c8a1f126 Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Wed, 8 Jan 2025 16:30:08 -0600 Subject: [PATCH] `devtools::build_readme()` --- README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 8ed98d01..475b6593 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ req |> req_headers("Accept" = "application/json") #> #> GET https://r-project.org #> Headers: -#> • Accept: 'application/json' +#> • Accept: "application/json" #> Body: empty # Add a body, turning it into a POST @@ -69,6 +69,9 @@ req |> req_retry(max_tries = 5) #> Policies: #> • retry_max_tries: 5 #> • retry_on_failure: FALSE +#> • retry_failure_threshold: Inf +#> • retry_failure_timeout: 30 +#> • retry_realm: "r-project.org" # Change the HTTP method req |> req_method("PATCH") @@ -83,9 +86,9 @@ And see exactly what httr2 will send to the server with `req_dry_run()`: req |> req_dry_run() #> GET / HTTP/1.1 #> Host: r-project.org -#> User-Agent: httr2/1.0.3.9000 r-curl/5.2.2 libcurl/8.6.0 +#> User-Agent: httr2/1.0.7.9000 r-curl/6.1.0 libcurl/8.7.1 #> Accept: */* -#> Accept-Encoding: deflate, gzip +#> Accept-Encoding: gzip ``` Use `req_perform()` to perform the request, retrieving a **response**: @@ -97,7 +100,7 @@ resp #> GET https://www.r-project.org/ #> Status: 200 OK #> Content-Type: text/html -#> Body: In memory (6951 bytes) +#> Body: In memory (6774 bytes) ``` The `resp_` functions help you extract various useful components of the @@ -147,8 +150,7 @@ resp |> resp_body_html() ## Acknowledgements -httr2 wouldn’t be possible without -[curl](https://cran.dev/curl/), +httr2 wouldn’t be possible without [curl](https://cran.dev/curl/), [openssl](https://cran.dev/openssl/), [jsonlite](https://cran.dev/jsonlite/), and [jose](https://github.com/r-lib/jose/), which are all maintained by