Created
October 30, 2018 10:31
-
-
Save khanof89/7149944c8b9a967a3beedd2b602ab10b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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