auth.gettoken from Angular

Hi, i've been struggling with the basic attempt to log into elgg from my iOS app.. i'm using ionic and angular.

what on earth am i doing wrong? running elgg 2.3.5

I see two calls going out, the first returns:

{"status":-1,"message":"auth.gettoken must be called using 'POST'"}

the second response i get is:

"Response {_body: "{"status":-1,"message":"Missing parameter username in method auth.gettoken"}", status: 200, ok: true, statusText: "OK", headers: Headers, …}"

login(credentials) {
return new Promise((resolve, reject) => {
let headers = new Headers();
headers.append('Content-Type', 'aapplication/x-www-form-urlencoded');
headers.append('Authorization','Bearer ');
let options = new RequestOptions({headers: headers});

 

var jsonMSG = '';
for (var prop in credentials) {
jsonMSG += encodeURIComponent(prop) + '=' +
encodeURIComponent(credentials[prop]) + '&';
}

 

// this.http.post(apiUrl+'auth.gettoken', JSON.stringify(credentials), {headers: headers})

 

this.http.post(apiUrl+'auth.gettoken', jsonMSG.substring(0, jsonMSG.length - 1), options)
.subscribe(res => {
console.log(res);
resolve(res.json());
}, (err) => {
console.log(err);
reject(err);
});
});
}