What is content-type and datatype in an AJAX request?

What is content-type and datatype in a POST request? Suppose I have this:

$.ajax({
    type : "POST",
    url : /v1/user,
    datatype : "application/json",
    contentType: "text/plain",
    success : function() {

    },
    error : function(error) {

    },

Is contentType what we send? So what we send in the example above is JSON and what we receive is plain text? I don’t really understand.

Leave a Comment