I added contentType as false for my jQuery ajax request. I am sending
$.ajax({
url : "http://groc.cloudapp.net:8000/api/view/"+tile_vert_id+"/"+tileId,
type: "PUT",
data :updatedemoData,
processData: false,
cacheControl: "no-cache",
contentType: false,
success : function(data,textStatus,jqXHR)
{
alert("Yo");
console.log("successdata: ",data);
$($caseToEdit).find(".tile-name").text(updatedemoData.name);
$($caseToEdit).find(".tile-des").text(updatedemoData.description);
$($caseToEdit).find(".v-url").text(updatedemoData.url);
$(".ajax-loader").hide();
},
error : function(jqXHR,textStatus,errorThrown){
$(".ajax-loader").hide();
alert("error in loading!");
}
});
and I am sending a Formdata object for data
var updatedemoData = new FormData();
updatedemoData.name = demoName;
updatedemoData.description = demoText;
updatedemoData.videoordemo = tileType;
updatedemoData.url = demoUrl;
but when I run the same code in the browser console, I get a border tag. Without a boundary tag, data is not stored on the server.
I expect something similar with a border tag
Content-Type:multipart/form-data; boundary=----WebKitFormBoundaryiBHhkxeJP2Vc7a5Q
but the content type is actually
Content-Type:application/x-www-form-urlencoded; charset=UTF-8
Any suggestions
source
share