TopGit tracks Kong/httpsnippet on GitHub. The project has 1.2k stars. HTTP Request snippet generator for many languages & libraries
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
HTTPSnippet's input is a JSON object that represents an HTTP request in the HAR Request Object format.
HTTPSnippet's output is executable code that sends the input HTTP request, in a wide variety of languages and libraries.
You provide HTTPSnippet your desired target, client, and options.
a target refers to a group of code generators. Generally, a target is a programming language like Rust, Go, C, or OCaml.
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.
options are per client and generally control things like specific indent behaviors or other formatting rules.
CLI Quickstart
httpsnippet har.json \ # the path your input file (must be in HAR format)
--target shell \ # your desired language
--client curl \ # your desired language library
--output ./examples \ # an output directory, otherwise will just output to Stdout
--options '{ "indent": false }' # any client options as a JSON string
httpsnippet [harFilePath]
the default command
Options:
--help Show help [boolean]
--version Show version number [boolean]
-t, --target target output [string] [required]
-c, --client language client [string]
-o, --output write output to directory [string]
-x, --options provide extra options for the target/client [string]
Examples:
httpsnippet my_har.json --target rust --client actix --output my_src_directory
Example
The input to HTTPSnippet is any valid HAR Request Object, or full HAR log format.
The 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.
Note: to see the default targets for a given client, see target.info.default. For example shell's target has the default of curl.
Many 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.
import { myCustomClient } from './my-custom-client';
import { HAR } from 'my-custom-har';
import { HTTPSnippet, addTargetClient } from 'httpsnippet';
addTargetClient('customTargetId', myCustomClient);
const snippet = new HTTPSnippet(HAR);
const output = snippet.convert('customTargetId', 'customClientId');
console.log(output);
Bugs and feature requests
Have a bug or a feature request? Please first read the issue guidelines and search for existing and closed issues. If your problem or idea is not addressed yet, please open a new issue.
Contributing
Please read through our contributing guidelines. Included are directions for opening issues, coding standards, and notes on development.
For info on creating new conversion targets, please review this guideline
Moreover, if your pull request contains TypeScript patches or features, you must include relevant unit tests.
Editor preferences are available in the editor config for easy use in common text editors. Read more and download plugins at http://editorconfig.org.
The most recent commit recorded on Kong/httpsnippet was 4 months ago, based on the GitHub push timestamp. The repository has 241 forks — one of the better signals of community interest.
How many stars does Kong/httpsnippet have?
Kong/httpsnippet has 1.2k GitHub stars — refresh the page for the live number, or check github.com/Kong/httpsnippet. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
What language is Kong/httpsnippet written in?
Kong/httpsnippet is written primarily in TypeScript. GitHub's language field is based on the largest share of bytes in the default branch.
What topics is Kong/httpsnippet associated with?
GitHub's repository topics for Kong/httpsnippet: "hacktoberfest". TopGit's editorial category is open-source.
Where do I read more about Kong/httpsnippet?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/Kong/httpsnippet is the definitive source.
Read full README in the tab above.
Still deciding about httpsnippet?
One click hands the question to an AI along with this page — see what it says about httpsnippet.