I've been trying to do an HTTP.post with data, but I keep getting a 401 response saying that one of the vars (client_id) is missing.
Code:
fetchPlaidAccounts: function (options) {
this.unblock();
response = HTTP.post(config.plaid.base_url + 'connect', {
data: {
client_id: config.plaid.client_id,
secret: config.plaid.secret,
username: options.username,
password: options.password,
type: options.institution,
email: options.email,
options: '{"login_only":true,"list":true}'
},
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Access-Control-Allow-Origin': '*'
}
});
return response;
}
I did a HTTP.get earlier and that worked just fine using params instead of data.
I also console.log’d all the variables, and they all have values.
So, what am I doing wrong here?