Skip to content

Instantly share code, notes, and snippets.

View sabljakovich's full-sized avatar

Hamza Sabljakovic sabljakovich

View GitHub Profile
const axios = require('axios').default;
axios.interceptors.request.use(x => {
// replace console with our logger of choice
console.log(x);
return x;
})
axios.interceptors.response.use(x => {
console.log(x)
@sabljakovich
sabljakovich / AWSLambdaHttpPostClient.js
Created March 10, 2019 10:18
Node.js native way of performing http post requests.
const http = require('http'); // or https
const defaultOptions = {
host: 'example.com',
port: 80, // or 443 for https
headers: {
'Content-Type': 'application/json',
}
}