Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brian3647/qli
🐳 extremelly small rust binary to generate http requests using json/yaml
https://github.com/brian3647/qli
cli fast http json request rust yaml
Last synced: 4 months ago
JSON representation
🐳 extremelly small rust binary to generate http requests using json/yaml
- Host: GitHub
- URL: https://github.com/brian3647/qli
- Owner: Brian3647
- License: mit
- Created: 2023-10-30T16:18:16.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-30T16:31:00.000Z (over 1 year ago)
- Last Synced: 2024-10-08T08:44:40.650Z (4 months ago)
- Topics: cli, fast, http, json, request, rust, yaml
- Language: Rust
- Homepage: https://crates.io/crates/qli
- Size: 16.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/funding.yml
- License: LICENSE
Awesome Lists containing this project
README
# qli 🐳
Extremelly small rust binary to generate http requests using json/yaml.
![License](https://img.shields.io/github/license/Brian3647/qli)
![GitHub issues](https://img.shields.io/github/issues/Brian3647/qli)
![Build status](https://img.shields.io/github/actions/workflow/status/Brian3647/qli/rust.yml)## Installation
_Requires [cargo (rustlang)](https://www.rust-lang.org/)_
For the CLI, run `cargo install qli` and use it with the `qli` command.
For the library, just run `cargo add qli`## Usage (library)
`qli` exports 2 functions, `from_yaml` and `from_json`, which generate and send a web request and return an anyhow result with the response. It also exports the `RequestConfig` struct, but it isn't realy useful outside the library.
## Usage (CLI)
### Command usage:
```
qliUSAGE:
qli [FLAGS] [OPTIONS]FLAGS:
-h, --help Prints help information
-V, --version Prints version information
-v, --verboseOPTIONS:
-o, --outputARGS:
```### example yaml/json file structure:
```yaml
# test.yamlurl: http://localhost:3000
method: get
headers:
X-header1: my-header
body: |
{ "abc": "dce" }
``````jsonc
// test.json{
"url": "https://localhost:3000",
"method": "get",
"headers": {
"my-header": "1234"
},
"body": "my body"
}
```_note that for simplicty reasons `body` needs to be a string, so we recommend using yaml if you want to have an easier time writing json bodies._
## Acknowledgments
This project was inspired by [requestr](https://github.com/Semptic/requestr), which is licensed under the MIT License. The original license can be found [here](https://github.com/Semptic/requestr/blob/main/LICENSE).