Skip to content

soulwing/rc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

rc

A stupidly simple RESTful client.

The goal of this little effort was to provide a minimalistic RESTful command-line interface that would be suitable for doing RESTful web service demos. The result probably isn't robust enough for anything more important.

This "client" is just a shell script that uses [curl] (http://curl.haxx.se) to send requests to a RESTful web service and receive responses.

Prerequisites

In order to use rc you need the following:

  • Relatively recent version of curl (tested with curl 7.47)
  • Bash shell (tested with bash 4.3.42(1))

Installation

  1. Clone this repository into some convenient location.
  2. Copy the file named rc to some directory that is on your path.
  3. Make sure the permissions on the file allow you to execute it.

Usage

Run the script with no arguments to see the options.

When making a request that sends a body (i.e. POST, PUT, PATCH) the body content will be read from stdin.

The response body content will be written to stdout.

Environment variables provide the base URL for the web service, and the values for the Accept and Content-Type headers.

  • BASE_URL -- base URL for the web service; default: http://localhost:8080
  • CONTENT_TYPE -- value for the Content-Type header; default is application/json
  • ACCEPT -- accept header; default prefers the type specified by CONTENT_TYPE, then text of any kind, then application data of any kind

About

A stupidly simple RESTful client

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages