Skip to content

Commit 574769f

Browse files
committed
Update to migrate doc
1 parent f36ad8e commit 574769f

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

MIGRATE-2-to-3.md

+13-11
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@
33
This is not an exhaustive list of changes. Most tweaks to the API are clear by looking
44
at the docs. If anything is unclear, please open a PR and we can clarify further.
55

6+
## Rewrite
7+
8+
ureq 3.x is a ground up complete rewrite of ureq 2.x. The HTTP protocol is re-engineered
9+
to a Sans-IO style implementation living in the `ureq-proto` crate. Both protocol and ureq
10+
main crate remain `#![forbid(unsafe_code)]`.
11+
12+
The goals of the project remain largely the same: A simple, sync, HTTP/1.1 client with
13+
a minimum number of dependencies.
14+
15+
With Sans-IO the user can now implement their own `Transport` thus providing alternative
16+
TLS or non-socket based communication in crates mainitained outside the ureq project. The
17+
same goes for `Resolver`.
18+
619
## HTTP Crate
720

821
In 2.x ureq implemented it's own `Request` and `Response` structs. In 3.x, we
@@ -11,15 +24,6 @@ API and can be found as a dependency of a number of big [http-related crates] in
1124
Rust ecosystem. The idea is that presenting a well-known API towards users of ureq
1225
will make it easier to use.
1326

14-
* .set -> .header
15-
16-
```
17-
// ureq2.x
18-
ureq::get("https://httpbin.org/get").set("foo", "bar").call();
19-
// ureq3.x
20-
ureq::get("https://httpbin.org/get").header("foo", "bar").call();
21-
```
22-
2327
## Re-exported crates must be semver 1.x (stable)
2428

2529
ureq2.x re-exported a number of semver 0.x crates and thus suffered from that breaking
@@ -32,8 +36,6 @@ major version). In ureq 3.x we will strive to re-export as few crates as possibl
3236

3337
Instead we made our own TLS config and Cookie API, and drop the json macro.
3438

35-
36-
3739
## No retry idempotent
3840

3941
ureq 2.x did an automatic retry of idempotent methods (GET, HEAD). This was considered

0 commit comments

Comments
 (0)