Skip to content

Commit cc22fbf

Browse files
committed
Update README
1 parent 499a317 commit cc22fbf

File tree

1 file changed

+30
-31
lines changed

1 file changed

+30
-31
lines changed

README.md

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ And see exactly what httr2 will send to the server with `req_dry_run()`:
7575
req %>% req_dry_run()
7676
#> GET / HTTP/1.1
7777
#> Host: r-project.org
78-
#> User-Agent: httr2/0.1.1 r-curl/4.3.2 libcurl/7.79.1
78+
#> User-Agent: httr2/0.2.1.9000 r-curl/4.3.2 libcurl/7.79.1
7979
#> Accept: */*
8080
#> Accept-Encoding: deflate, gzip
8181
```
@@ -89,7 +89,7 @@ resp
8989
#> GET https://www.r-project.org/
9090
#> Status: 200 OK
9191
#> Content-Type: text/html
92-
#> Body: In memory (6158 bytes)
92+
#> Body: In memory (6307 bytes)
9393
```
9494

9595
The `resp_` functions help you extract various useful components of the
@@ -109,35 +109,34 @@ resp %>% resp_body_html()
109109

110110
## Major differences to httr
111111

112-
- You can now create and modify a request without performing it. This
113-
means that there’s now a single function to perform the request and
114-
fetch the result: `req_perform()`. (If you want to handle the
115-
response as it streams in, use `req_stream()` instead).
116-
`req_perform()` replaces `httr::GET()`, `httr::POST()`,
117-
`httr::DELETE()`, and more.
118-
119-
- HTTP errors are automatically converted into R errors. Use
120-
`req_error()` to override the defaults (which turn all 4xx and 5xx
121-
responses into errors) or to add additional details to the error
122-
message.
123-
124-
- You can automatically retry if the request fails or encounters a
125-
transient HTTP error (e.g. a 429 rate limit request). `req_retry()`
126-
defines the maximum number of retries, which errors are transient,
127-
and how long to wait between tries.
128-
129-
- OAuth support has been totally overhauled to directly support many
130-
more flows and to make it much easier to both customise the built-in
131-
flows and to create your own.
132-
133-
- You can manage secrets (often needed for testing) with
134-
`secret_encrypt()` and friends. You can obfuscate mildly
135-
confidential data with `obfuscate()`, preventing it from being
136-
scraped from published code.
137-
138-
- You can automatically cache all cacheable results with
139-
`req_cache()`. Relatively few API responses are cacheable, but when
140-
they are it typically makes a big difference.
112+
- You can now create and modify a request without performing it. This
113+
means that there’s now a single function to perform the request and
114+
fetch the result: `req_perform()`. (If you want to handle the response
115+
as it streams in, use `req_stream()` instead). `req_perform()`
116+
replaces `httr::GET()`, `httr::POST()`, `httr::DELETE()`, and more.
117+
118+
- HTTP errors are automatically converted into R errors. Use
119+
`req_error()` to override the defaults (which turn all 4xx and 5xx
120+
responses into errors) or to add additional details to the error
121+
message.
122+
123+
- You can automatically retry if the request fails or encounters a
124+
transient HTTP error (e.g. a 429 rate limit request). `req_retry()`
125+
defines the maximum number of retries, which errors are transient, and
126+
how long to wait between tries.
127+
128+
- OAuth support has been totally overhauled to directly support many
129+
more flows and to make it much easier to both customise the built-in
130+
flows and to create your own.
131+
132+
- You can manage secrets (often needed for testing) with
133+
`secret_encrypt()` and friends. You can obfuscate mildly confidential
134+
data with `obfuscate()`, preventing it from being scraped from
135+
published code.
136+
137+
- You can automatically cache all cacheable results with `req_cache()`.
138+
Relatively few API responses are cacheable, but when they are it
139+
typically makes a big difference.
141140

142141
## Acknowledgements
143142

0 commit comments

Comments
 (0)