AnsweredAssumed Answered

was api login example with ajax

Question asked by Manish Rana on Sep 14, 2016
Latest reply on Nov 10, 2016 by Manish Rana

Hi,

 

I am using jquery to send AJAX request to login to Qualys WAS API to establish a session by storing cookies in some file. Could someone please help.

My code is :

$(document).ready(function(){

       var data = ""

       $("#qlsLoginBtn").click(function(){

       $.post("https://qualysapi.qualys.com/qps/rest/3.0/session",{content-type: text/xml, action: "login", username: $('#qlsuser').val(), password: $('#qlspass').val()},function(response){

       data = $.parseXML(response);

  }).error(function(){alert("Sorry Could Not Login")});

  alert(data);

  });

  });

Outcomes