fetchr

Crates.iofetchr
lib.rsfetchr
version0.2.4
created_at2024-08-08 12:46:04.74615+00
updated_at2025-12-11 14:04:26.28157+00
descriptionA simple CLI tool to make HTTP requests
homepage
repositoryhttps://github.com/jim-ec/fetchr
max_upload_size
id1329503
size69,208
Jim (jim-ec)

documentation

README

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.

Commit count: 13

cargo fmt