difference between AJAX POST and GET
- by Mohit Kumar
$.ajax({
type: 'POST',
url: path,
data: '{AreaID: ' + parentDropdownList.val() + '}',
contentType: 'application/json; charset=utf-8',
dataType: 'json',
success: function(response)
{
}
});
In above code I am using type: 'POST'. My senior told me that I also can use 'GET' in type. But dint find the difference between 'POST' and 'GET' and I also want to know what is the use of type, contentType, and dataType.
Could anyone one explain me why we use these type, contentType and dataType.
Thanks in advance.