Thanks to visit codestin.com
Credit goes to lib.rs

9 releases

Uses new Rust 2024

0.2.4 Dec 11, 2025
0.2.3 Oct 28, 2025
0.1.3 Oct 29, 2024
0.1.1 Aug 8, 2024

#209 in Authentication

MIT license

20KB
348 lines

fetchr

A simple CLI tool to make HTTP requests.

This project aims to be a Rust-based implementation of a CLI tool similar to curl.

You can specify a URL, query parameters, body, headers, cookies, etc., via CLI options, and the tool prints the HTTP response code and body to the terminal.

Install

Currently, the tool is only installable via cargo:

cargo install fetchr

Run the same command to update the tool.

Examples

  • fetchr <url>: A GET request
  • fetchr <url> -m post -b 'hello there!': A POST request with text payload
  • fetchr <url> -m post -b '{text: "general kenobi!"}' --json-body: A POST request with JSON payload. The JSON content is parsed and validated before dispatching the request.
  • fetchr <url> -H 'Authorization=Bearer 12345': A request with headers
  • fetchr <url> -a 'Bearer 12345': Shorthand notation for an authorization header
  • fetchr <url> -m patch -F name=obiwan -F occupation=jedi: A PATCH request with a multipart form-data body
  • fetchr <url> --print-headers: Also print response headers

There are more options, just run fetchr -h.

The status and header reports are printed to stderr, therefore the body can easily be piped into file:

  • fetchr <url> --print-headers > image.png: Print status code and header to the terminal, but the actual body of the response to image.png.

At this point, the README documentation is deliberately vague because the options might change, features be added or modified, etc. This will of course not be the case when this tool reaches 1.0.

If you need something this tool cannot do yet, please file an issue or PR. I myself am developing fetchr while I am using it at work.

Dependencies

~9–23MB
~276K SLoC