Skip to content

Commit 60ba916

Browse files
committed
Fix links in README.md
1 parent a9ef156 commit 60ba916

File tree

2 files changed

+68
-32
lines changed

2 files changed

+68
-32
lines changed

README.md

+34-16
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ let body: String = ureq::get("http://example.com")
4848
.read_to_string()?;
4949
```
5050

51-
For more involved tasks, you'll want to create an [Agent]. An Agent
51+
For more involved tasks, you'll want to create an [`Agent`]. An Agent
5252
holds a connection pool for reuse, and a cookie store if you use the
5353
**cookies** feature. An Agent can be cheaply cloned due to internal
54-
[Arc](std::sync::Arc) and all clones of an Agent share state among each other. Creating
54+
[`Arc`] and all clones of an Agent share state among each other. Creating
5555
an Agent also allows setting options like the TLS configuration.
5656

5757
```rust
@@ -108,10 +108,9 @@ let recv_body = ureq::post("http://example.com/post/ingest")
108108

109109
ureq returns errors via `Result<T, ureq::Error>`. That includes I/O errors,
110110
protocol errors. By default, also HTTP status code errors (when the
111-
server responded 4xx or 5xx) results in `Error`.
111+
server responded 4xx or 5xx) results in [`Error`].
112112

113-
This behavior can be turned off via
114-
[`http_status_as_error()`][crate::config::ConfigBuilder::http_status_as_error].
113+
This behavior can be turned off via [`http_status_as_error()`]
115114

116115
```rust
117116
use ureq::Error;
@@ -200,13 +199,11 @@ agent.get("https://www.google.com/").call().unwrap();
200199
By default, ureq uses Mozilla's root certificates via the [webpki-roots] crate. This is a static
201200
bundle of root certificates that do not update automatically. It also circumvents whatever root
202201
certificates are installed on the host running ureq, which might be a good or a bad thing depending
203-
on your perspective. There is also no mechanism for
204-
[SCT](https://en.wikipedia.org/wiki/Certificate_Transparency),
205-
[CRLs](https://en.wikipedia.org/wiki/Certificate_revocation_list) or other revocations.
202+
on your perspective. There is also no mechanism for [SCT], [CRL]s or other revocations.
206203
To maintain a "fresh" list of root certs, you need to bump the ureq dependency from time to time.
207204

208205
The main reason for chosing this as the default is to minimize the number of dependencies. More
209-
details about this decision can be found at [PR 818](https://github.com/algesten/ureq/pull/818)
206+
details about this decision can be found at [PR 818].
210207

211208
If your use case for ureq is talking to a limited number of servers with high trust, the
212209
default setting is likely sufficient. If you use ureq with a high number of servers, or servers
@@ -244,8 +241,8 @@ By enabling the **json** feature, the library supports serde json.
244241

245242
This is enabled by default.
246243

247-
* [`request.send_json()`][RequestBuilder::send_json()] send body as json.
248-
* [`body.read_json()`][Body::read_json()] transform response to json.
244+
* [`request.send_json()`] send body as json.
245+
* [`body.read_json()`] transform response to json.
249246

250247
## Sending body data
251248

@@ -270,7 +267,7 @@ known size, in other words, if the body to send is one of:
270267
* `&String`
271268
* `Vec<u8>`
272269
* `&Vec<u8>)`
273-
* [`SendBody::from_json()`] (implicitly via [`RequestBuilder::send_json()`])
270+
* [`SendBody::from_json()`] (implicitly via [`request.send_json()`])
274271

275272
### Transfer-Encoding: chunked
276273

@@ -304,7 +301,7 @@ the `chunked` method.
304301

305302
### Sending form data
306303

307-
[`RequestBuilder::send_form()`] provides a way to send `application/x-www-form-urlencoded`
304+
[`request.send_form()`] provides a way to send `application/x-www-form-urlencoded`
308305
encoded data. The key/values provided will be URL encoded.
309306

310307
### Overriding
@@ -351,7 +348,7 @@ ureq supports two kinds of proxies, [`HTTP`] ([`CONNECT`]), [`SOCKS4`]/[`SOCKS5
351348
the former is always available while the latter must be enabled using the feature
352349
**socks-proxy**.
353350

