T157 put request is send. 415 response format unaccepted
This commit is contained in:
@@ -23,6 +23,23 @@ function getData(uuid){
|
||||
});
|
||||
}
|
||||
|
||||
function updateData(){
|
||||
var updatedJson = generateJson();
|
||||
$.ajax({
|
||||
url: 'http://localhost:8097/mock/json',
|
||||
type: 'PUT',
|
||||
data: updatedJson,
|
||||
success: function(data) {
|
||||
console.log('PUT request received 200');
|
||||
}
|
||||
});
|
||||
// $.put('http://localhost:8097/mock/json', function(data){
|
||||
//
|
||||
// });
|
||||
// console.log('PUT request sent');
|
||||
getData();
|
||||
}
|
||||
|
||||
|
||||
function clearMock(){
|
||||
fillStaticFields('','','','');
|
||||
@@ -143,13 +160,9 @@ function sleep(ms) {
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
function saveChanges(){
|
||||
convertTableToJson();
|
||||
generateJson();
|
||||
}
|
||||
|
||||
|
||||
function generateJson(){
|
||||
console.log("Save button click");
|
||||
var newJson =
|
||||
{
|
||||
clientUUID: json[jsonIndex].clientUUID,
|
||||
@@ -160,7 +173,8 @@ function generateJson(){
|
||||
httpHeaders: {},
|
||||
};
|
||||
newJson['httpHeaders'] = convertTableToJson();
|
||||
document.write(JSON.stringify(newJson, null, 2));
|
||||
console.log(JSON.stringify(newJson, null, 2));
|
||||
return newJson;
|
||||
}
|
||||
|
||||
// $("table tr").eq(row).find("td").eq(i%2).append("<img src='"+dataJson[i].imagen+"' width='100'/>");
|
||||
|
||||
Reference in New Issue
Block a user