-
Notifications
You must be signed in to change notification settings - Fork 9
Update Person
ZeroCool142 edited this page Jun 20, 2017
·
6 revisions
- URL: /person
- Method: PUT
- URL Params: None
-
Data Params:
-
Required:
{id: 3, name: "Vasya"}
-
Required:
-
Success Response:
-
Code: 200
-
Content:
{id: 3, name: "Vasya"}
-
Code: 200
-
Error Response:
-
Code: 404
Content:{errorMessage: "User not found"}
-
Code: 400
Content:{errorMessage: "Bad Request"}
-
Code: 404
- Simple Call:
var updatePerson = {id: 3, name: "Vasya"};
$.ajax({
url: "/person",
type: "put",
dataType: "json",
data: updatePerson,
contentType: "application/json; charset=utf-8",
success: function (person) {
$("#id").html(person.id);
$("#name").html(person.name);
$("#rank").html(person.rank);
}
});