创建用户
创建一个新的用户账户。
POST https://petstore3.swagger.io/api/v3/user
示例
- API Key
- OAuth 2.0
cURL
POST "https://petstore3.swagger.io/api/v3/user" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-H "api_key: <YOUR_API_KEY>" \
-d '{
"id": 0,
"username": "字符串",
"firstName": "字符串",
"lastName": "字符串",
"email": "字符串",
"password": "字符串",
"phone": "字符串",
"userStatus": 0
}'
cURL
POST "https://petstore3.swagger.io/api/v3/user" \
-H "accept: application/json" \
-H "Authorization: Bearer <YOUR_OAUTH_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"id": 0,
"username": "字符串",
"firstName": "字符串",
"lastName": "字符串",
"email": "字符串",
"password": "字符串",
"phone": "字符串",
"userStatus": 0
}'
响应
| 状态码 | 描述 |
|---|---|
| 200 | 操作成功 |
| default | 操作成功 |
响应示例
200: 操作成功
Response
{
"id": 10,
"username": "theUser",
"firstName": "John",
"lastName": "James",
"email": "john@email.com",
"password": "12345",
"phone": "12345",
"userStatus": 1
}
参数
请求正文
| 参数名 | 类型 | 描述 |
|---|---|---|
body | User 对象 | 必填。 要创建的 User 对象。 |