Điểm qua Kong/httpsnippet: 1.2k sao trên GitHub, viết chủ yếu bằng TypeScript. HTTP Request snippet generator for many languages & libraries
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
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.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/Kong/httpsnippet là nguồn chính thức.
Kong/httpsnippet có bao nhiêu sao?
Kong/httpsnippet có 1.2k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/Kong/httpsnippet. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
Kong/httpsnippet có những chủ đề gì?
GitHub topics của Kong/httpsnippet: "hacktoberfest". TopGit xếp repo vào nhóm mã nguồn mở.
Kong/httpsnippet còn đang phát triển không?
Commit gần nhất trên Kong/httpsnippet là 4 tháng trước (theo timestamp GitHub). Repo có 241 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
Kong/httpsnippet viết bằng ngôn ngữ gì?
Kong/httpsnippet chủ yếu viết bằng TypeScript. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
httpsnippet có đáng để bạn bỏ thời gian?
ChatGPT, Claude và Perplexity đều đọc được trang này. Hỏi thử xem họ nghĩ gì về httpsnippet.