GithubHelp home page GithubHelp logo

getsh's Introduction

GetSh ๐Ÿ’จ

simple REST API tester based on curl
lightweight alternative to PostMan for simple projects

Dependencies

  • curl
  • jq - formatting and coloring of json

How to use

  • getsh <url>: defaults to GET request, returns data and some info about request
  • getsh <url> POST: specify method (GET, POST, DELETE, PUT, PATCH). If POST, PUT or PATCH open $EDITOR and specify json string for the request
  • getsh -d: output data from last operation - useful for piping

Examples

GET

getsh jsonplaceholder.typicode.com/posts/1

returns:

GET on jsonplaceholder.typicode.com/posts/1

{
  "userId": 1,
  "id": 1,
  "title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
  "body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto"
}


Server Response Code:   200
Content Type:           application/json; charset=utf-8
Remote Ip:              172.67.150.206:80
Scheme:                 HTTP
Total Time:             0.146920s

POST

getsh jsonplaceholder.typicode.com/posts POST

then specify json string in your editor:

{
	"title": "lorem",
	"body": "lorem ipsum",
	"userId": 9
}

returns:

POST on jsonplaceholder.typicode.com/posts

{
  "title": "lorem",
  "body": "lorem ipsum",
  "userId": 9,
  "id": 101
}


Server Response Code:   201
Content Type:           application/json; charset=utf-8
Remote Ip:              104.28.10.184:80
Scheme:                 HTTP
Total Time:             2.348348s

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.