http-string-parser

Parse HTTP Request and Response from String

npm install http-string-parser
50 downloads in the last day
206 downloads in the last week
1 054 downloads in the last month

http-string-parser

Build Status Dependency Status devDependency Status

Parse HTTP message (Request and Response) from raw string in Node.JS

Parse HTTP Message

var parser = require('http-string-parser');

message = parser.parse(string);

console.log(message['request']);
console.log(message['response']);

See more about Request and Response data model.

API Reference

parseRequest(requestString)

parseRequestLine(requestLine)

parseResponse(responseString)

parseStatusLine(statusLine)

praseHeaders(headersLinesArray)


NOTE: Proof of concept, naive HTTP parsing, wheel re-inventation. In future it may be replaced with better parser from Node.JS core's C bindings of NGINX HTTP parser

npm loves you