354-
Proxies settings are configured on an [Agent]. All request sent through the agent will be proxied.
351+
Proxies settings are configured on an [`Agent`]. All request sent through the agent will be proxied.
355352

356353
### Example using HTTP
357354

@@ -391,8 +388,7 @@ ureq follows semver. From ureq 3.x we strive to have a much closer adherence to
391388
The main mistake in 2.x was to re-export crates that were not yet semver 1.0. In ureq 3.x TLS and
392389
cookie configuration is shimmed using our own types.
393390

394-
ureq 3.x is trying out two new traits that had no equivalent in 2.x,
395-
[`Transport`][unversioned::transport::Transport] and [`Resolver`][unversioned::resolver::Resolver].
391+
ureq 3.x is trying out two new traits that had no equivalent in 2.x, [`Transport`] and [`Resolver`].
396392
These allow the user write their own bespoke transports and (DNS name) resolver. The API:s for
397393
these parts are not yet solidified. They live under the [`unversioned`] module, and do not
398394
follow semver. See module doc for more info.
@@ -418,3 +414,25 @@ something we do lightly; our ambition is to be as conservative with MSRV as poss
418414
[`native-tls`]: https://crates.io/crates/native-tls
419415
[rustls-platform-verifier]: https://crates.io/crates/rustls-platform-verifier
420416
[webpki-roots]: https://crates.io/crates/webpki-roots
417+
[`Arc`]: https://doc.rust-lang.org/std/sync/struct.Arc.html
418+
[`Agent`]: https://docs.rs/ureq/3.0.0-rc4/ureq/struct.Agent.html
419+
[`Error`]: https://docs.rs/ureq/3.0.0-rc4/ureq/enum.Error.html
420+
[`http_status_as_error()`]: https://docs.rs/ureq/3.0.0-rc4/ureq/config/struct.ConfigBuilder.html#method.http_status_as_error
421+
[SCT]: https://en.wikipedia.org/wiki/Certificate_Transparency
422+
[CRL]: https://en.wikipedia.org/wiki/Certificate_revocation_list
423+
[PR818]: https://github.com/algesten/ureq/pull/818
424+
[`request.send_json()`]: https://docs.rs/ureq/3.0.0-rc4/ureq/struct.RequestBuilder.html#method.send_json
425+
[`body.read_json()`]: https://docs.rs/ureq/3.0.0-rc4/ureq/struct.Body.html#method.read_json
426+
[`AsSendBody`]: https://docs.rs/ureq/3.0.0-rc4/ureq/trait.AsSendBody.html
427+
[`SendBody::from_json()`]: https://docs.rs/ureq/3.0.0-rc4/ureq/struct.SendBody.html#method.from_json
428+
[`std::io::Read`]: https://doc.rust-lang.org/std/io/trait.Read.html
429+
[`SendBody::from_reader()`]: https://docs.rs/ureq/3.0.0-rc4/ureq/struct.SendBody.html#method.from_reader
430+
[`SendBody::from_owned_reader()`]: https://docs.rs/ureq/3.0.0-rc4/ureq/struct.SendBody.html#method.from_owned_reader
431+
[`Body`]: https://docs.rs/ureq/3.0.0-rc4/ureq/struct.Body.html
432+
[`request.send_form()`]: https://docs.rs/ureq/3.0.0-rc4/ureq/struct.RequestBuilder.html#method.send_form
433+
[`Body::read_to_string()`]: https://docs.rs/ureq/3.0.0-rc4/ureq/struct.Body.html#method.read_to_string
434+
[`Body::as_reader()`]: https://docs.rs/ureq/3.0.0-rc4/ureq/struct.Body.html#method.as_reader
435+
[`Body::with_config()`]: https://docs.rs/ureq/3.0.0-rc4/ureq/struct.Body.html#method.with_config
436+
[`Transport`]: https://docs.rs/ureq/3.0.0-rc4/ureq/unversioned/transport/trait.Transport.html
437+
[`Resolver`]: https://docs.rs/ureq/3.0.0-rc4/ureq/unversioned/resolver/trait.Resolver.html
438+
[`unversioned`]: https://docs.rs/ureq/3.0.0-rc4/ureq/unversioned/index.html

