httpie/httpcat — 255★ trên GitHub (Python). httpcat is a simple utility for constructing raw HTTP requests on the command line.
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.
httpcat is a simple utility for constructing raw HTTP
requests on the command line.
Why?
Sometimes it is useful to be able to create an actual raw
HTTP request
on the command line:
To debug a server issue
To test the handling of invalid HTTP requests
To learn how HTTP works under the hood
In such cases, existing CLI HTTP clients—such as
httpie,
curl,
or wget
—are too high-level as they provide
an abstraction layer and one doesn't have a complete control over the
exact raw data that gets written to the HTTP socket connection.
Lower-level tools, such as the popular
netcat, are better suited for this
job.
However, the syntax of HTTP requires headers to be separated with
\r\n which makes it difficult to produce them on the command line.
A typical solution involves the use of echo:
Specify the whole request in the arguments. Here '' represents an empty
line which will be converted to \r\n\ separating the headers and the
body. Note also that the omitted HTTP-Version is auto-completed:
usage: httpcat [-h] [-V, --version] [-v] [-n] [line [line ...]]
Create raw HTTP requests on the command line.
positional arguments:
line input lines read before lines from stdin
optional arguments:
-h, --help show this help message and exit
-V, --version show program's version number and exit
-v, --verbose print info about output lines to stderr
-n, --no-stdin disable reading of lines from stdin
Dependencies
Python 3
Installation
pip3 install httpcat
Alternatively, you can just download httpcat.py manually and invoke
it as ./httpcat.py instead of httpcat.
Tests
python3 setup.py test
HTTPie offline mode
HTTPie CLI starting with version 2.0.0 also provides an --offline mode. This makes it a good alternative to httpcat because it provides a convenient mechanism for crafting arbitrary HTTP requests without sending them using the user-friendly HTTPie syntax, for example:
echo -n 'Hello' | http --offline POST httpbin.org/post
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/httpie/httpcat là nguồn chính thức.
httpie/httpcat có bao nhiêu sao?
httpie/httpcat có 255 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/httpie/httpcat. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.