JSPM

  • Created
  • Published
  • Downloads 1058527
  • Score
    100M100P100Q179209F
  • License ISC

make http requests

Package Exports

  • http-call

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (http-call) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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'}})