-
Notifications
You must be signed in to change notification settings - Fork 9
Add Person
ZeroCool142 edited this page Jun 20, 2017
·
3 revisions
- URL: /person
- Method: POST
- URL Params: None
-
Data Params:
-
Requred:
{name: "Navalniy"}
-
Requred:
-
Success Response:
-
Code: 200
-
Content:
{id: 3, name: "Navalniy"}
-
Code: 200
-
Error Response:
-
Code: 400
-
Content:
{errorMessage: "Bad Request"} -
Code: 409
-
Content:
{errorMessage: "Person already exists"}
-
Code: 400
- Simple Call:
var newPerson = {name: "Navalniy"};
$.ajax({
url: "/person",
type: "post",
dataType: "json",
data: newPerson,
contentType: "application/json; charset=utf-8",
success: function (person) {
$("#id").html(person.id);
$("#name").html(person.name);
$("#rank").html(person.rank);
}
});