Skip to content

go-fetch-js/json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-fetch-json

Build Status

A plugin for go-fetch that makes working with JSON easier.

Installation

npm install --save go-fetch-json

Usage

const Client = require('go-fetch');
const json = require('go-fetch-json');

new Client()
  .use(json())
  .post('http://httpbin.org/post', {msg: 'Go fetch!'}) //send an object as JSON
    .then(res => {
      console.log('Is JSON?', res.isJSON());
      return res.json(); //buffer and parse the body as JSON
    })
    .then(json => console.log(json))
    .catch(err => console.error(err.stack))
;

About

A plugin for `go-fetch` that makes working with JSON easier.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published