I have this code:
function RequestLogin()
{
var request = new XMLHttpRequest();
request.onreadystatechange = function() {
if (this.readyState == 4)
{
alert(this.responseURL);
}
};
request.open('POST', 'http://myserver/login');
request.setRequestHeader('Content-type', 'multipart/form-data');
request.send('user=myUsername&password=myPassword');
}
Is this considered "safe" If I use HTTPS instead of http://myserver/login?
What it's not clear to me are the parameters that I have to bind in the request.send
, what am I doing there? Am I appending them in the URL, therefore they're visible if someone sniffs the request? I used to create Form Object and pass it there, but it's not working in this case.
It's the only way I found to pass parameters to POST request, but am I not exposing the parameters anyway by doing 'user=myUsername&password=myPassword'
?
Thanks