Welcome to my HTTP REST client project, built with Rust to streamline API testing and development processes. This powerful tool incorporates a full-fledged file parsing system and a user-friendly terminal UI for an intuitive user experience.
-
๐ป Terminal UI: The terminal UI provides a seamless and user-friendly interface for making and managing HTTP requests.
-
๐ Custom File Parsing System: The custom file parsing system allows for efficient handling of data, enhancing the versatility of the client.
To use the system, follow these steps:
- Clone the Repository: Clone the repository to your local machine.
git clone https://github.com/ItsHyde-dev/http-client-rust.git
- Install Dependencies: Navigate to the project directory and use Cargo to install the client.
cd http-client-rust
cargo install --path ./
- Load Requests: To load requests into the system, use the following command with the path to your request file.
http-client -p <filepath>
The HTTP REST client project supports a custom file format for specifying requests by using "-m custom". This structure allows for easy organization and customization of HTTP requests. Below is an example of the file format:
########
{
name: Sample GET Request
url: https://api.example.com/data
method: GET
}
######
{
name: Sample POST Request
url: https://api.example.com/create
method: POST
headers:
{
"Content-Type": "application/json"
},
body:
{
"key": "value"
}
}
#####
{
name: Sample PUT Request
url: https://api.example.com/update
method: PUT
headers:
{
"Authorization": "Bearer YOUR_ACCESS_TOKEN"
},
body:
{
"updated_key": "updated_value"
}
}
-
For the
headersandbodyfields, ensure that the provided JSON is valid, containing key-value pairs. -
The opening and closing curly brackets for the JSON in both
headersandbodyshould be on a new line for proper formatting. -
The keys for the format should not be enclosed in "". (This is due to personal taste)
Example:
headers: { "Content-Type": "application/json" }, body: { "key": "value" }
Moving forward, I plan to enable the system to send multipart form data with file attachments, further enhancing its capabilities for handling various types of requests.
I'm excited to continue evolving this project and welcome any feedback or collaboration opportunities.
