0.1.4 • Published 6 years ago
json-post v0.1.4
json-post
How to post JSON in NodeJS.
You know those simplest things ever not properly documented online? That!
const jsonPOST = require('json-post');
// or import jsonPOST from 'json-post'
jsonPOST(
'https://whatever:5000/seriously',
{hello: 'world'}
// optionally extra headers {...}
).then(
console.info,
console.error
);
That's literally it.
... and what about browsers ?
You can use this MDN fetch example to post JSON data.