1 unstable release
new 0.1.0 | Nov 19, 2024 |
---|
#1726 in Network programming
47 downloads per month
14KB
102 lines
hxr
A simple HTTP request CLI tool
Installation
cargo install hxr
Ensure ~/.cargo/bin
is in your PATH
echo $PATH
- If needed, add it manually to your shell configuration:
export PATH="$HOME/.cargo/bin:$PATH"
- Run the
hxr
command directly from the terminal:
hxr --help
Usage
- Make a
GET
request to api.ipify.org- Returns your IP address
hxr https://api.ipify.org/
- Make a
POST
request
hxr -m POST https://api.example.org/ -b bodyToSend
Adding headers
With Headers
Run the command with headers:
- Adding JSON as the content type will prettify the JSON in the terminal
hxr --method GET https://httpbin.org/headers -h "content-type:application/json" -h "Authorization:Bearer token123"
Without Headers
Run a simple GET request:
hxr -m GET https://api.ipify.org/
Dependencies
~7–20MB
~270K SLoC