minreq
minreq copied to clipboard
Simple, minimal-dependency HTTP client.
It would be nice if ResponseLazy implemented Read, that way you could use copy or similar: https://doc.rust-lang.org/std/io/fn.copy.html
I don't see this in the docs but are connections persisted? Or are they dropped on response? It seems we connect again for each request: https://github.com/neonmoe/minreq/blob/1533698d794cdf7684b9f012d8d533b5b5469b39/src/connection.rs#L244 If connections are not...
Minreq is currently unable to handle headers appearing multiple times in the response. Only the last value is stored, as it is inserted over the previous values. https://github.com/neonmoe/minreq/blob/efbaf757515cd77070de5cb3e0a9ece49e20df92/src/response.rs#L303
Use `AsRef` instead of `Into` where sensible to do so Saves allocations and/or taking ownership Potentially a breaking change on some really weird types
Fixes #56
As mentioned in PR #32, minreq does not handle IP addresses in URLs properly right now. Sending the request via the basic HTTP backend seems to work, as well as...
Using this code: ~~~rust use minreq; fn main() -> Result { let response = minreq::get("https://volvoforums.com").send()?; dbg!(response.status_code); Ok(()) } ~~~ I get this result: ~~~ [src\main.rs:5] response.status_code = 400 ~~~ Other...
When reading a response lazily, we want to work with it efficiently, as buffers of bytes coming out of the OS TCP stack. While we could `Iterator::collect::()` the bytes back...
Hi Thanks for the cute minreq, it's really handy! However, can you add compression support? ```rust let records: Vec = minreq::get(url) .with_header("Accept-Encoding", "deflate, gzip") .with_timeout(5) .send()? .json()?; ``` Gives the...
``` let mut file = fs::File::open(&dir_temp.join(constants::TEMP_NAME)).unwrap(); let mut buffer = Vec::new(); file.read_to_end(&mut buffer).unwrap(); let response = minreq::post(constants::URL) .with_header("Content-Type", "multipart/form-data") .with_header("Content-Length", &buffer.len().to_string()) .with_body(buffer) .send() .unwrap(); ``` I tried this but don't...