Skip to content

Commit

Permalink
Update to migrate doc
Browse files Browse the repository at this point in the history
  • Loading branch information
algesten committed Jan 26, 2025
1 parent f36ad8e commit 493e745
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions MIGRATE-2-to-3.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@
This is not an exhaustive list of changes. Most tweaks to the API are clear by looking
at the docs. If anything is unclear, please open a PR and we can clarify further.

## Rewrite

ureq 3.x is a ground up complete rewrite of ureq 2.x. The HTTP protocol is re-engineered
to a Sans-IO style implementation living in the `ureq-proto` crate. Both protocol and ureq
main crate remain `#![forbid(unsafe_code)]`.

The goals of the project remain largely the same: A simple, sync, HTTP/1.1 client with
a minimum number of dependencies.

With Sans-IO the user can now implement their own `Transport` thus providing alternative
TLS or non-socket based communication in crates mainitained outside the ureq project. The
same goes for `Resolver`.

## HTTP Crate

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

* .set -> .header

```
// ureq2.x
ureq::get("https://httpbin.org/get").set("foo", "bar").call();
// ureq3.x
ureq::get("https://httpbin.org/get").header("foo", "bar").call();
```

## Re-exported crates must be semver 1.x (stable)

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

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



## No retry idempotent

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

0 comments on commit 493e745

Please sign in to comment.