You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* update reqwest and tokio
* Make extract link working with new packages
* Make uniq working with new packages
* Update get.md
* Make rest-post working with new packages
* Make API resource exists working with new packages
* Make Query the GitHub API working with new packages
* Fix typos
* update to edition 2018
* Extending reqwest
* fix mime request
* fix post file
* Fix download basic
* Remove toml lines
* add error handling
* Fix partial
* Improve coding in unique
* Borken links fix
* Fix retain example
* merging master
* Completed updating for async
* https://docs.rs/reqwest/0.10.6/reqwest/ references clients and they provided 404 errors
* replace anyhow with error-chain
* spelling and links
Co-authored-by: pollosp <pollo.es.pollo@gmail.com>
Co-authored-by: Olopez <pollosp@users.noreply.github.com>
Copy file name to clipboardExpand all lines: src/web.md
+22-1Lines changed: 22 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,8 +26,18 @@
26
26
|[Get MIME type from filename][ex-mime-from-filename]|[![mime-badge]][mime]|[![cat-encoding-badge]][cat-encoding]|
27
27
|[Parse the MIME type of a HTTP response][ex-http-response-mime-type]|[![mime-badge]][mime][![reqwest-badge]][reqwest]|[![cat-net-badge]][cat-net][![cat-encoding-badge]][cat-encoding]|
28
28
29
+
## Clients
29
30
30
-
{{#include web/clients.md}}
31
+
| Recipe | Crates | Categories |
32
+
|--------|--------|------------|
33
+
|[Make a HTTP GET request][ex-url-basic]|[![reqwest-badge]][reqwest]|[![cat-net-badge]][cat-net]|
34
+
|[Query the GitHub API][ex-rest-get]|[![reqwest-badge]][reqwest][![serde-badge]][serde]|[![cat-net-badge]][cat-net][![cat-encoding-badge]][cat-encoding]|
35
+
|[Check if an API resource exists][ex-rest-head]|[![reqwest-badge]][reqwest]|[![cat-net-badge]][cat-net]|
36
+
|[Create and delete Gist with GitHub API][ex-rest-post]|[![reqwest-badge]][reqwest][![serde-badge]][serde]|[![cat-net-badge]][cat-net][![cat-encoding-badge]][cat-encoding]|
37
+
|[Consume a paginated RESTful API][ex-paginated-api]|[![reqwest-badge]][reqwest][![serde-badge]][serde]|[![cat-net-badge]][cat-net][![cat-encoding-badge]][cat-encoding]|
38
+
|[Download a file to a temporary directory][ex-url-download]|[![reqwest-badge]][reqwest][![tempdir-badge]][tempdir]|[![cat-net-badge]][cat-net][![cat-filesystem-badge]][cat-filesystem]|
39
+
|[Make a partial download with HTTP range headers][ex-progress-with-range]|[![reqwest-badge]][reqwest]|[![cat-net-badge]][cat-net]|
40
+
|[POST a file to paste-rs][ex-file-post]|[![reqwest-badge]][reqwest]|[![cat-net-badge]][cat-net]|
Queries GitHub [stargazers API v3](https://developer.github.com/v3/activity/starring/#list-stargazers)
6
-
with [`reqwest::get`] to get list of all users who have marked a GitHub project with a star. [`reqwest::Response`] is deserialized with [`Response::json`] into `User` objects implementing [`serde::Deserialize`].
6
+
with [`reqwest::get`] to get list of all users who have marked a GitHub project with a star.
7
+
[`reqwest::Response`] is deserialized with [`Response::json`] into `User` objects implementing [`serde::Deserialize`].
8
+
9
+
[tokio::main] is used to set up the async executor and the process waits for [`reqwet::get`] to complete before
10
+
processing the response into User instances.
7
11
8
12
```rust,edition2018,no_run
9
13
use serde::Deserialize;
@@ -15,14 +19,15 @@ struct User {
15
19
id: u32,
16
20
}
17
21
18
-
fn main() -> Result<(), Error> {
22
+
#[tokio::main]
23
+
async fn main() -> Result<(), Error> {
19
24
let request_url = format!("https://api.github.com/repos/{owner}/{repo}/stargazers",
0 commit comments