#http-response #mini #parser #lib

minihttpse

a mini http response parser lib in rust

7 releases

Uses old Rust 2015

0.1.6 Aug 18, 2017
0.1.5 Aug 17, 2017

#36 in #mini

Download history 45/week @ 2024-03-11 10/week @ 2024-03-18 23/week @ 2024-04-01 4/week @ 2024-04-08 7/week @ 2024-04-15 11/week @ 2024-04-22 3/week @ 2024-04-29 6/week @ 2024-05-06 9/week @ 2024-05-13 14/week @ 2024-05-20 7/week @ 2024-05-27 10/week @ 2024-06-03 8/week @ 2024-06-10 116/week @ 2024-06-17 92/week @ 2024-06-24

227 downloads per month
Used in 2 crates

MIT/Apache

11KB
166 lines

minihttpse is a http response parser for rust,is simple and easy

Examples

use minihttpse::Response;

let s = "HTTP/1.1 200 OK\r\n\
        Content-Length: 18\r\n\
        Server: GWS/2.0\r\n\
        Date: Sat, 11 Jan 2003 02:44:04 GMT\r\n\
        Content-Type: text/html\r\n\
        Cache-control: private\r\n\
        Set-Cookie: PREF=ID=73d4aef52e57bae9:TM=1042253044:LM=1042253044:S=SMCc_HRPCQiqyX9j; expires=Sun, 17-Jan-2038 19:14:07 GMT; path=/; domain=.google.com\r\n\
        Connection: keep-alive\r\n\
        \r\n\
        <html>hello</html>";
let res = Response::new(s.as_bytes().to_owned()).unwrap();
assert_eq!(res.reason(),"OK");
assert_eq!(res.status_code(),200);
assert_eq!(res.headers().get("Server"),Some(&"GWS/2.0".to_owned()));
println!("body {}",res.text());

No runtime deps