0.7.0 • Published 8 years ago

restchi v0.7.0

Weekly downloads
4
License
ISC
Repository
github
Last release
8 years ago

#restchi

#STATUS Not ready for use

Use Case: Sane REST calls. Callable functions based on HTTP verbs instead of absurdly vague method names.


##API Reference

Constructor:

  • restchi(rootUrl)

Callable Methods:

  • GET (endpoint, options)
  • POST (endpoint, data, options)
  • PUT (endpoint, data, options)
  • DELETE (endpoint, data, options)

##Getting Started

  1. Module Install:
    npm i restchi -S

  2. Module Import:
    import r from 'restchi';

  3. Object Instantiation:
    let rootUri = 'https://www.api.com/v1'; let request = new restchi(rootUri);

  4. REST Method Calls:
    let call = request.post('/rest/resource');


##Philosophy

Usage Idioms: Each invoked restchi object correlates to a single root URI. This allows for multiple request calls on that single URI. (e.g. foo.com) by merely changing the endpoint (e.g. /bar === foo.com/bar)

###Idiom:
You have the option to pass either a root URI (e.g. foo.com) or a full URI (e.g. foo.com/bar). However, you cannot simply call GET/POST/PUT/DELETE without first specifying the root URI.

####Goal:

0.7.0

8 years ago

0.5.4

8 years ago

0.5.3

8 years ago

0.5.2

8 years ago

0.5.1

8 years ago

0.5.0

8 years ago