http-call
TypeScript icon, indicating that this package has built-in type declarations

5.3.0 • Public • Published

http-call

Greenkeeper badge

Usage

const {HTTP} = require('http-call')
const {body: user} = await HTTP.get('https://api.github.com/users/me')
// do something with user
// automatically converts from json
 
// for typescript specify the type of the body with a generic:
const {body: user} = await HTTP.get<{id: string, email: string}>('https://api.github.com/users/me')
 
// set headers
await HTTP.get('https://api.github.com', {headers: {authorization: 'bearer auth'}})

Readme

Keywords

Package Sidebar

Install

npm i http-call

Weekly Downloads

893,218

Version

5.3.0

License

ISC

Unpacked Size

43.9 kB

Total Files

14

Last publish

Collaborators

  • dickeyxxx