Resto — a CLI app can send pretty HTTP & API requests with TUI

Installation

Using script

  • Shell
curl -fsSL https://git.io/resto | bash
  • PowerShell
iwr -useb https://git.io/resto-win | iex

Go package manager

go install github.com/abdfnx/resto@latest

GitHub CLI

gh extension install abdfnx/gh-resto

Usage

  • Open Resto UI
resto
  • Send a request to a URL
resto get https://api.github.com
  • Send a request to a URL and use resto editor
resto post https://https://localhost:3000/v1/login — content-type json --editor
  • Read Body from stdin
cat schema.graphql | resto post https://api.spacex.land/graphql —content-type graphql — body-stdin
  • Use Authentecation with Basic Auth or Bearer Token
# Bearer Token
resto delete https://api.secman.dev/api/logins/13 — content-type json — token TOKEN
# Basic Auth
resto delete https://api.secman.dev/api/logins/13 — content-type json — username USERNAME — password PASSWORD
  • Save response to a file
resto get http://localhost:3333/api/v1/hello — save response.json

Flags

-H, --headers           Just show the response headers
-j, --just-body Just show the response body
-p, --password string The password to use for basic authentication
-s, --save string Save the response body to a file
-t, --token string The bearer token to use for authentication
-u, --username string The username to use for basic authentication
-b, --body string           The body of the request
-i, --body-stdin Read the body from stdin
-c, --content-type string The content type of the body
-e, --editor Open the editor to edit the body
-H, --headers Just show the response headers
-j, --just-body Just show the response body
-p, --password string The password to use for basic authentication
-s, --save string Save the response to a file
-t, --token string The bearer token to use for authentication
-u, --username string The username to use for basic authentication

Documentation

--

--

--

someone likes CLI/TUI apps, automation, server-sides, and backend.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Let’s Try to Reduce With JavaScript

JavaScript ES2021 (ES12) New Features

How to Create Circuit Breaker in TypeScript

Text Editor & Extensions for Web Development.

visual studio download site

Day 3 of 165~Reversing Arrays Without Using .reverse()

Javascript : How to wait in for loop?

jQuery — Element Index and Event Object

Understand the Closure in easiest way-JavaScript

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Abdfnabd

Abdfnabd

someone likes CLI/TUI apps, automation, server-sides, and backend.

More from Medium

Build Go via Alpine Image and Run it from Scratch

Memory usage analysis for a go application on Linux

Writing a simple WebApi with Golang and MsSql

How to create a CLI in Golang