How would one do the following with the request
npm module?
curl https://todoist.com/oauth/access_token \
-d client_id=0123456789abcdef \
-d client_secret=secret \
-d code=abcdef \
-d redirect_uri=https://example.com
I've tried doing this:
var body = JSON.stringify({
client_id: '0123456789abcdef',
client_secret: 'secret',
code: 'abcdef'
});
var postBody = {
url: 'https://todoist.com/oauth/access_token',
body: body,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
};
request.post(postBody, function(error, response, body) {
...
});
var url = 'http://xxxxx'
request({
url : url,
method :"POST",
headers : {
"content-type": "application/json",
},
body: {
'id':1,
'name':'xxxx'
},
json: true
},
it's working
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With