Curlio - A cURL Implementation in Rust
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.
Features
- Supports common HTTP methods like
GET
,POST
,PUT
, andDELETE
. - Allows custom headers to be passed in JSON format.
- Sends request body data in various formats.
- Supports multipart form data including file uploading.
- Optional verbose mode to show detailed request and response information.
- Silent mode to suppress output.
- Option to store response data to a file.
- Timeout configuration.
- Retry mechanism for handling failed requests.
- Basic and Bearer authentication support.
- Download file, zip, images and videos using
curlio
with nice informatics loading indicator.
Installation
This CLI is published with Cargo
. You can easily download and update with cargo install curlio
command and accept the binary from everywhere.
Local setup
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:
Usage
Run the executable with the necessary arguments to send HTTP requests. Below are the available options:
<url> The
)
)
)
Examples
Main Options
- Simple GET request:
- POST request with data:
- GET request with custom headers:
- GET request with a timeout:
- Verbose mode:
- Retry on failure:
- Store the response data to file:
- Basic Authentication:
- Bearer Token Authentication:
- Cookies file support. Add cookies values to request header:
# 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\""
# }
# ]
- Download files, zips, images, videos as you wish
# Example Output
)
Error Handling
If the request fails and no retries are specified, an error message will be displayed in the terminal:
If retries are enabled, it will retry the request up to the specified count, and you will see output like:
)
Todo
- Make binary for other installer methods.
- Add test cases to cover all use cases.
- Additional features and improvements.
LicenseĀ
This project is licensed under the MIT License - see the LICENSE file for details.
Contribution
All contributions are welcome. Please open issues or make PR for error, bug, and adding new features.