In a Post method within a Controller derived from ApiController what should I return to indicate success to jQuery ?

I've tried HttpResponseMessage but jQuery sees this as an error (even though the argument the jQuery error handler clearly has a 200 status).

The jQuery looks like this :

processParticipantEvent: function(parID, evtType, evtNotes, successFunction, errorFunction){
    debugger;
    var requestURL = '/api/participantevent';
    var json = {"parId" : parID, "evtType": evtType, "evtNotes": evtNotes};
    var jsonArray=JSON.stringify(json);
    $.ajax({
        type: "POST",
        contentType: "application/json; charset=utf-8",
        url: requestURL,
        data: jsonArray ,
        dataType: "json",
        success: function (data) { successFunction(data); },
        error: function (data) { errorFunction(data); }
    });
},

I've read this : AJAX request return 200 OK but error event is fired instead of success which seems like it's touching on the same issue but I suspect it's out of data as it won't work for me ?

Just to be clear all I want to do is to return a plain old 2xx with no data.

Related posts

Recent Viewed