rh

Crates.iorh
lib.rsrh
version0.1.14
sourcesrc
created_at2022-02-04 22:49:35.08861
updated_at2022-02-21 23:39:36.97175
descriptionA user-friendly command-line tool to request HTTP APis
homepagehttps://github.com/twigly/rh
repositoryhttps://github.com/twigly/rh
max_upload_size
id527143
size218,153
(twigly)

documentation

README

CI CD

rh: user-friendly command-line HTTP client

rh is a user-friendly, lightweight and performant command-line tool to request HTTP APis. You can debug, test and verify any HTTP APi with rh in a simple and efficient way. rh is focused on performance and stability. You don't need OpenSSL because rh is based on Rustls, a modern TLS library alternative to OpenSSL.

rh is a standalone application with no runtime or garbage collector, so it doesn't require Python or Java installed on your machine for example. rh is based on Rust that is a blazing fast and memory-efficient language.

The name rh stands for Rust HTTP.

Getting started

Installation guide

Contributing guide

Features

You can already use rh, some features are not available yet. And new features will come based on your requests (please file an issue to do so).

  • Simple syntax to be more intuitive

  • Easy file download & upload

  • JSON made simple for command-line

  • JSON-friendly

  • Headers made simple for command-line

  • Self-signed SSL certificates

  • Don't repeat yourself with aliases

  • Package manager

  • Multi URLs

  • Better help & version (help & version)

  • More to do

Don't repeat yourself

If you're used to execute very often the same requests, you can save time. An alias helps to change default values or create shortcuts. You can predefine what you like, it could be only the headers for example, or everything.

For example, someone could create an alias mp1-status (that would stand for "my-project-1" for example). Let's say you want to execute the following command very often:

> rh http://local-dev-mp1/status -UHhc X-Custom-Header:My-app

-UHhc to show the -URL and the method + to show the request -Headers + to show the response -headers + to show a -compact response

> rh alias @mp1-status http://local-dev-mp1/status -UHhc X-Custom-Header:My-app

So now, you can reuse this config:

> rh @mp1-status

See more about aliases

Examples

Who doesn't like "Hello, World!":

> rh httpbin.org/get

Change the method:

> rh HEAD https://httpbin.org/anything

Localhost with a particular port:

> rh :9200

You can POST data as JSON (it's the default format, see more about it):

> rh https://httpbin.org/anything X-App:Super1 item1=Hello item2=World

You can POST data using the URL encoded format:

> rh https://httpbin.org/anything key1=1 --form

You can POST raw data:

> rh https://httpbin.org/anything --raw=hello

You can download a file and save it:

> rh https://httpbin.org/image/jpeg > image.jpeg

More examples

License

rh is distributed under the terms of the MIT license. See LICENSE for details.

Contributing

If you are interested in contributing to the rh project, please take a look at the contributing guide. If you'd like to request a feature or report a bug, please create a GitHub issue.

Thanks to the people developing the third party libraries used in this project.

Commit count: 108

cargo fmt