[](https://crates.io/crates/reqwest-streams)


# reqwest streams for Rust
Library provides HTTP response streaming support for [reqwest](https://github.com/seanmonstar/reqwest):
- JSON array stream format
- JSON lines stream format
- CSV stream
- Protobuf len-prefixed stream format
- Arrow IPC stream format
This type of responses are useful when you are reading huge stream of objects from some source (such as database, file, etc)
and want to avoid huge memory allocation.
## Quick start
Cargo.toml:
```toml
[dependencies]
reqwest-streams = { version = "0.10", features=["json", "csv", "protobuf", "arrow"] }
```
Example code:
```rust
use reqwest_streams::*;
use futures::stream::BoxStream;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Deserialize)]
struct MyTestStructure {
some_test_field: String
}
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let _stream = reqwest::get("http://localhost:8080/json-array")
.await?
.json_array_stream::<MyTestStructure>(1024);
Ok(())
}
```
All examples available in [examples](examples) directory.
To run example use:
```
# cargo run --example json-stream
```
## Need server support?
There is the same functionality:
- [axum-streams](https://github.com/abdolence/axum-streams-rs).
## Licence
Apache Software License (ASL)
## Author
Abdulla Abdurakhmanov