🔧 Send headers

This commit is contained in:
Simon Schneegans
2020-08-15 12:54:49 +02:00
parent cf5a7526b6
commit 294e38a462

View File

@@ -24,11 +24,17 @@ try {
let data = {files: {}}; let data = {files: {}};
data.files[badgeName] = {content: JSON.stringify(description)}; data.files[badgeName] = {content: JSON.stringify(description)};
console.log(JSON.stringify(data));
console.log(gistId);
const options = { const options = {
host: 'api.github.com', host: 'api.github.com',
path: '/gists/' + gistId, path: '/gists/' + gistId,
auth: 'token ' + auth, method: 'PATCH',
method: 'PATCH' headers: {
'Content-Type': 'application/json',
'Authorization': 'token ' + auth,
}
}; };
const callback = (response) => { const callback = (response) => {