@@ -48,10 +48,10 @@ let body: String = ureq::get("http://example.com")
48
48
. read_to_string ()? ;
49
49
```
50
50
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
52
52
holds a connection pool for reuse, and a cookie store if you use the
53
53
** 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
55
55
an Agent also allows setting options like the TLS configuration.
56
56
57
57
``` rust
@@ -108,10 +108,9 @@ let recv_body = ureq::post("http://example.com/post/ingest")
108
108
109
109
ureq returns errors via ` Result<T, ureq::Error> ` . That includes I/O errors,
110
110
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 ` ] .
112
112
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() ` ]
115
114
116
115
``` rust
117
116
use ureq :: Error ;
@@ -200,13 +199,11 @@ agent.get("https://www.google.com/").call().unwrap();
200
199
By default, ureq uses Mozilla's root certificates via the [ webpki-roots] crate. This is a static
201
200
bundle of root certificates that do not update automatically. It also circumvents whatever root
202
201
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.
206
203
To maintain a "fresh" list of root certs, you need to bump the ureq dependency from time to time.
207
204
208
205
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] .
210
207
211
208
If your use case for ureq is talking to a limited number of servers with high trust, the
212
209
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.
244
241
245
242
This is enabled by default.
246
243
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.
249
246
250
247
## Sending body data
251
248
@@ -270,7 +267,7 @@ known size, in other words, if the body to send is one of:
270
267
* ` &String `
271
268
* ` Vec<u8> `
272
269
* ` &Vec<u8>) `
273
- * [ ` SendBody::from_json() ` ] (implicitly via [ ` RequestBuilder:: send_json()` ] )
270
+ * [ ` SendBody::from_json() ` ] (implicitly via [ ` request. send_json()` ] )
274
271
275
272
### Transfer-Encoding: chunked
276
273
@@ -304,7 +301,7 @@ the `chunked` method.
304
301
305
302
### Sending form data
306
303
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 `
308
305
encoded data. The key/values provided will be URL encoded.
309
306
310
307
### Overriding
@@ -351,7 +348,7 @@ ureq supports two kinds of proxies, [`HTTP`] ([`CONNECT`]), [`SOCKS4`]/[`SOCKS5
351
348
the former is always available while the latter must be enabled using the feature
352
349
** socks-proxy** .
353
350
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.
355
352
356
353
### Example using HTTP
357
354
@@ -391,8 +388,7 @@ ureq follows semver. From ureq 3.x we strive to have a much closer adherence to
391
388
The main mistake in 2.x was to re-export crates that were not yet semver 1.0. In ureq 3.x TLS and
392
389
cookie configuration is shimmed using our own types.
393
390
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 ` ] .
396
392
These allow the user write their own bespoke transports and (DNS name) resolver. The API: s for
397
393
these parts are not yet solidified. They live under the [ ` unversioned ` ] module, and do not
398
394
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
418
414
[ `native-tls` ] : https://crates.io/crates/native-tls
419
415
[ rustls-platform-verifier ] : https://crates.io/crates/rustls-platform-verifier
420
416
[ 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
0 commit comments