src/lib.rs

+34-16
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@
4545
//! # Ok::<(), ureq::Error>(())
4646
//! ```
4747
//!
48-
//! For more involved tasks, you'll want to create an [Agent]. An Agent
48+
//! For more involved tasks, you'll want to create an [`Agent`]. An Agent
4949
//! holds a connection pool for reuse, and a cookie store if you use the
5050
//! **cookies** feature. An Agent can be cheaply cloned due to internal
51-
//! [Arc](std::sync::Arc) and all clones of an Agent share state among each other. Creating
51+
//! [`Arc`] and all clones of an Agent share state among each other. Creating
5252
//! an Agent also allows setting options like the TLS configuration.
5353
//!
5454
//! ```rust
@@ -110,10 +110,9 @@
110110
//!
111111
//! ureq returns errors via `Result<T, ureq::Error>`. That includes I/O errors,
112112
//! protocol errors. By default, also HTTP status code errors (when the
113-
//! server responded 4xx or 5xx) results in `Error`.
113+
//! server responded 4xx or 5xx) results in [`Error`].
114114
//!
115-
//! This behavior can be turned off via
116-
//! [`http_status_as_error()`][crate::config::ConfigBuilder::http_status_as_error].
115+
//! This behavior can be turned off via [`http_status_as_error()`]
117116
//!
118117
//! ```rust
119118
//! use ureq::Error;
@@ -210,13 +209,11 @@
210209
//! By default, ureq uses Mozilla's root certificates via the [webpki-roots] crate. This is a static
211210
//! bundle of root certificates that do not update automatically. It also circumvents whatever root
212211
//! certificates are installed on the host running ureq, which might be a good or a bad thing depending
213-
//! on your perspective. There is also no mechanism for
214-
//! [SCT](https://en.wikipedia.org/wiki/Certificate_Transparency),
215-
//! [CRLs](https://en.wikipedia.org/wiki/Certificate_revocation_list) or other revocations.
212+
//! on your perspective. There is also no mechanism for [SCT], [CRL]s or other revocations.
216213
//! To maintain a "fresh" list of root certs, you need to bump the ureq dependency from time to time.
217214
//!
218215
//! The main reason for chosing this as the default is to minimize the number of dependencies. More
219-
//! details about this decision can be found at [PR 818](https://github.com/algesten/ureq/pull/818)
216+
//! details about this decision can be found at [PR 818].
220217
//!
221218
//! If your use case for ureq is talking to a limited number of servers with high trust, the
222219
//! default setting is likely sufficient. If you use ureq with a high number of servers, or servers
@@ -257,8 +254,8 @@
257254
//!
258255
//! This is enabled by default.
259256
//!
260-
//! * [`request.send_json()`][RequestBuilder::send_json()] send body as json.
261-
//! * [`body.read_json()`][Body::read_json()] transform response to json.
257+
//! * [`request.send_json()`] send body as json.
258+
//! * [`body.read_json()`] transform response to json.
262259
//!
263260
//! # Sending body data
264261
//!
@@ -283,7 +280,7 @@
283280
//! * `&String`
284281
//! * `Vec<u8>`
285282
//! * `&Vec<u8>)`
286-
//! * [`SendBody::from_json()`] (implicitly via [`RequestBuilder::send_json()`])
283+
//! * [`SendBody::from_json()`] (implicitly via [`request.send_json()`])
287284
//!
288285
//! ## Transfer-Encoding: chunked
289286
//!
@@ -317,7 +314,7 @@
317314
//!
318315
//! ## Sending form data
319316
//!
320-
//! [`RequestBuilder::send_form()`] provides a way to send `application/x-www-form-urlencoded`
317+
//! [`request.send_form()`] provides a way to send `application/x-www-form-urlencoded`
321318
//! encoded data. The key/values provided will be URL encoded.
322319
//!
323320
//! ## Overriding
@@ -365,7 +362,7 @@
365362
//! the former is always available while the latter must be enabled using the feature
366363
//! **socks-proxy**.
367364
//!
368-
//! Proxies settings are configured on an [Agent]. All request sent through the agent will be proxied.
365+
//! Proxies settings are configured on an [`Agent`]. All request sent through the agent will be proxied.
369366
//!
370367
//! ## Example using HTTP
371368
//!
@@ -411,8 +408,7 @@
411408
//! The main mistake in 2.x was to re-export crates that were not yet semver 1.0. In ureq 3.x TLS and
412409
//! cookie configuration is shimmed using our own types.
413410
//!
414-
//! ureq 3.x is trying out two new traits that had no equivalent in 2.x,
415-
//! [`Transport`][unversioned::transport::Transport] and [`Resolver`][unversioned::resolver::Resolver].
411+
//! ureq 3.x is trying out two new traits that had no equivalent in 2.x, [`Transport`] and [`Resolver`].
416412
//! These allow the user write their own bespoke transports and (DNS name) resolver. The API:s for
417413
//! these parts are not yet solidified. They live under the [`unversioned`] module, and do not
418414
//! follow semver. See module doc for more info.
@@ -438,6 +434,28 @@
438434
//! [`native-tls`]: https://crates.io/crates/native-tls
439435
//! [rustls-platform-verifier]: https://crates.io/crates/rustls-platform-verifier
440436
//! [webpki-roots]: https://crates.io/crates/webpki-roots
437+
//! [`Arc`]: https://doc.rust-lang.org/std/sync/struct.Arc.html
438+
//! [`Agent`]: https://docs.rs/ureq/3.0.0-rc4/ureq/struct.Agent.html
439+
//! [`Error`]: https://docs.rs/ureq/3.0.0-rc4/ureq/enum.Error.html
440+
//! [`http_status_as_error()`]: https://docs.rs/ureq/3.0.0-rc4/ureq/config/struct.ConfigBuilder.html#method.http_status_as_error
441+
//! [SCT]: https://en.wikipedia.org/wiki/Certificate_Transparency
442+
//! [CRL]: https://en.wikipedia.org/wiki/Certificate_revocation_list
443+
//! [PR818]: https://github.com/algesten/ureq/pull/818
444+
//! [`request.send_json()`]: https://docs.rs/ureq/3.0.0-rc4/ureq/struct.RequestBuilder.html#method.send_json
445+
//! [`body.read_json()`]: https://docs.rs/ureq/3.0.0-rc4/ureq/struct.Body.html#method.read_json
446+
//! [`AsSendBody`]: https://docs.rs/ureq/3.0.0-rc4/ureq/trait.AsSendBody.html
447+
//! [`SendBody::from_json()`]: https://docs.rs/ureq/3.0.0-rc4/ureq/struct.SendBody.html#method.from_json
448+
//! [`std::io::Read`]: https://doc.rust-lang.org/std/io/trait.Read.html
449+
//! [`SendBody::from_reader()`]: https://docs.rs/ureq/3.0.0-rc4/ureq/struct.SendBody.html#method.from_reader
450+
//! [`SendBody::from_owned_reader()`]: https://docs.rs/ureq/3.0.0-rc4/ureq/struct.SendBody.html#method.from_owned_reader
451+
//! [`Body`]: https://docs.rs/ureq/3.0.0-rc4/ureq/struct.Body.html
452+
//! [`request.send_form()`]: https://docs.rs/ureq/3.0.0-rc4/ureq/struct.RequestBuilder.html#method.send_form
453+
//! [`Body::read_to_string()`]: https://docs.rs/ureq/3.0.0-rc4/ureq/struct.Body.html#method.read_to_string
454+
//! [`Body::as_reader()`]: https://docs.rs/ureq/3.0.0-rc4/ureq/struct.Body.html#method.as_reader
455+
//! [`Body::with_config()`]: https://docs.rs/ureq/3.0.0-rc4/ureq/struct.Body.html#method.with_config
456+
//! [`Transport`]: https://docs.rs/ureq/3.0.0-rc4/ureq/unversioned/transport/trait.Transport.html
457+
//! [`Resolver`]: https://docs.rs/ureq/3.0.0-rc4/ureq/unversioned/resolver/trait.Resolver.html
458+
//! [`unversioned`]: https://docs.rs/ureq/3.0.0-rc4/ureq/unversioned/index.html
441459
442460
#![forbid(unsafe_code)]
443461
#![warn(clippy::all)]

0 commit comments

Comments
 (0)