{"_id":"@hoppscotch/httpsnippet","_rev":"8-c9d7d32290719b914dfbb6231d0fb7e5","name":"@hoppscotch/httpsnippet","dist-tags":{"latest":"3.0.9"},"versions":{"3.0.5":{"name":"@hoppscotch/httpsnippet","version":"3.0.5","keywords":["api","clojure","csharp","curl","go","har","http","httpie","httr","java","javascript","jquery","kotlin","objc","objective-c","ocaml","php","python","request","requests","ruby","shell","snippet","swift","swift","unirest","xhr","xmlhttprequest"],"author":{"name":"Hoppscotch Team","email":"support@hoppscotch.io"},"license":"MIT","_id":"@hoppscotch/httpsnippet@3.0.5","maintainers":[{"name":"liyasthomas","email":"liyascthomas@gmail.com"},{"name":"andrewbastin","email":"andrewbastin.k@gmail.com"}],"homepage":"https://github.com/Hoppscotch/httpsnippet","bugs":{"url":"https://github.com/Hoppscotch/httpsnippet/issues"},"bin":{"httpsnippet":"bin/httpsnippet"},"dist":{"shasum":"b06a268d86b2fabda509c216013a2f58a4e36964","tarball":"https://registry.npmjs.org/@hoppscotch/httpsnippet/-/httpsnippet-3.0.5.tgz","fileCount":4,"integrity":"sha512-tKrJ+HO+A9PfjRU9IYkjyctyqJ0ZlpbYe6fjwaSuqoHmAfcmblDb4uT6mO0k2VrP4MA8AN/2LpcfT8PM5SHtHw==","signatures":[{"sig":"MEQCIEVXBwr9/+ioJEnfNZUaS5b0EGHgU8acOf4KV8UTNDZeAiAnSIbcEqoZyBPiUMGQgoMH+wqTiS+HuDDNYMBOO4xqFA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26190},"main":"dist/httpsnippet.js","types":"dist/httpsnippet.d.ts","engines":{"node":"^14.19.1 || ^16.14.2 || ^18.0.0 "},"gitHead":"a232f8a276734dde8586a34bcdace8ee62bc8a04","scripts":{"dev":"tsc --watch --preserveWatchOutput","lint":"npm run lint:prettify && npm run lint:code && npm run lint:markdown","test":"jest","build":"tsc --build tsconfig.build.json","clean":"tsc --build tsconfig.build.json --clean","prebuild":"npm run clean","lint:code":"eslint . --ext ts,d.ts,test.ts --fix","test:watch":"jest --watch","build:types":"tsc -d --declarationDir dist/lib --declarationMap --emitDeclarationOnly","lint:markdown":"markdownlint-cli2 \"**/*.md\" \"#**/node_modules\"","lint:prettify":"prettier --write ."},"_npmUser":{"name":"andrewbastin","email":"andrewbastin.k@gmail.com"},"repository":{"url":"git+https://github.com/Hoppscotch/httpsnippet.git","type":"git"},"_npmVersion":"10.7.0","description":"HTTP Request snippet generator for *most* languages","directories":{},"_nodeVersion":"20.15.0","dependencies":{"chalk":"^4.1.2","yargs":"^17.4.0","form-data":"4.0.0","har-schema":"^2.0.0","event-stream":"4.0.1","stringify-object":"3.3.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","eslint":"^8.12.0","ts-jest":"^27.1.4","prettier":"^2.6.2","type-fest":"^2.12.2","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/yargs":"^17.0.10","@types/eslint":"^8.4.1","@types/har-format":"^1.2.8","markdownlint-cli2":"^0.5.1","eslint-plugin-jest":"^26.1.3","@types/event-stream":"^4.0.0","eslint-config-prettier":"^8.5.0","@types/stringify-object":"^3.3.0","@typescript-eslint/parser":"^5.17.0","eslint-plugin-eslint-comments":"^3.2.0","eslint-plugin-jest-formatting":"^3.1.0","@typescript-eslint/eslint-plugin":"^5.17.0","eslint-plugin-simple-import-sort":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/httpsnippet_3.0.5_1720625382406_0.9376237193809662","host":"s3://npm-registry-packages"}},"3.0.6":{"name":"@hoppscotch/httpsnippet","version":"3.0.6","keywords":["api","clojure","csharp","curl","go","har","http","httpie","httr","java","javascript","jquery","kotlin","objc","objective-c","ocaml","php","python","request","requests","ruby","shell","snippet","swift","swift","unirest","xhr","xmlhttprequest"],"author":{"name":"Hoppscotch Team","email":"support@hoppscotch.io"},"license":"MIT","_id":"@hoppscotch/httpsnippet@3.0.6","maintainers":[{"name":"liyasthomas","email":"liyascthomas@gmail.com"},{"name":"andrewbastin","email":"andrewbastin.k@gmail.com"}],"homepage":"https://github.com/Hoppscotch/httpsnippet","bugs":{"url":"https://github.com/Hoppscotch/httpsnippet/issues"},"bin":{"httpsnippet":"bin/httpsnippet"},"dist":{"shasum":"6168033d180a43769f79934b486aef3f97d406fb","tarball":"https://registry.npmjs.org/@hoppscotch/httpsnippet/-/httpsnippet-3.0.6.tgz","fileCount":688,"integrity":"sha512-W42cXJWrPvydwImgHZAV6s60fKouQ9TeTX/vzXqjBuszccrPywOJaPUlBjMe26Xe+5xEQccjlGaVaxSVJu9nXw==","signatures":[{"sig":"MEQCIBIpLbjNAaOm43flo3091h0vYVyEq1fX22o59nyE04PcAiBWSPINykrjvcn/cQMrYf0D8VC2f2OryDSU20ZooEs29Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":408328},"main":"dist/httpsnippet.js","types":"dist/httpsnippet.d.ts","engines":{"node":"^14.19.1 || ^16.14.2 || ^18.0.0 "},"gitHead":"861685624a2f724802a4c991aaa4a933d6c8d5c2","scripts":{"dev":"tsc --watch --preserveWatchOutput","lint":"npm run lint:prettify && npm run lint:code && npm run lint:markdown","test":"jest","build":"tsc --build tsconfig.build.json","clean":"tsc --build tsconfig.build.json --clean","prebuild":"npm run clean","lint:code":"eslint . --ext ts,d.ts,test.ts --fix","test:watch":"jest --watch","build:types":"tsc -d --declarationDir dist/lib --declarationMap --emitDeclarationOnly","lint:markdown":"markdownlint-cli2 \"**/*.md\" \"#**/node_modules\"","lint:prettify":"prettier --write ."},"_npmUser":{"name":"andrewbastin","email":"andrewbastin.k@gmail.com"},"repository":{"url":"git+https://github.com/Hoppscotch/httpsnippet.git","type":"git"},"_npmVersion":"10.7.0","description":"HTTP Request snippet generator for *most* languages","directories":{},"_nodeVersion":"20.15.0","dependencies":{"chalk":"^4.1.2","yargs":"^17.4.0","form-data":"4.0.0","har-schema":"^2.0.0","event-stream":"4.0.1","stringify-object":"3.3.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","eslint":"^8.12.0","ts-jest":"^27.1.4","prettier":"^2.6.2","type-fest":"^2.12.2","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/yargs":"^17.0.10","@types/eslint":"^8.4.1","@types/har-format":"^1.2.8","markdownlint-cli2":"^0.5.1","eslint-plugin-jest":"^26.1.3","@types/event-stream":"^4.0.0","eslint-config-prettier":"^8.5.0","@types/stringify-object":"^3.3.0","@typescript-eslint/parser":"^5.17.0","eslint-plugin-eslint-comments":"^3.2.0","eslint-plugin-jest-formatting":"^3.1.0","@typescript-eslint/eslint-plugin":"^5.17.0","eslint-plugin-simple-import-sort":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/httpsnippet_3.0.6_1720625541782_0.6760895724335467","host":"s3://npm-registry-packages"}},"3.0.7":{"name":"@hoppscotch/httpsnippet","version":"3.0.7","keywords":["api","clojure","crystal","csharp","curl","go","har","http","httpie","httr","java","javascript","jquery","kotlin","objc","objective-c","ocaml","php","python","request","requests","ruby","rust","shell","snippet","swift","swift","unirest","xhr","xmlhttprequest"],"author":{"name":"Hoppscotch Team","email":"support@hoppscotch.io"},"license":"MIT","_id":"@hoppscotch/httpsnippet@3.0.7","maintainers":[{"name":"liyasthomas","email":"liyascthomas@gmail.com"},{"name":"andrewbastin","email":"andrewbastin.k@gmail.com"},{"name":"jamesgeorge007","email":"jamesgeorge998001@gmail.com"}],"homepage":"https://github.com/Hoppscotch/httpsnippet","bugs":{"url":"https://github.com/Hoppscotch/httpsnippet/issues"},"bin":{"httpsnippet":"bin/httpsnippet"},"dist":{"shasum":"5e62926d3e9e42338886de89667cf234e425d622","tarball":"https://registry.npmjs.org/@hoppscotch/httpsnippet/-/httpsnippet-3.0.7.tgz","fileCount":940,"integrity":"sha512-A7uoYLmkdjekFadnooOjpplFOIr0yHtY/wG63uoTbvL0hoEYH22fDQlJeYIlZe1kdv4q+xjnHj9VgdZQzMbauA==","signatures":[{"sig":"MEQCIGvjcYcd+gQj+Theq0Fp3FZdZhgdIFPMM+B6wiGvW0gzAiAV5xufjDEn8W8hvgjrgH0VvYbuMtgsyoLRsa48TIvaCA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":688151},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":"^14.19.1 || ^16.14.2 || ^18.0.0 "},"gitHead":"40575c481faf408c9857f0c45a3083cef10ae4af","scripts":{"dev":"tsc --watch --preserveWatchOutput","lint":"npm run lint:prettify && npm run lint:code && npm run lint:markdown","test":"jest","build":"tsc --build tsconfig.build.json","clean":"tsc --build tsconfig.build.json --clean","lint:fix":"npm run lint:prettify:fix && npm run lint:code:fix && npm run lint:markdown:fix","prebuild":"npm run clean","lint:code":"eslint . --ext ts,d.ts,test.ts","test:watch":"jest --watch","build:types":"tsc -d --declarationDir dist/lib --declarationMap --emitDeclarationOnly","lint:code:fix":"eslint . --ext ts,d.ts,test.ts --fix","lint:markdown":"markdownlint-cli2 \"**/*.md\" \"#**/node_modules\"","lint:prettify":"prettier --check .","lint:markdown:fix":"markdownlint-cli2-fix \"**/*.md\" \"#**/node_modules\"","lint:prettify:fix":"prettier --write ."},"_npmUser":{"name":"andrewbastin","email":"andrewbastin.k@gmail.com"},"repository":{"url":"git+https://github.com/Hoppscotch/httpsnippet.git","type":"git"},"_npmVersion":"10.8.2","description":"HTTP Request snippet generator for *most* languages","directories":{},"_nodeVersion":"20.18.2","dependencies":{"chalk":"^4.1.2","yargs":"^17.4.0","form-data":"4.0.0","event-stream":"4.0.1","stringify-object":"3.3.0","har-validator-compiled":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","eslint":"^8.12.0","ts-jest":"^27.1.4","prettier":"^2.6.2","type-fest":"^2.12.2","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/yargs":"^17.0.10","@types/eslint":"^8.4.1","@types/har-format":"^1.2.8","markdownlint-cli2":"^0.5.1","eslint-plugin-jest":"^26.1.3","@types/event-stream":"^4.0.0","eslint-config-prettier":"^8.5.0","@types/stringify-object":"^3.3.0","@typescript-eslint/parser":"^5.17.0","eslint-plugin-eslint-comments":"^3.2.0","eslint-plugin-jest-formatting":"^3.1.0","@typescript-eslint/eslint-plugin":"^5.17.0","eslint-plugin-simple-import-sort":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/httpsnippet_3.0.7_1738661596811_0.10171410931906966","host":"s3://npm-registry-packages-npm-production"}},"3.0.8":{"name":"@hoppscotch/httpsnippet","version":"3.0.8","keywords":["api","clojure","crystal","csharp","curl","go","har","http","httpie","httr","java","javascript","jquery","kotlin","objc","objective-c","ocaml","php","python","request","requests","ruby","rust","shell","snippet","swift","swift","unirest","xhr","xmlhttprequest"],"author":{"name":"Hoppscotch Team","email":"support@hoppscotch.io"},"license":"MIT","_id":"@hoppscotch/httpsnippet@3.0.8","maintainers":[{"name":"liyasthomas","email":"liyascthomas@gmail.com"},{"name":"andrewbastin","email":"andrewbastin.k@gmail.com"},{"name":"jamesgeorge007","email":"jamesgeorge998001@gmail.com"}],"homepage":"https://github.com/Hoppscotch/httpsnippet","bugs":{"url":"https://github.com/Hoppscotch/httpsnippet/issues"},"bin":{"httpsnippet":"bin/httpsnippet"},"dist":{"shasum":"ede74efcef6b48c425e8dd2d7e7716b8266d882f","tarball":"https://registry.npmjs.org/@hoppscotch/httpsnippet/-/httpsnippet-3.0.8.tgz","fileCount":944,"integrity":"sha512-jUMdqYMGo8iDOuOiuGRNZUeV2qJfXv+zwf3H/ZpH7bbuliwdC40+yndDOBX3Ol3aJwNZVyZhCw+0VdCOpHCMtQ==","signatures":[{"sig":"MEUCIAUSJ3eII1tetlkiZHedb4inHKTry+XDa+xwQT5tE5rTAiEAw0RWwZKQtwo7BCXs+O/Js2u18Vh0VuG6/kJRKAW2xJU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":692119},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":"^14.19.1 || ^16.14.2 || ^18.0.0 "},"gitHead":"63d27b90a1e65c933bb8c01dda261fc9b0c95853","scripts":{"dev":"tsc --watch --preserveWatchOutput","lint":"npm run lint:prettify && npm run lint:code && npm run lint:markdown","test":"jest","build":"tsc --build tsconfig.build.json","clean":"tsc --build tsconfig.build.json --clean","lint:fix":"npm run lint:prettify:fix && npm run lint:code:fix && npm run lint:markdown:fix","prebuild":"npm run clean","lint:code":"eslint . --ext ts,d.ts,test.ts","test:watch":"jest --watch","build:types":"tsc -d --declarationDir dist/lib --declarationMap --emitDeclarationOnly","lint:code:fix":"eslint . --ext ts,d.ts,test.ts --fix","lint:markdown":"markdownlint-cli2 \"**/*.md\" \"#**/node_modules\"","lint:prettify":"prettier --check .","lint:markdown:fix":"markdownlint-cli2-fix \"**/*.md\" \"#**/node_modules\"","lint:prettify:fix":"prettier --write ."},"_npmUser":{"name":"jamesgeorge007","actor":{"name":"jamesgeorge007","type":"user","email":"jamesgeorge998001@gmail.com"},"email":"jamesgeorge998001@gmail.com"},"repository":{"url":"git+https://github.com/Hoppscotch/httpsnippet.git","type":"git"},"_npmVersion":"10.2.4","description":"HTTP Request snippet generator for *most* languages","directories":{},"_nodeVersion":"20.11.1","dependencies":{"chalk":"^4.1.2","yargs":"^17.4.0","form-data":"4.0.0","event-stream":"4.0.1","stringify-object":"3.3.0","har-validator-compiled":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","eslint":"^8.12.0","ts-jest":"^27.1.4","prettier":"^2.6.2","type-fest":"^2.12.2","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/yargs":"^17.0.10","@types/eslint":"^8.4.1","@types/har-format":"^1.2.8","markdownlint-cli2":"^0.5.1","eslint-plugin-jest":"^26.1.3","@types/event-stream":"^4.0.0","eslint-config-prettier":"^8.5.0","@types/stringify-object":"^3.3.0","@typescript-eslint/parser":"^5.17.0","eslint-plugin-eslint-comments":"^3.2.0","eslint-plugin-jest-formatting":"^3.1.0","@typescript-eslint/eslint-plugin":"^5.17.0","eslint-plugin-simple-import-sort":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/httpsnippet_3.0.8_1752068752336_0.2186786241593568","host":"s3://npm-registry-packages-npm-production"}},"3.0.9":{"name":"@hoppscotch/httpsnippet","version":"3.0.9","keywords":["api","clojure","crystal","csharp","curl","go","har","http","httpie","httr","java","javascript","jquery","kotlin","objc","objective-c","ocaml","php","python","request","requests","ruby","rust","shell","snippet","swift","swift","unirest","xhr","xmlhttprequest"],"author":{"name":"Hoppscotch Team","email":"support@hoppscotch.io"},"license":"MIT","_id":"@hoppscotch/httpsnippet@3.0.9","maintainers":[{"name":"liyasthomas","email":"liyascthomas@gmail.com"},{"name":"jamesgeorge007","email":"jamesgeorge998001@gmail.com"}],"homepage":"https://github.com/Hoppscotch/httpsnippet","bugs":{"url":"https://github.com/Hoppscotch/httpsnippet/issues"},"bin":{"httpsnippet":"bin/httpsnippet"},"dist":{"shasum":"943b62883a05019f6feb71a640e281d800d47dee","tarball":"https://registry.npmjs.org/@hoppscotch/httpsnippet/-/httpsnippet-3.0.9.tgz","fileCount":944,"integrity":"sha512-XTs2SYxOItC7Go38VsFYtnxEk6C5JhscEpZHgd9+klyah+Iy2uKLFaBFq9M/10YLhwfPNVP3UpGsL/jY50zQgQ==","signatures":[{"sig":"MEUCIGyJPr+migTZWSYy+mFW2G7QnyknqECzrOziOZg3ljMbAiEAzOi/yiTjxh8T2p1+ulGzrkI88EV374OBeqGg/nuqgEo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":692119},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":"^14.19.1 || ^16.14.2 || ^18.0.0 "},"gitHead":"7acb63c464752f93fad9ead2f74c702da821375a","scripts":{"dev":"tsc --watch --preserveWatchOutput","lint":"npm run lint:prettify && npm run lint:code && npm run lint:markdown","test":"jest","build":"tsc --build tsconfig.build.json","clean":"tsc --build tsconfig.build.json --clean","lint:fix":"npm run lint:prettify:fix && npm run lint:code:fix && npm run lint:markdown:fix","prebuild":"npm run clean","lint:code":"eslint . --ext ts,d.ts,test.ts","test:watch":"jest --watch","build:types":"tsc -d --declarationDir dist/lib --declarationMap --emitDeclarationOnly","lint:code:fix":"eslint . --ext ts,d.ts,test.ts --fix","lint:markdown":"markdownlint-cli2 \"**/*.md\" \"#**/node_modules\"","lint:prettify":"prettier --check .","lint:markdown:fix":"markdownlint-cli2-fix \"**/*.md\" \"#**/node_modules\"","lint:prettify:fix":"prettier --write ."},"_npmUser":{"name":"liyasthomas","actor":{"name":"liyasthomas","type":"user","email":"liyascthomas@gmail.com"},"email":"liyascthomas@gmail.com"},"repository":{"url":"git+https://github.com/Hoppscotch/httpsnippet.git","type":"git"},"_npmVersion":"10.8.2","description":"HTTP Request snippet generator for *most* languages","directories":{},"_nodeVersion":"20.19.3","dependencies":{"chalk":"^4.1.2","yargs":"^17.4.0","form-data":"4.0.0","event-stream":"4.0.1","stringify-object":"3.3.0","har-validator-compiled":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","eslint":"^8.12.0","ts-jest":"^27.1.4","prettier":"^2.6.2","type-fest":"^2.12.2","typescript":"^4.6.3","@types/jest":"^27.4.1","@types/node":"^16.11.26","@types/yargs":"^17.0.10","@types/eslint":"^8.4.1","@types/har-format":"^1.2.8","markdownlint-cli2":"^0.5.1","eslint-plugin-jest":"^26.1.3","@types/event-stream":"^4.0.0","eslint-config-prettier":"^8.5.0","@types/stringify-object":"^3.3.0","@typescript-eslint/parser":"^5.17.0","eslint-plugin-eslint-comments":"^3.2.0","eslint-plugin-jest-formatting":"^3.1.0","@typescript-eslint/eslint-plugin":"^5.17.0","eslint-plugin-simple-import-sort":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/httpsnippet_3.0.9_1752142579420_0.5563621776555825","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2024-07-10T15:29:42.236Z","modified":"2026-09-14T17:40:25.352Z","3.0.5":"2024-07-10T15:29:42.529Z","3.0.6":"2024-07-10T15:32:21.976Z","3.0.7":"2025-02-04T09:33:17.073Z","3.0.8":"2025-07-09T13:45:52.556Z","3.0.9":"2025-07-10T10:16:19.718Z"},"bugs":{"url":"https://github.com/Hoppscotch/httpsnippet/issues"},"author":{"name":"Hoppscotch Team","email":"support@hoppscotch.io"},"license":"MIT","homepage":"https://github.com/Hoppscotch/httpsnippet","keywords":["api","clojure","crystal","csharp","curl","go","har","http","httpie","httr","java","javascript","jquery","kotlin","objc","objective-c","ocaml","php","python","request","requests","ruby","rust","shell","snippet","swift","swift","unirest","xhr","xmlhttprequest"],"repository":{"url":"git+https://github.com/Hoppscotch/httpsnippet.git","type":"git"},"description":"HTTP Request snippet generator for *most* languages","maintainers":[{"email":"liyascthomas@gmail.com","name":"liyasthomas"}],"readme":"# HTTPSnippet\n\n[![version][npm-version]][npm-url] [![License][npm-license]][license-url]\n\n> HTTP Request snippet generator for _many_ languages & tools including: `cURL`, `HTTPie`, `JavaScript`, `Node`, `C`, `Java`, `PHP`, `Objective-C`, `Swift`, `Python`, `Ruby`, `C#`, `Go`, `OCaml`, `Crystal` and [more](https://github.com/Kong/httpsnippet/wiki/Targets)!\n\nRelies on the popular [HAR](http://www.softwareishard.com/blog/har-12-spec/#request) format to import data and describe HTTP calls.\n\nSee it in action on companion service: [APIembed](https://apiembed.com)\n\n[![Build](https://github.com/Kong/httpsnippet/actions/workflows/build.yml/badge.svg)](https://github.com/Kong/httpsnippet/actions/workflows/build.yml) [![Downloads][npm-downloads]][npm-url]\n\n- [HTTPSnippet](#httpsnippet)\n  - [Quickstart](#quickstart)\n    - [Core Concepts](#core-concepts)\n    - [CLI Quickstart](#cli-quickstart)\n    - [TypeScript Library Quickstart](#typescript-library-quickstart)\n  - [CLI Usage](#cli-usage)\n    - [CLI Installation](#cli-installation)\n    - [Example](#example)\n  - [TypeScript Library Usage](#typescript-library-usage)\n    - [Library Installation](#library-installation)\n    - [Types](#types)\n      - [`HarRequest`](#harrequest)\n      - [`HarEntry`](#harentry)\n      - [`TargetId`](#targetid)\n      - [`ClientId`](#clientid)\n      - [`Converter`](#converter)\n      - [`Client`](#client)\n      - [`ClientInfo`](#clientinfo)\n      - [`Extension`](#extension)\n      - [`TargetInfo`](#targetinfo)\n      - [`Target`](#target)\n    - [Library Exports](#library-exports)\n      - [`new HTTPSnippet(source: HarRequest | HarEntry)`](#new-httpsnippetsource-harrequest--harentry)\n      - [`snippet.convert(targetId: string, clientId?: string, options?: T)`](#snippetconverttargetid-string-clientid-string-options-t)\n      - [`isTarget`](#istarget)\n      - [`addTarget`](#addtarget)\n      - [`isClient`](#isclient)\n      - [`addTargetClient`](#addtargetclient)\n  - [Bugs and feature requests](#bugs-and-feature-requests)\n  - [Contributing](#contributing)\n\n## Quickstart\n\n### Core Concepts\n\n1. HTTPSnippet's input is a JSON object that represents an HTTP request in the [HAR Request Object format](http://www.softwareishard.com/blog/har-12-spec).\n1. HTTPSnippet's output is executable code that sends the input HTTP request, in a wide variety of languages and libraries.\n1. You provide HTTPSnippet your desired `target`, `client`, and `options`.\n   - a `target` refers to a group of code generators. Generally, a target is a _programming language_ like `Rust`, `Go`, `C`, or `OCaml`.\n   - `client` refers to a more specific generator within the parent target. For example, the `C#` target has two available clients, `httpclient` and `restsharp`, each referring to a popular C# library for making requests.\n   - `options` are per client and generally control things like specific indent behaviors or other formatting rules.\n\n### CLI Quickstart\n\n```shell\nhttpsnippet har.json \\ # the path your input file (must be in HAR format)\n  --target shell \\ # your desired language\n  --client curl \\ # your desired language library\n  --output ./examples \\ # an output directory, otherwise will just output to Stdout\n  --options '{ \"indent\": false }' # any client options as a JSON string\n```\n\n### TypeScript Library Quickstart\n\n```ts\nimport { HTTPSnippet } from 'httpsnippet';\n\nconst snippet = new HTTPSnippet({\n  method: 'GET',\n  url: 'http://mockbin.com/request',\n});\n\nconst options = { indent: '\\t' };\nconst output = snippet.convert('shell', 'curl', options);\nconsole.log(output);\n```\n\n## CLI Usage\n\n### CLI Installation\n\n| NPM                                         | Yarn                                   |\n| ------------------------------------------- | -------------------------------------- |\n| <pre>npm install --global httpsnippet</pre> | <pre>yarn global add httpsnippet</pre> |\n\n```text\nhttpsnippet [harFilePath]\n\nthe default command\n\nOptions:\n      --help     Show help                                   [boolean]\n      --version  Show version number                         [boolean]\n  -t, --target   target output                     [string] [required]\n  -c, --client   language client                              [string]\n  -o, --output   write output to directory                    [string]\n  -x, --options  provide extra options for the target/client  [string]\n\nExamples:\n  httpsnippet my_har.json --target rust --client actix --output my_src_directory\n```\n\n### Example\n\nThe input to HTTPSnippet is any valid [HAR Request Object](http://www.softwareishard.com/blog/har-12-spec/#request), or full [HAR](http://www.softwareishard.com/blog/har-12-spec/#log) log format.\n\n<details>\n<summary>`example.json`</summary>\n\n```json\n{\n  \"method\": \"POST\",\n  \"url\": \"http://mockbin.com/har?key=value\",\n  \"httpVersion\": \"HTTP/1.1\",\n  \"queryString\": [\n    {\n      \"name\": \"foo\",\n      \"value\": \"bar\"\n    },\n    {\n      \"name\": \"foo\",\n      \"value\": \"baz\"\n    },\n    {\n      \"name\": \"baz\",\n      \"value\": \"abc\"\n    }\n  ],\n  \"headers\": [\n    {\n      \"name\": \"accept\",\n      \"value\": \"application/json\"\n    },\n    {\n      \"name\": \"content-type\",\n      \"value\": \"application/x-www-form-urlencoded\"\n    }\n  ],\n  \"cookies\": [\n    {\n      \"name\": \"foo\",\n      \"value\": \"bar\"\n    },\n    {\n      \"name\": \"bar\",\n      \"value\": \"baz\"\n    }\n  ],\n  \"postData\": {\n    \"mimeType\": \"application/x-www-form-urlencoded\",\n    \"params\": [\n      {\n        \"name\": \"foo\",\n        \"value\": \"bar\"\n      }\n    ]\n  }\n}\n```\n\n</details>\n\n```shell\nhttpsnippet example.json --target shell --client curl --output ./examples\n```\n\n```console\n$ tree examples\nexamples/\n└── example.sh\n```\n\ninside `examples/example.sh` you'll see the generated output:\n\n```shell\ncurl --request POST \\\n  --url 'http://mockbin.com/har?foo=bar&foo=baz&baz=abc&key=value' \\\n  --header 'accept: application/json' \\\n  --header 'content-type: application/x-www-form-urlencoded' \\\n  --cookie 'foo=bar; bar=baz' \\\n  --data foo=bar\n```\n\nprovide extra options:\n\n```shell\nhttpsnippet example.json --target shell --client curl --output ./examples --options '{ \"indent\": false }'\n```\n\nand see how the output changes, in this case without indentation\n\n```shell\ncurl --request POST --url 'http://mockbin.com/har?foo=bar&foo=baz&baz=abc&key=value' --header 'accept: application/json' --header 'content-type: application/x-www-form-urlencoded' --cookie 'foo=bar; bar=baz' --data foo=bar\n```\n\n## TypeScript Library Usage\n\n### Library Installation\n\n| NPM                                       | Yarn                            |\n| ----------------------------------------- | ------------------------------- |\n| <pre>npm install --save httpsnippet</pre> | <pre>yarn add httpsnippet</pre> |\n\n### Types\n\n#### `HarRequest`\n\nSee <https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/har-format> for the TypeScript type corresponding to this type\n\n#### `HarEntry`\n\n```ts\ninterface Entry {\n  request: Partial<HarRequest>;\n}\n\ninterface HarEntry {\n  log: {\n    version: string;\n    creator: {\n      name: string;\n      version: string;\n    };\n    entries: {\n      request: Partial<HarRequest>;\n    }[];\n  };\n}\n```\n\n#### `TargetId`\n\n```ts\ntype TargetId = string;\n```\n\n#### `ClientId`\n\n```ts\ntype ClientId = string;\n```\n\n#### `Converter`\n\n```ts\ntype Converter<T extends Record<string, any>> = (\n  request: Request,\n  options?: Merge<CodeBuilderOptions, T>,\n) => string;\n```\n\n#### `Client`\n\n```ts\ninterface Client<T extends Record<string, any> = Record<string, any>> {\n  info: ClientInfo;\n  convert: Converter<T>;\n}\n```\n\n#### `ClientInfo`\n\n```ts\ninterface ClientInfo {\n  key: ClientId;\n  title: string;\n  link: string;\n  description: string;\n}\n```\n\n#### `Extension`\n\n```ts\ntype Extension = `.${string}` | null;\n```\n\n#### `TargetInfo`\n\n```ts\ninterface TargetInfo {\n  key: TargetId;\n  title: string;\n  extname: Extension;\n  default: string;\n}\n```\n\n#### `Target`\n\n```ts\ninterface Target {\n  info: TargetInfo;\n  clientsById: Record<ClientId, Client>;\n}\n```\n\n### Library Exports\n\n#### `new HTTPSnippet(source: HarRequest | HarEntry)`\n\nName of [conversion target](https://github.com/Kong/httpsnippet/wiki/Targets)\n\n```ts\nimport { HTTPSnippet } from 'httpsnippet';\n\nconst snippet = new HTTPSnippet({\n  method: 'GET',\n  url: 'http://mockbin.com/request',\n});\n```\n\n#### `snippet.convert(targetId: string, clientId?: string, options?: T)`\n\nThe `convert` method requires a target ID such as `node`, `shell`, `go`, etc. If no client ID is provided, the default client for that target will be used.\n\n> Note: to see the default targets for a given client, see `target.info.default`. For example [`shell`'s](src/targets/shell/target.ts) target has the default of `curl`.\n\nMany targets provide specific options. Look at the TypeScript types for the target you are interested in to see what options it provides. For example `shell:curl`'s options correspond to the `CurlOptions` interface in [the `shell:curl` client file](src/targets/shell/curl/client.ts).\n\n```ts\nimport { HTTPSnippet } from 'httpsnippet';\n\nconst snippet = new HTTPSnippet({\n  method: 'GET',\n  url: 'http://mockbin.com/request',\n});\n\n// generate Node.js: Native output\nconsole.log(snippet.convert('node'));\n\n// generate Node.js: Native output, indent with tabs\nconsole.log(\n  snippet.convert('node', {\n    indent: '\\t',\n  }),\n);\n```\n\n#### `isTarget`\n\nUseful for validating that a custom target is considered valid by HTTPSnippet.\n\n```ts\nconst isTarget: (target: Target) => target is Target;\n```\n\n```ts\nimport { myCustomTarget } from './my-custom-target';\nimport { isTarget } from 'httpsnippet';\n\ntry {\n  console.log(isTarget(myCustomTarget));\n} catch (error) {\n  console.error(error);\n}\n```\n\n#### `addTarget`\n\nUse `addTarget` to add a new custom target that you can then use in your project.\n\n```ts\nconst addTarget: (target: Target) => void;\n```\n\n```ts\nimport { myCustomClient } from './my-custom-client';\nimport { HAR } from 'my-custom-har';\nimport { HTTPSnippet, addTargetClient } from 'httpsnippet';\n\naddTargetClient(myCustomClient);\n\nconst snippet = new HTTPSnippet(HAR);\nconst output = snippet.convert('customTargetId');\nconsole.log(output);\n```\n\n#### `isClient`\n\nUseful for validating that a custom client is considered valid by HTTPSnippet.\n\n```ts\nconst isClient: (client: Client) => client is Client;\n```\n\n```ts\nimport { myCustomClient } from './my-custom-client';\nimport { isClient } from 'httpsnippet';\n\ntry {\n  console.log(isClient(myCustomClient));\n} catch (error) {\n  console.error(error);\n}\n```\n\n#### `addTargetClient`\n\nUse `addTargetClient` to add a custom client to an existing target. See [`addTarget`](#addtarget) for how to add a custom target.\n\n```ts\nconst addTargetClient: (targetId: TargetId, client: Client) => void;\n```\n\n```ts\nimport { myCustomClient } from './my-custom-client';\nimport { HAR } from 'my-custom-har';\nimport { HTTPSnippet, addTargetClient } from 'httpsnippet';\n\naddTargetClient('customTargetId', myCustomClient);\n\nconst snippet = new HTTPSnippet(HAR);\nconst output = snippet.convert('customTargetId', 'customClientId');\nconsole.log(output);\n```\n\n## Bugs and feature requests\n\nHave a bug or a feature request? Please first read the [issue guidelines](CONTRIBUTING.md#using-the-issue-tracker) and search for existing and closed issues. If your problem or idea is not addressed yet, [please open a new issue](/issues).\n\n## Contributing\n\nPlease read through our [contributing guidelines](CONTRIBUTING.md). Included are directions for opening issues, coding standards, and notes on development.\n\nFor info on creating new conversion targets, please review this [guideline](https://github.com/Kong/httpsnippet/wiki/Creating-Targets)\n\nMoreover, if your pull request contains TypeScript patches or features, you must include relevant unit tests.\n\nEditor preferences are available in the [editor config](.editorconfig) for easy use in common text editors. Read more and download plugins at <http://editorconfig.org>.\n\n[license-url]: https://github.com/Kong/httpsnippet/blob/master/LICENSE\n[npm-url]: https://www.npmjs.com/package/httpsnippet\n[npm-license]: https://img.shields.io/npm/l/httpsnippet.svg?style=flat-square\n[npm-version]: https://img.shields.io/npm/v/httpsnippet.svg?style=flat-square\n[npm-downloads]: https://img.shields.io/npm/dm/httpsnippet.svg?style=flat-square\n","readmeFilename":"README.md"}