跳到主要内容

更新现有宠物

按 ID 更新现有宠物。

PUT https://petstore3.swagger.io/api/v3/pet

示例​

cURL
curl -X PUT "https://petstore3.swagger.io/api/v3/pet" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-H "api_key: <YOUR_API_KEY>" \
-d '{
"id": 210,
"name": "Krypto",
"status": "available"
}'

响应​

状态码描述
200操作成功
400提供的 ID 无效
404未找到宠物
422验证异常
default意外错误

响应示例​

200: Successful operation

响应
{
"id": 210,
"name": "Krypto",
"category": {
"id": 1,
"name": "Dogs"
},
"photoUrls": [
"string"
],
"tags": [
{
"id": 0,
"name": "string"
}
],
"status": "available"
}

参数​

请求正文​

参数名类型描述
bodyPet 对象必填。 要更新的 Pet 对象。