valid json request body in jquery json

valid json request body in jquery json

    var uid= "user";
    var pwd= "[email protected]";

    var doAuthenticate = function (uid, pwd) {
        var token = user + ':' + password;
        var hashCode = btoa(token);
        return  'Basic ' + hashCode; 

    var createDate = new Date().getTime();

    var requestBody = { user: { Id: 9, CreatedDate: '/Date(' + createDate + ')/'} };
    var JSONrequestBody=JSON.stringify(requestBody);

            url: '',
            type: 'POST',
            data: JSONrequestBody,
            beforeSend: function (xhr) {
                xhr.setRequestHeader("Authorization", doAuthenticate(uid, pwd));
            async: runInBackground,
            contentType: 'application/json',
            success: successHandler,
            error: function (jqXHR, textStatus, errorThrown) {


Thanks you.


Hey! I'm Anil Singh. I author this blog. I'm Active Blogger, Programmer. I love learning new technologies, programming, blogging and participating the forum discussions more...
My Blogs - and
My Books - Interview Questions and Answers Books- Get Your Book in 15+ Digital Stores Worldwide..

You Might Also Like Powered by Blogger.
ASK Questions