Skip to content

Instantly share code, notes, and snippets.

@commuterjoy
Created June 1, 2015 21:46
Show Gist options
  • Save commuterjoy/4983fbe96627532dae6d to your computer and use it in GitHub Desktop.
Save commuterjoy/4983fbe96627532dae6d to your computer and use it in GitHub Desktop.
fetch('http://spoor-api.ft.com/px.gif', {
method: 'post',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
timeout: 5000,
headers: {
'content-length': Buffer.byteLength(JSON.stringify(event), 'utf8')
},
body: JSON.stringify(event)
}).then(function (response) {
console.log('POST', response.status, response.headers);
}).catch(function (err) {
console.error('error', err);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment