resto

command module
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2021 License: MIT Imports: 11 Imported by: 0

README

Resto

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

demo

Installation

Using script

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

then restart your powershell

Go package manager

go install github.com/abdfnx/resto@latest

GitHub CLI

gh extension install abdfnx/gh-resto

Via Docker

docker run -it restohq/resto <CMD>

full container:

docker run -it restohq/resto-full

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://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
    
  • Install binary app from script URL and run it.

    resto i https://get.docker.com
    
  • Send a request from Restofile

    resto run
    
    # from path
    resto run --file ./examples/restofile/basic_request/Restofile
    

Flags

  1. GET & HEAD 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
  1. POST, PUT, PATCH, DELETE flags
-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
  1. install command flags
-s, --shell string   shell to use default: bash
  1. run command flags
-a, --all           Show all response headers & status
-f, --file string   Path to Restofile (Default: PATH/Restofile)

Shortcuts

  • Ctrl+P: Open Resto Panel
  • Ctrl+H: Open Help Guide
  • Ctrl+S: Save Request Body
  • Ctrl+Q: Quit

Documentation

Refer to resto website for the documentation. Or you can check out the Wiki.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cli
run
cmd
core
api

Jump to

Keyboard shortcuts

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