Api testing tool made with rust to use for api developement (Kind of Tui)

Related tags

Command-line Fastreq
Overview

Api testing tool made with rust to use for api developement (Kind of Tui)

This Rust project provides a simple yet powerful tool for making HTTP requests and handling responses. Built with reqwest for performing HTTP requests, tokio for asynchronous runtime, and serde_json for JSON parsing, it offers functionalities to make GET, POST, PUT, and PATCH requests, manage request headers and body, and pretty-print JSON responses.

Image description

Features

  • Support for various HTTP methods: GET, POST, PUT, PATCH.
  • JSON body and headers configuration via external files.
  • Pretty-printing JSON responses directly within the application.
  • Configuration through a config.json file for default values.
  • Synchronous reading of user inputs and asynchronous request handling.

Requirements

  • Rust programming language
  • Cargo package manager

Installation

  1. Clone the repository to your local machine:
git clone https://github.com/Kythonlk/rust-api-client.git
cd rust-api-client
  1. Build the project:
cargo build
  1. Run the project:
cargo run

Usage

After running the application, follow the on-screen prompts to:

  1. Enter the URL or leave blank to use the URL from config.json.
  2. Select the request type (GET, POST, PUT, PATCH).
  3. If applicable, specify the path to the JSON body file for POST, PUT, or PATCH requests.
  4. Decide whether to add headers from a file and specify the path to the JSON headers file if yes.
  5. View the pretty-printed JSON response or raw response text in the console.

Configuration

  • config.json: Set default values for the URL and any other configurations you might need.
  • JSON files for request bodies and headers: Format according to the requirements of your API endpoint.

Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue for any bugs, feature requests, or improvements.

You might also like...
A workflow tool for quickly running / testing something you are working on

runfast What is it? This is a program intended to be run in a project directory to set up a project run command, and remember it so we dont have to ty

Server load testing CLI tool 🏋️

🔥 Rhea A Server Load Testing Tool Rhea is a powerful and easy-to-use command-line tool written in Rust for load testing servers. It allows you to sim

Blockoli is a high-performance tool for code indexing, embedding generation and semantic search tool for use with LLMs.
Blockoli is a high-performance tool for code indexing, embedding generation and semantic search tool for use with LLMs.

blockoli 🥦🔎 Blockoli is a high-performance tool for code indexing, embedding generation and semantic search tool for use with LLMs. blockoli is buil

A Rust-based shell script to create a folder structure to use for a single class every semester. Mostly an excuse to use Rust.

