kriogenia / rede

CLI tool to run and configure suites of HTTP requests defined in readable files
http://rede.sotoestevez.dev/
Apache License 2.0
1 stars 3 forks source link
cli hacktoberfest http-requests rust toml

Rede

Rust CI Crates.io Version

rede (galician word for "net") is a command-line utility to help run suites of requests to ease the usage and testing of REST APIs. The main inspiration for this project comes from Bruno and their command line tool.

The main goal behind this project is to have a suite of text files representing HTTP requests that will be picked and executed by rede, allowing for easy sharing and control versioning of these requests.

Execution of rede

The --verbose looks good too:

How verbose looks

Installation

As this still an early stage of the project the only way of installing it is using cargo, so you would need to have Rust installed and run:

cargo install rede

You can also build it yourself (adding --no-default-features you can install the minimal version)

git clone https://github.com/kriogenia/rede.git
cargo build -p rede

How to run

rede works using a DSL of TOML schemas. All the documentation regarding rede DSL is still under development, but a request to get a couple of good boy facts would look like this:

[http]
method = "GET"
url = "https://dogapi.dog/api/v2/facts"

[headers]
Accept = "application/json"
User-Agent = "rede/v0.1.0"

[query_params]
limit = 2

You can generate a similar but more feature-rich request executing the rede example command. Then, once you have a valid request like the one generated by the example you only need to run it with rede:

rede run <your_file>

Local development

In order to work with rede while collaborating in the project or working in your own fork you'll need to specify the package you plan to build or run. For example, to build the parser from the root, just run:

cargo build -p rede_parser

And if you plan to execute a request with the compiled binary you can do something like:

cargo run -p rede -- example

It is also possible to just navigate to the package directory and work from there:

cd placeholders
cargo build