Call web service using AJAX

In this post, we will understand how to call web service using AJAX.

Here is the code snippet to call a web service using AJAX:


       $(document).ready(function() {


                          url : ‘http://localhost:8183/api/v1/values&#8217;,

                          type : ‘GET’,

                          dataType: ‘json’,

                          success : function (data, textStatus, xhr) {



                         error: function(xhr, textStatus, errorThrown) {

                                        console.log (‘ Error in API CALL’);





Feel free to comment to this post. You can also reach me by dropping an email to Thanks for stopping by !!!

Leave a Reply