sendex

command module
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2025 License: MIT Imports: 1 Imported by: 0

README

Sendex is a lightweight, file-based tool to make requests to your API

Go to full documentation

Contents

Key Features

  • File and command based, no GUI
  • Lightweight and simple to use
  • Can be used for end-to-end API testing
  • Keeps your request config part of your API source-code
  • Built in Go

Installation

Install Sendex via Homebrew Tap:

brew tap hadlow/sendex
brew install sendex

Test installation by running:

sendex help

Currently only tested for MacOS

Basic Usage

Create a new request

Requests can be created using Sendex via the new command. This command will create a file at the specified file path using a standard template which you can use as a starting point.

sendex new requests/get-todo.yml

This command will create a file at requests/get-todo.yml using the default GET template.

Editing your request

Opening the file will give us this:

args:
  - id: 1 # specify 1 as default
method: GET
endpoint: http://localhost:8000/blog/{id} # we can use 'id' here
headers:
  - Content-Type: application/json
  - Accept: application/json
allow-headers:
  - Content-Type

Click here for full explanation of all parameters that can be used.

  • The args parameter allows us to pass in command line arguments. Formatted like id=2
  • method can be any HTTP method
  • endpoint is the API URL
  • headers must be used in list format
  • allow-headers keeps the output clean, but only showing the headers listed

If you're just trying out Sendex, feel free to use a test API, such as JSON Placeholder. Replace the default endpoint with https://jsonplaceholder.typicode.com/todos/{id}.

Running a request

Once your request file has been updated for your API, it can then be ran using:

sendex run request/get-todo.yml id=123

This should give the following response:

200 OK
Content-Type: application/json; charset=utf-8
{
  "userId": 7,
  "id": 123,
  "title": "esse et quis iste est earum aut impedit",
  "completed": false
}

Credits

Sendex uses the following open source software:

License

MIT


Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL