A command-line HTTP client tool that simplifies API requests using configurable URL aliases and a CLI syntax. It is a CLI meant to simplify constant and useful HTTP requests without relying on more complex HTTP clients like cURL.
It allows you to make API requests using predefined URL aliases instead of full URLs. It's designed to streamline your workflow when working with multiple APIs by providing a simple, intuitive command-line interface with configuration-based URL management.
ashttp httpbin get users 456 profile --include "posts,comments"
# Will be equivalent to:
# curl https://httpbin.dev/anything/users/456/profile?include=posts,commentsThis solves the common overhead problem of managing multiple API endpoints with all sorts of authorization and specific headers.
ashttp <URL-alias> <http-method> [path-components...] [--option value]The configuration file is automatically created at ~/.config/ashttp/config.json with a default httpbin example:
{
"httpbin": {
"url": "https://httpbin.dev/anything",
"defaultHeaders": {
"authorization": "123"
}
}
}Using this configuration, the command below demonstrates how ashttp translates to the equivalent curl request:
ashttp httpbin get users 456 profile --include "posts,comments"
# Will be equivalent to:
# curl https://httpbin.dev/anything/users/456/profile?include=posts,comments \
# -H "authorization: 123"go install github.com/ashttp@latestThis project is currently under development so unexpected behaviors may happen. Only GET and DELETE methods are supported until now.
Check the releases page to see more details about versions and binaries.