Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions _stable/client/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ tokio::task::spawn(async move {
});
# let authority = url.authority().unwrap().clone();
# let req = Request::builder()
# .uri(url)
# .uri(url.path())
# .header(hyper::header::HOST, authority.as_str())
# .body(Empty::<Bytes>::new())?;
# let mut res = sender.send_request(req).await?;
Expand Down Expand Up @@ -160,7 +160,7 @@ let authority = url.authority().unwrap().clone();

// Create an HTTP request with an empty body and a HOST header
let req = Request::builder()
.uri(url)
.uri(url.path())
.header(hyper::header::HOST, authority.as_str())
.body(Empty::<Bytes>::new())?;

Expand Down Expand Up @@ -217,9 +217,9 @@ use tokio::io::{AsyncWriteExt as _, self};
# });
# let authority = url.authority().unwrap().clone();
# let req = Request::builder()
# .uri(url)
# .header(hyper::header::HOST, authority.as_str())
# .body(Empty::<Bytes>::new())?;
# .uri(url.path())
# .header(hyper::header::HOST, authority.as_str())
# .body(Empty::<Bytes>::new())?;
# let mut res = sender.send_request(req).await?;
// Stream the body, writing each frame to stdout as it arrives
while let Some(next) = res.frame().await {
Expand Down