Skip to content

vkstrm/hur

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HUR

Command-line utility for making HTTP requests.

Note: This program is not better than Curl. It will contain bugs and is unlikely to fully conform to the HTTP specification. I am however having fun writing it and find it to be useful in some situations.

Installation

cargo install hur

Dependencies

On Ubuntu, in addition to Rust, you will need sudo apt install build-essential libssl-dev pkg-config.

Or let Cargo tell you what you need.

Usage

GET is the default method.

hur https://petstore.com/animals -h "header:value"

To use another method add --method

hur https://petstore.com/animals --method POST --body '{"name":"Luffy"}'

Using --verbose mode will print, in JSON, the request and response objects.

{
    "request": {
        "method": "GET",
        "headers": {},
        "path": "/animals",
        "etc" "..."
    },
    "response": {
        "statusCode": 200,
        "body": "{}",
        "etc": "..."
    }
}

Use --help for more information.

Proxy

Proxy support with HTTP_PROXY, HTTPS_PROXY and NO_PROXY environment variables. Disable proxy for a request using --no-proxy