$.ajax({
url: site+"/api/rest/products",
type: "GET",
headers: {
"X-Oc-Merchant-Id": '123'
},
dataType: "json",
contentType: 'application/json: charset=utf-8',
async: true,
xhrFields: {
withCredentials: true
},
crossDomain: true,
success: function(response) {
if (response.success) {
console.log(response.data);
} else {
console.log("Error");
}
},
error: function(error) {
console.log("Error");
}
});