Click here to Skip to main content
15,794,275 members
Please Sign up or sign in to vote.
0.00/5 (No votes)

I have a RestFul service, which provides several interfaces for different functionalities. I want to send a request envelop (e.g. uid and password for Authentication) and process the response.

I am trying using jQuery, Ajax but when I sent a https request then it gives me the following respose.

Here is my code sample.

url: "https://mysite/login",
        type: "POST",
        data: {  // the parameters of the request. This should be adapted to your case
            "uid": uname,
            "password": pswd
        dataType: 'json',
        contentType: 'application/json',
        headers: { 'My-Key': 'ABCMDJDFJFDFKDFEKEKRKR39; },
/*       beforeSend: function(xhr) {
            xhr.setRequestHeader('My-Key', 'ABCMDJDFJFDFKDFEKEKRKR3');
        async: true,
        crossDomain: true,

        success:function () {
//      data: JSON.stringify(data);
        var obj=jQuery.parseJSON(data);
       // alert("success");
        alert(JSON.stringify(data)+" Success");

//      data: JSON.stringify(data);
        //var obj1=jQuery.parseJSON(JSON.stringify(data));
        //var x= JSON.parse("two"+data);
        alert(JSON.stringify(data)+" error");

I tried using "beforeSend" function but the result is same.

I found out that I need to send certificate or key-store details to the server then it will give me proper response. Please let me know what are the ways that I can send these details. I know it is not possible using jQuery, Ajax. So what are the other alternatives that I can go for?

Updated 16-Dec-13 20:16pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900