Skip to content

VagrantPi/ecRequest

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ecRequest

An easy way to request http and https

Install

npm install ecrequest

Use

const ecrequest = require('ecrequest');
const opt = {
  protocol: 'https:',
  host: 'www.google.com',
  port: 80,
  hostname: 'www.google.com',
  pathname: '/',
  path: '/' };

### request ###
ecrequest.request(opt).then(console.log);

### get ###
ecrequest.get(opt).then(console.log);

### post ###
opt.data = { post: 'body' };
ecrequest.post(opt).then(console.log);

### put ###
opt.data = { put: 'body' };
ecrequest.put(opt).then(console.log);

### delete ###
opt.headers = { 'content-type': 'application/json' };
ecrequest.delete(opt).then(console.log);

About

An easy way to request http and https

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%