Releases: neonmoe/minreq
Releases · neonmoe/minreq
2.1.1
Fixed
- Handling of status codes 204 and 304. Thanks to @Mubelotix!
2.1.0
2.0.3
Accidentally broke header parsing in 2.0.2 for pretty much all cases that weren't broken before that. Didn't notice the regression before releasing because I was running cargo test
without --all-features
. This version fixes that.
Fixed
- Fixed regression in header parsing caused by 2.0.2, which was yanked.
2.0.2
2.0.1
2.0.0
The big API-breaking update.
Added
- API for loading the HTTP response body through an iterator, allowing for processing of the data during the download.
- See the
ResponseLazy
documentation for more information.
- See the
- Error type for all the errors that this crate can run into for easier
?
usage and better debuggability. - Punycode support for non-ascii hostnames via the
punycode
feature. - Trailer header support.
- Examples
hello
,iterator
, andjson
.
Changed
- Breaking, will cause problems not detectable by the compiler: Response headers' field names are now in lowercase, as they are case-insensitive and this makes getting header values easier. The values are unaffected. So if your code has
response.headers.get("Content-Type")
, you have to change it toresponse.headers.get("content-type")
, or it will not return what you want. - Breaking: Restructure the
Response
struct:- Removed
bytes
andbody_bytes
. - Added
as_bytes()
,into_bytes()
, andas_str()
in their place.
- Removed
- Breaking: Changed the
with_body
parameter type toInto<Vec<u8>>
fromInto<String>
.String
s implementInto<Vec<u8>>
, so this shouldn't cause any problems, unless you're using some interesting types that implementInto<String>
but notInto<Vec<u8>>
.
- Clean up the crate internals overall. Note: This might cause instability, if you're very concerned about stability, please hold off upgrading for a while.
- Remove
panic!
when trying to make anhttps://
request without thehttps
feature. The request will now return an error instead. The library should not panic anymore. - Audit the remaining
unwrap()
s from library code, none of them should actually ever cause a panic now.
Removed
create_request
in favor of just usingResponse::new
.
1.4.0
1.3.0
Switched to handling HTTP responses as byte vecs instead of strings, so now you can download images and other non-UTF-8 content.
Changelog
- Fixed some clippy warnings.
- Added the
body_bytes
field toResponse
, which contains the body in raw bytes. - Made it so that minreq doesn't panic when getting a non-UTF-8 response, and instead, setting
body
to just an empty string. The aforementionedbody_bytes
will still contain the actual body.
1.2.1
Previously, the http response was split into lines, and then the body was manually reconstructed from the lines, with \r\n
between. This obviously doesn't preserve the original body very well. This is now fixed, and the body should be exactly as the sender wrote it. Thanks @shanavas786 for the code review!
Changelog
- Fix http response body handling.