Here you can see how you can make REST service call using jQuery :
![](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_tBmMhSARw6GeZMqSr1AJoI2u3EeHOpwEC7T4LQb7xPQllPWOm_TKTttMFfIMrURoozvKKmbxCPUfm8ISVQTlyohHsJzyeJoxcdd6JfLWAha9jD-UGL2SHHDcBBvE3peHCkDvc8OJ2qUXw2l3gW=s0-d)
$(document).on('ready',function(){ var username ="vachhani_22kk@yahoo.com"; var password ="password"; function make_base_auth(user, password) { var tok = user + ':' + password; var hash = btoa(tok); return "Basic " + hash; } $.ajax({ url: 'http://google.com/api/jsonws/ocd-ws-portlet.ocdwebs/get-folder-files/folder-id/22793/repository-id/12368', dataType: "json", data:{}, type: "get", success: function(data){ alert("hi"); }, beforeSend: function(xhr){ xhr.setRequestHeader('Authorization',make_base_auth(username, password)); }, complete: function(){ }, error: function(){ } }); });