Skip to content

RESTful API For User

Echo edited this page Mar 19, 2018 · 13 revisions
获取用户信息
Request
GET /saltshaker/api/v1.0/user

Response
HTTP/1.1 200 OK
Content-Type: application/json

{
    "users": {
        "user": [
            {
                "id": "u-3d48618a283111e8a7e3000c298454d8",
                "username": "salt"
            },
            {
                "id": "u-b0175be62b1d11e886cb000c298454d8",
                "username": "salt1"
            }
        ]
    }
}
添加用户
Request
POST /saltshaker/api/v1.0/role

POST Body
{
	"username": "salt1",
	"password": "salt"
}
Response
HTTP/1.1 200 OK
Content-Type: application/json

{
    "status": true,
    "message": ""
}
删除用户
Request
DELETE /saltshaker/api/v1.0/user/u-b0175be62b1d11e886cb000c298454d8

Response
HTTP/1.1 200 OK
Content-Type: application/json

{
    "status": true,
    "message": ""
}
修改用户
Request
PUT /saltshaker/api/v1.0/user/u-feef9dfc28e611e8a7e3000c298454d8

PUT Body
{
	"username": "salt1",
	"password": "salt"
}
Response
HTTP/1.1 200 OK
Content-Type: application/json

{
    "status": true,
    "message": ""
}

Clone this wiki locally