Login with JavaScript
I'm trying to login to xano from a web application with javascript.
Code:
function login(){
  event.preventDefault()
  var url = 'xxxxxxxxxxxxxxxxxxxxxx/login'
  email = document.getElementById('email').value; Â
  password = document.getElementById('password').value;
  obejct = {
    'email': email,
    'password': password
  }  Â
 Â
  makePost(url,object);  Â
}
function makePost(url, object){
  let request = new XMLHttpRequest();
  request.open ('POST', url, true); Â
  request.setRequestHeader('Content-Type','applictaion/json');
  request.send(object);
  request.onload = function(){
    console.log(this.responseText);
  }
  return request.responseText
}
But I'm getting the following responseBut I'm getting the following response::But I'm getting the following response:{'code':'ERROR_CODE_INPUT_ERROR','message':'Missing param: field_value','payload':{'param':'field_value'}}
What is wrong?
Connect Xano to...
1 reply