Comments (2)
xitca-client
is a work in progress project and has not been released yet. It can depends on any source including unreleased xitca
crates. In order to utilize it you have to use cargo patch and override deps for said situation. You can reference https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html for further usage of cargo.
Below is an example how to make your request work with latest main branch. But do note that the api and deps can have breaking changes at any time in the future beyond the 652e03a
commit hash. If you need a stable api consider not using xitca-client
for now. In general reqwest
is a safe choice.
Cargo.toml
[dependencies]
xitca-client = "0.1"
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
[patch.crates-io]
xitca-client = { git = "https://github.com/HFQR/xitca-web.git", rev = "652e03a" }
xitca-http = { git = "https://github.com/HFQR/xitca-web.git", rev = "652e03a" }
xitca-io = { git = "https://github.com/HFQR/xitca-web.git", rev = "652e03a" }
main.rs
#[tokio::main]
async fn main() -> Result<(), xitca_client::error::Error> {
let cli = xitca_client::Client::new();
let res = cli.get("http://www.example.com/")?.send().await?;
println!("response head: \r\n{res:?}");
let body = res.string().await?;
println!("response body: \r\n{body}");
Ok(())
}
from xitca-web.
Thanks for the answer!
from xitca-web.
Related Issues (20)
- Nested Nested Apps don't work HOT 9
- i saw the techempower benchmark, is it really thread per core? HOT 3
- new to xitca web, how to compile this? HOT 1
- it's nice but http/2 or http3 :443 has issues HOT 12
- possible to do a http2 websocket example? current one is only http1.1 HOT 2
- too many file descriptors. possible to do one that share 1 file descriptor? (feature request) HOT 7
- is it easy to show an example of using websocket with http2 and http3 together? HOT 9
- can you show an example of Router /hello hello world text for xitca multi http2/3? HOT 1
- how to get remote ip address HOT 1
- how to drop a connection as fast as possible? (in the event of ddos attack) HOT 5
- how to have websocket, http2/3, router on the same script? HOT 5
- Chatgpt multiple errors unexpected! HOT 1
- rustls-ring-crypto for server HOT 4
- [Question] How store `FnService<F>`? HOT 1
- [求助]websocket怎么在任意上下文使用呢? HOT 2
- Named Parameters HOT 1
- how to do so reuseport? HOT 1
- problem encountered for cargo run. how to debug? HOT 1
- spawning xitca_server address in use error HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xitca-web.