How would one do the following with the request
npm module?
curl https://todoist.com/oauth/access_token \\
-d client_id=0123456789abcdef \\
var url = 'http://xxxxx'
request({
url : url,
method :"POST",
headers : {
"content-type": "application/json",
},
body: {
'id':1,
'name':'xxxx'
},
json: true
},
it's working
const formData = {
client_id: '0123456789abcdef',
client_secret: 'secret',
code: 'abcdef'
};
request.post(
{
url: 'https://todoist.com/oauth/access_token',
form: formData
},
function (err, httpResponse, body) {
console.log(err, body);
}
);
Please try this code.
Pretty sure that demo is equivalent to:
https://todoist.com/oauth/access_token?client_id=0123456789abcdef&client_secret=secret&code=abcdef&redirect_uri=...
Where a ?
starts the parameters and an &
separates them.