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