跳到主要内容

更新用户信息

更新指定用户账户的信息。

PUT https://petstore3.swagger.io/api/v3/user/{username}

示例

cURL
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": "字符串",
"lastName": "字符串",
"email": "字符串",
"password": "字符串",
"phone": "字符串",
"userStatus": 0
}'

响应

状态码描述
200操作成功
400提供的用户无效
404未找到该用户
default意外错误

更新成功时,将返回状态码 200,且不包含响应正文。

参数

路径参数
参数名类型描述
username字符串要更新的用户的用户名
请求正文
参数名类型描述
bodyUser 对象必填。 包含更新后信息的 User 对象。