JSPM

http-string-parser

0.0.6
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 24413
  • Score
    100M100P100Q133798F
  • License MIT

Parse HTTP Request and Response from String

Package Exports

  • http-string-parser

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (http-string-parser) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

http-string-parser

NPM Version Build Status Dependency Status devDependency Status

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

Parse HTTP Messages

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

request = parser.parseRequest(requestString);
response = parser.parseResponse(responseString);

console.log(request);
console.log(response);

See more about Request and Response data model.

API Reference

parseRequest(requestString)

parseRequestLine(requestLine)

parseResponse(responseString)

parseStatusLine(statusLine)

parseHeaders(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 or PEG.js HTTP parser