1.0.5 • Published 6 years ago

xttp v1.0.5

Weekly downloads
6
License
MIT
Repository
github
Last release
6 years ago

xttp xttp

simple http client in node js

Installation

$ npm install xttp

Example

const xttp = require('xttp');

// case 1:
xttp('https://api.github.com/users/song940/orgs', {
  method: 'get',
  headers: {
    'User-Agent': 'xttp/1.0'
  }
})
.then(res => res.json())
.then(res => {
  console.log(res);
});

// case 2:
xttp('https://api.github.com/users/song940/orgs', {
  method: 'get',  
  headers: {
    'User-Agent': 'xttp/1.0'
  }
}, async (err, res) => {
  const data = await res.json();
  console.log(err, data);
});

// case 3:
xttp
.create()
.post('https://httpbin.org/post?a=b')
.query({ c: 'd' })
.then(res => res.json())
.then(res => console.log(res));

// case 4:
xttp
.get('https://httpbin.org/get?a=b')
.then(res => res.json())
.then(res => console.log(res));

Contributing

  • Fork this Repo first
  • Clone your Repo
  • Install dependencies by $ npm install
  • Checkout a feature branch
  • Feel free to add your features
  • Make sure your features are fully tested
  • Publish your local branch, Open a pull request
  • Enjoy hacking <3

MIT

This work is licensed under the MIT license.


1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago

1.0.0

9 years ago