Skip to content

Instantly share code, notes, and snippets.

@khanof89
Created October 30, 2018 10:31
Show Gist options
  • Save khanof89/7149944c8b9a967a3beedd2b602ab10b to your computer and use it in GitHub Desktop.
Save khanof89/7149944c8b9a967a3beedd2b602ab10b to your computer and use it in GitHub Desktop.
let options = {
'Content-Type' : 'application/x-www-form-urlencoded',
'X-Instagram-AJAX': headers.ajax[ 0 ],
'X-Requested-With': 'XMLHttpRequest',
'User-Agent' : 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36'
};
headers = { ...headers.headers, ...options };
console.log(headers);
const config = { headers: headers };
return await fetch(url, {
method : 'POST',
headers: config,
body : params
}).then(function (response) {
console.log('THEN');
console.log(response);
return response;
}).catch(function (error) {
console.log('ERROR');
console.log(error);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment