-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor and document request module
- Loading branch information
1 parent
038f10d
commit 666c218
Showing
7 changed files
with
308 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
use http_req::request; | ||
|
||
fn main() { | ||
//Sends a HTTP GET request and processes the response. | ||
let mut body = Vec::new(); | ||
let res = request::get("https://jigsaw.w3.org/HTTP/ChunkedScript", &mut body).unwrap(); | ||
|
||
//Prints details about the response. | ||
println!("Status: {} {}", res.status_code(), res.reason()); | ||
println!("Headers: {}", res.headers()); | ||
//println!("{}", String::from_utf8_lossy(&body)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.