26 releases (13 stable)

1.3.2 Jun 28, 2018
1.2.4 Jan 17, 2018
1.2.3 May 29, 2017
1.2.1 Dec 4, 2016
0.0.5 Mar 21, 2015

#2 in Network programming

Download history 22830/week @ 2018-09-11 28585/week @ 2018-09-18 27382/week @ 2018-09-25 33291/week @ 2018-10-02 32670/week @ 2018-10-09 32878/week @ 2018-10-16 30585/week @ 2018-10-23 36128/week @ 2018-10-30 35756/week @ 2018-11-06 34949/week @ 2018-11-13 34861/week @ 2018-11-20 29548/week @ 2018-11-27 33195/week @ 2018-12-04

95,582 downloads per month
Used in 2,253 crates (47 directly)

MIT/Apache

63KB
1.5K SLoC

httparse

Build Status Coverage Status crates.io

A push parser for the HTTP 1.x protocol. Avoids allocations. No copy. Fast.

Works with no_std, simply disable the std Cargo feature.

Documentation Changelog

Usage

let mut headers = [httparse::EMPTY_HEADER; 16];
let mut req = httparse::Request::new(&mut headers);

let buf = b"GET /index.html HTTP/1.1\r\nHost";
assert!(req.parse(buf)?.is_partial());

// a partial request, so we try again once we have more data

let buf = b"GET /index.html HTTP/1.1\r\nHost: example.domain\r\n\r\n";
assert!(req.parse(buf)?.is_complete());

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

No runtime deps