Oct 16 2023 09:27 AM - edited Oct 16 2023 09:34 AM
function simpleSearchAPICall(searchUrl) {
$.ajax({
url: searchUrl,
type: "GET",
contentType: "application/json; charset=utf-8",
dataType: "json",
complete: function(response){
console.log("URL", searchUrl)
console.log(response);
// Handle the response data here
},
error: function(xhr, status, error) {
console.error("ERROR:",error);
// alert("An error occurred while making the request.");
}
});
simpleSearchAPICall("http://www.test.com/_api/search/query?querytext='test'")
});