Crates.io | curlio |
lib.rs | curlio |
version | 0.4.3 |
source | src |
created_at | 2024-09-09 05:19:50.458578 |
updated_at | 2024-09-11 13:53:08.460221 |
description | curlio is a command-line tool built in Rust that mimics the functionality of cURL. It allows you to send HTTP requests to URLs with support for various HTTP methods, custom headers, request body data (including JSON and multipart form data with file uploads), and more. The tool also includes options for verbosity, silence, response storage, file download and retry mechanisms. |
homepage | https://github.com/Kei-K23/curlio |
repository | https://github.com/Kei-K23/curlio |
max_upload_size | |
id | 1368804 |
size | 68,938 |
curlio
is a command-line tool built in Rust
that mimics the functionality of cURL
. It allows you to send HTTP requests to URLs
with support for various HTTP methods, custom headers, request body data (including JSON and multipart form data with file uploads), and more. The tool also includes options for verbosity, silence, response storage, Download file, zip, images, videos and retry mechanisms.
GET
, POST
, PUT
, and DELETE
.curlio
with nice informatics loading indicator.This CLI is published with Cargo
. You can easily download and update with cargo install curlio
command and accept the binary from everywhere.
cargo install curlio
To use curlio
, you need to have Rust installed on your system. You can install Rust from here.
Once Rust is installed, clone the repository and build the project:
git clone https://github.com/Kei-K23/curlio.git
cd curlio
cargo build --release
Run the executable with the necessary arguments to send HTTP requests. Below are the available options:
curlio 0.4.3
Kei-K23
curlio is a cURL implementation in Rust
USAGE:
curlio [OPTIONS] <url>
ARGS:
<url> The URL to send the request to
Options:
-X, --request <method> HTTP method (GET, POST, etc.) [default: GET]
-d, --data <data> Sends the specified data in a POST request
-F, --form <form> Sends multiple form data using JSON structured format (use file path for file uploading)
-H, --header <header> Add headers to the request
-v, --verbose <verbose> Show detail information about request and response <f for False/ t for True> [default: f]
-s, --silent <silent> Suppress all output <f for False/ t for True> [default: f]
-t, --timeout <timeout> Set a timeout for the request (in seconds)
-r, --retry <retry> Number of retry attempts in case of failure
-S, --store <store> Store the response data to file
-A, --user-agent <user_agent> Specify custom User-Agent
-u, --user <basic_auth> Provide basic authentication in the format `username:password`
-L, --location <follow> Follow HTTP redirects <f for False/ t for True> [default: f]
--proxy <proxy> Use HTTP/HTTPS proxy
-D, --download <download> Download file and save them in your file system
--cookies <cookies> Attach cookies to the request
-h, --help Print help
-V, --version Print version
curlio http://example.com
curlio -X POST -d '{"key":"value"}' http://example.com
curlio -H '{"Content-Type": "application/json"}' http://example.com
curlio -t 5 http://example.com
curlio -v t http://example.com
curlio -r 3 http://example.com
curlio "https://fakestoreapi.com/products" -X GET -H '{"Accept": "application/json"}' -S "products.json"
curlio -u "username:password" http://example.com
curlio -H '{"Authorization": "Bearer your_token_here"}' http://example.com
# Example cookies json file (name what ever you want just to be sure to be .json file)
# [
# {
# "name": "session-id",
# "value": "235-3769708-3150250"
# },
# {
# "name": "ubid-main",
# "value": "134-3687901-5787569"
# },
# {
# "name": "session-token",
# "value": "\"JKASDIUivnisduhfisd213biHUKLFbnoisd2344325\""
# }
# ]
curlio 'https://fakestoreapi.com/products' -X GET -H '{"Accept": "application/json"}' --cookies cookies.json
curlio "https://file-examples.net/wp-content/uploads/2024/02/SampleTextFile_1MB.txt" -D test.txt
# Example Output
Starting download of 1023385 bytes...
Progress: [############################# ] 58.20% (595608/1023385)
If the request fails and no retries are specified, an error message will be displayed in the terminal:
Request failed: <Error message>
If retries are enabled, it will retry the request up to the specified count, and you will see output like:
Attempt 1 failed, retrying... (<Error message>)
This project is licensed under the MIT License - see the LICENSE file for details.
All contributions are welcome. Please open issues or make PR for error, bug, and adding new features.