0

I know the error 302 is because i'm getting redirected...

Here's my call in jquery :

    $.ajax({
                    type: 'POST',
                    url: 'https://url/WebServices/SearchDocuments',
                    data:"{search: " + e.target.value + " }",

                    dataType: "JSON",


                    success: function(data) {
                        GetDocumentSuccess(data[0]);
                    }
                });

I see that i'm being logged out of the webService in a way.

But when i'm using this :

  var request = WebRequest.Create(url);
        request.Method = "POST";

        ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };

        using (var s = request.GetRequestStream())
        {
            using (var sw = new StreamWriter(s))
            {
                sw.Write(true); // Write anything. If the post is empty, the distant server throws an error.
            }
        }

it's working, i thinks the problem come from not having this:

ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };

, when i call it directly from jquery

Is this the problem ?

And

Someone know how to make it work with using jquery ajax ?

4

0 に答える 0