Alan Fitch
09/24/2021, 6:41 PMbattk
09/24/2021, 6:58 PMAlan Fitch
09/24/2021, 7:05 PMAlan Fitch
09/24/2021, 7:05 PMAlan Fitch
09/24/2021, 7:06 PMbattk
09/24/2021, 7:07 PMbattk
09/24/2021, 7:08 PMbattk
09/24/2021, 7:08 PMAlan Fitch
09/24/2021, 7:11 PMAlan Fitch
09/26/2021, 3:55 PMbattk
09/26/2021, 4:22 PMAlan Fitch
09/26/2021, 5:25 PMconst ouath = OAuth({
consumer: {
key: clientid,
secret: clientsecret
},
signature_method: 'HMAC-SHA256',
hash_function: (base_string, key) => {
return crypto.createHmac('sha256', key).update(base_string).digest("base64")
}
})
header = ouath.toHeader(ouath.authorize({
url: url,
method: 'POST'
}), token)
header.Authorization+=`, realm="${realm}"`
header['content-type']='application/json'
console.log(header)
axiosconfig = {
headers: header,
}
<http://axios.post|axios.post>(url, body, axiosconfig).then((x) => console.log(x))
battk
09/26/2021, 5:29 PMAlan Fitch
09/26/2021, 5:33 PMAlan Fitch
09/26/2021, 5:35 PMbattk
09/26/2021, 5:36 PMAlan Fitch
09/26/2021, 5:39 PM