Best way to parse HTTP headers from HTTP request String using no 3rd party libs (Core Java)

Viewed 17085

Given an HTTP request header, does anyone have suggestions or know of existing code to properly parse the header? I am trying to do this with Core Java only, no third party libs

Edit:

Trying to find key fields from this String for example:

GET / HTTP/1.1User-Agent: curl/7.19.7 (x86_64-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15Host: localhost:9000Accept: /

Want to parse out the Method and method

4 Answers
Related