Skip to content

pr0fedt/immutable-http

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Immutable-http

npm version

Http client with pretty simple chaining API

Usage

var result = new Http().withUrl('http://any_api.com/:id')
                        .withMethod('GET')
                        .withHeader('Content-Type','application/json')
                        .withBody({some:data})
                        .withResponseType('json')
                        .withDynamicSegment('id',123)
                        .withParam('filter','some_filter') // Adds query section to the url like '?filter=some_filter'
                        .exec();
result = Promise({
  status: int,
  response: [obj|string],
  headers: string
}, {
  status: int,
  response: [obj|string],
  headers: string
})

Response type options could be obtained from XMLHttp specs

Build

Using Babel

babel --optional runtime src/immutable-http.es6 --out-file lib/immutable-http.js

Tests

Run

node server

then

npm test

Built on Jest

About

Http client with pretty simple chaining API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%