A Rust Course Folder Shell Script PROJECT IN PROGRESS (Spring 2022) When completed, script will create a folder structure of the following schema: [ro

🌳 A lightning-fast system fetch tool made with Rust.
🌳 A lightning-fast system fetch tool made with Rust.

🌳 treefetch A lightning-fast minimalist system fetch tool made in Rust. Even faster than neofetch and pfetch. Made to practice my new Rust skills 🦀

Simple joke randomizer from bash.org.pl made as CLI Tool in Rust.

RBashOrg Simple joke randomizer from bash.org.pl made as CLI Tool in Rust. Description Main motivation of this project was to learn basic concepts abo

Rust TUI client for steamcmd
Rust TUI client for steamcmd

Steam TUI About Just a simple TUI client for steamcmd. Allows for the graphical launching, updating, and downloading of steam games through a simple t

Another TUI based system monitor, this time in Rust!
Another TUI based system monitor, this time in Rust!

Another TUI based system monitor, this time in Rust!

A user-friendly TUI client for Matrix written in Rust!

Konoha A user-friendly TUI client for Matrix written in Rust! Notice: The client is currently not usable and is only hosted on GitHub for version cont

Releases(v0.1.0)
  • v0.1.0(Feb 14, 2024)

    Release Notes for FastReq Version 0.1

    Introduction

    FastReq 0.1 is the initial release of our lightweight, powerful command-line utility designed for making HTTP requests. This release includes support for GET and POST requests, customizable request headers and body content through JSON files, and a default configuration mechanism.

    Features

    • HTTP Request Types: Supports GET and POST requests with easy command-line switches.
    • Custom Headers and Body: Allows users to specify custom headers and body content for POST requests via external JSON files.
    • Configuration File Support: Includes a default configuration file (config.json) for setting commonly used parameters.
    • Response Time Measurement: Offers an option to measure and display the response time for each request.
    • Simplified Command-Line Usage: Designed with simplicity in mind, providing clear and concise command-line options.

    How to Run FastReq

    After extracting the provided fastreq.zip file, you will find the fastreq binary along with example body.json, header.json, and config.json files. Here's how to run FastReq in a production environment:

    1. Ensure Required Files Are Present: Make sure body.json, header.json, and config.json are in the same directory as the fastreq binary or specify their paths when running commands.

    2. Execute a Request: Run FastReq from the command line by navigating to the directory containing the fastreq binary and executing it with the appropriate flags. Below are some example commands:

      • GET Request:

        ./fastreq -u 'http://example.com' -t g
        
      • POST Request (using body.json and header.json):

        ./fastreq -u 'http://example.com' -t p -b body.json -H header.json
        
      • Measure Response Time for a GET request:

        ./fastreq -u 'http://example.com' -t g -m
        

    Release Package Contents

    The fastreq.zip file includes the following:

    • fastreq: The executable binary for FastReq.
    • body.json: An example JSON file for HTTP POST body content.
    • header.json: An example JSON file containing custom request headers.
    • config.json: The default configuration file, which can be customized as needed.

    System Requirements

    FastReq is built to run on Unix-like operating systems, including Linux and macOS. Windows support is pending.

    Installation

    No formal installation is required. Simply extract fastreq.zip and run the fastreq binary from the command line. Ensure executable permissions are set correctly (e.g., using chmod +x fastreq on Unix-like systems).

    Support and Contributions

    For support, feature requests, or contributions, please visit [GitHub repository URL]. We welcome community feedback and contributions to improve FastReq in future releases.


    This release note provides a concise overview of FastReq's capabilities, usage, and contents of the release package. Adjust the GitHub repository URL and any specific instructions or descriptions according to your actual project details and hosting arrangements.

    Source code(tar.gz)
    Source code(zip)
    fastreq.zip(2.63 MB)
Owner
Kythonlk
Kythonlk
A template for bootstrapping a Rust TUI application with tui-rs & crossterm

rust-tui-template A template for bootstrapping a Rust TUI application with tui-rs & crossterm. tui-rs The library is based on the principle of immedia

Orhun Parmaksız 72 Dec 31, 2022
A universal load testing framework for Rust, with real-time tui support.

rlt A Rust Load Testing framework with real-time tui support. rlt provides a simple way to create load test tools in Rust. It is designed to be a univ

Wenxuan 129 Jul 20, 2024
A WIP property-based testing library in Rust, built with generalized targeted-property testing in mind.

Crabcheck A WIP property-based testing library in Rust, built with generalized targeted-property testing in mind. What is property-based testing? TODO

Alperen Keleş 9 Mar 27, 2024
A simple TUI password manager made in Rust.

IronKey IronKey is a Terminal User Interface (TUI) based password generator written in Rust. It leverages the power of Rust's performance and safety f

Kekma 3 Feb 23, 2024
An easy-to-use TUI crate for Rust, based off of the Elm architecture.

Rustea An easy-to-use TUI crate for Rust, based off of the Elm architecture. This is a re-implementation of Go's Tea, created by TJ Holowaychuk. Featu

Laz 82 Dec 21, 2022
TimeKnight is a neat little TUI-based timer app I use in conjunction with a task tracker

TimeKnight is a neat little TUI-based timer app I use in conjunction with a task tracker. It's kind of a secret sauce for productivity (particularly if you have ADHD or have a ridiculously overactive brain).

Monomadic 1 Feb 8, 2022
A simple, TUI git management tool

Gitten Gitten is git project manager with multiple repositories. With gitten you can check out to new branches and tag branches from you active. Prere

Hamza Oral 12 Mar 31, 2023
booky is a minimalstic Tui tool for managing your growing book collection.

booky booky is a minimalistic TUI tool for managing your growing book collection. It is writtin in Rust and uses diesel as it's orm together with sqli

null 3 Jul 21, 2023
A dead simple functional testing tool for command line applications

Pharaoh : build that test pyramid! What it is Pharaoh is a dead simple, no permission needed, functional test runner for command line applications, wr

Kevin Sztern 17 Dec 13, 2021
Croc-look is a tool to make testing and debuging proc macros easier

croc-look croc-look is a tool to make testing and debuging proc macros easier by these two features Printing the implementation specific generated cod

weegee 7 Dec 2, 2022