Skip to content

Commit acec9e1

Browse files
committed
add readme
1 parent f147979 commit acec9e1

3 files changed

Lines changed: 34 additions & 3 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "fetchr"
33
version = "0.2.1"
44
edition = "2024"
55
license = "MIT"
6-
description = "A versatile Rust CLI tool for making HTTP requests"
6+
description = "A simple CLI tool to make HTTP requests"
77
repository = "https://github.com/jim-ec/fetchr"
88
readme = "README.md"
99

README.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
11
# fetchr
22

3-
A simple fetch utility for fetching data from the web.
3+
A simple CLI tool to make HTTP requests.
4+
5+
This project aims to be a Rust-based implementation of a CLI tool similar to curl.
6+
7+
You can specify a URL, query parameters, body, headers, cookies, etc., via CLI options,
8+
and the tool prints the HTTP response code and body to the terminal.
9+
10+
## Install
11+
12+
Currently, the tool is only installable via `cargo`:
13+
14+
```sh
15+
cargo install fetchr
16+
```
17+
18+
Run the same command to update the tool.
19+
20+
## Examples
21+
22+
- `fetchr <url>`: A GET request
23+
- `fetchr <url> -m post -b 'hello there!'`: A POST request with text payload
24+
- `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.
25+
- `fetchr <url> -H 'Authorization=Bearer 12345'`: A request with headers
26+
- `fetchr <url> -a 'Bearer 12345'`: Shorthand notation for an authorization header
27+
- `fetchr <url> -m patch -F name=obiwan -F occupation=jedi`: A PATCH request with a multipart form-data body
28+
- `fetchr <url> --print-headers`: Also print response headers
29+
30+
There are more options, just run `fetchr -h`.
31+
32+
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`.
33+
34+
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.

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ struct Cli {
102102
#[derive(Args, Debug)]
103103
#[group(required = false, multiple = false)]
104104
struct AuthType {
105-
/// Short hand notation for the `Authorization` header.
105+
/// Shorthand notation for the `Authorization` header.
106106
#[arg(short = 'a', long = "auth")]
107107
auth: Option<String>,
108108

0 commit comments

Comments
 (0)