Skip to content

Instantly share code, notes, and snippets.

View mkhoeini's full-sized avatar

Mohammad Sadegh Khoeini mkhoeini

View GitHub Profile
@mkhoeini
mkhoeini / request.js
Last active August 29, 2015 14:26 — forked from HosseinNikpour/request
import fetch from 'node-fetch';
import btoa from 'btoa';
function serverCallMaker(user, pass, baseUrl) {
const hash = btoa(`${user}:${pass}`);
const Authorization = `Basic ${hash}`;
const Accept = 'application/json; odata=verbose';
const params = {