
Product
Socket Now Supports pylock.toml Files
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
HTTP message (request/response) parser/builder according to the rules defined in RFC 7230
Works in Node.js and in the browser, has zero dependencies.
$ pnpm i http-z
import { parse, build } from 'http-z'
const plainMessage = [
'GET /features?p1=v1 HTTP/1.1',
'Host: example.com',
'Accept: *',
'Accept-Encoding: gzip,deflate',
'Accept-Language: en-US;q=0.6, en;q=0.4',
'',
''
].join('\r\n')
const messageModel = parse(plainMessage)
console.log(messageModel)
/* output:
{
"method": "GET",
"protocolVersion": "HTTP/1.1",
"host": "example.com",
"target": "/features?p1=v1",
"path": "/features",
"queryParams": [
{ "name": "p1", "value": "v1" }
],
"headers": [
{ "name": "Host", "value": "example.com" },
{ "name": "Accept", value": "*" },
{ "name": "Accept-Encoding", "value": "gzip,deflate" },
{ "name": "Accept-Language", "value": "en-US;q=0.6, en;q=0.4" }
],
"headersSize": 135,
"bodySize": 0
}
*/
const plainMessageParsed = build(messageModel)
console.log(plainMessageParsed)
/* output:
GET /features?p1=v1 HTTP/1.1
Host: example.com
Accept: *
Accept-Encoding: gzip,deflate
Accept-Language: en-US;q=0.6, en;q=0.4
*/
Parses HTTP request/response raw message and returns a model.
rawMessage: string
- HTTP raw message.opts: HttpZParserOptions
- options, optional.const messageModel = parse(plainMessage)
Builds HTTP request/response raw message from the model.
messageModel: HttpZBuilderModel
- HTTP message model.opts: HttpZBuilderOptions
- options, optional.const plainMessageParsed = build(messageModel)
Different utils used by the library. Can be used externally.
Different HTTP constants (methods, headers, etc.)
Licensed under the MIT license.
Alexander Mac
v8.1.1 (May. 6, 2025)
FAQs
HTTP message parser and builder
The npm package http-z receives a total of 38,301 weekly downloads. As such, http-z popularity was classified as popular.
We found that http-z demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.
Research
Security News
Malicious Ruby gems typosquat Fastlane plugins to steal Telegram bot tokens, messages, and files, exploiting demand after Vietnam’s Telegram ban.