Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
youvaMokeddes1996
Contributor
Contributor

send a password and an identifier in an HTTP request for authentication (get a token)

hello , 
I have a problem for 3 days on an HTTP request of type $. AJAX {()} I explain my code:
 
the data I have are :
headers : Content-Type  = application/json
body :{
  "UserName": "trinita",
  "Password": "112A" } 
 
 
my request http is:
 
 jQuery.ajax({
     url: data.npsod.conn.server+'Account/Login',
     method: 'POST',
     contentType: 'application/json',
     dataType : "json",
     data:{UserName:"trinita",Password:"112A"}, 
     xhrFields: {
     withCredentials: false
     },
     error: function(){
     alert('failure');
                    }
     
    })
 
I do not understand why I have this error ,I know that normally it comes from data :{UserName…….} but I have note another solution 
 
HTTP400:INCORRECT QUERY. The server was unable to process the request because the syntax is not valid.
thank you  🙂 !
0 Replies