更新用户信息
更新用户信息。
PUT https://petstore3.swagger.io/api/v3/user/{username}
示例
- API Key
- OAuth 2.0
cURL
curl -X PUT "https://petstore3.swagger.io/api/v3/user/user1" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-H "api_key: <YOUR_API_KEY>" \
-d '{
"id": 0,
"username": "user1",
"firstName": "string",
"lastName": "string",
"email": "string",
"password": "string",
"phone": "string",
"userStatus": 0
}'
cURL
curl -X PUT "https://petstore3.swagger.io/api/v3/user/user1" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <YOUR_OAUTH_TOKEN>" \
-d '{
"id": 0,
"username": "user1",
"firstName": "string",
"lastName": "string",
"email": "string",
"password": "string",
"phone": "string",
"userStatus": 0
}'
响应
| 状态码 | 描述 |
|---|---|
| 200 | 操作成功 |
| 400 | 错误请求 |
| 404 | 未找到该用户 |
| default | 意外错误 |
响应正文
更新成功时,服务器返回 200 状态码,且不返回响应正文。
参数
路径参数
| 参数名 | 类型 | 描述 |
|---|---|---|
username | 字符串 | 要更新的用户的用户名 |
请求正文
| 参数名 | 类型 | 描述 |
|---|---|---|
body | User 对象 | 必填。 包含更新后信息的 User 对象。 |