按状态查找宠物
按宠物状态查找宠物列表。
GET https://petstore3.swagger.io/api/v3/pet/findByStatus
示例
- API Key
- OAuth 2.0
cURL
GET "https://petstore3.swagger.io/api/v3/pet/findByStatus?status=available" \
-H "accept: application/json" \
-H "api_key: <YOUR_API_KEY>"
cURL
GET "https://petstore3.swagger.io/api/v3/pet/findByStatus?status=available" \
-H "accept: application/json" \
-H "Authorization: Bearer <YOUR_OAUTH_TOKEN>"
响应
| 状态码 | 描述 |
|---|---|
| 200 | 操作成功 |
| 400 | 输入无效 |
| default | 意外错误 |
响应示例
200: 操作成功
Response
[
{
"id": 210,
"name": "Krypto",
"category": {
"id": 1,
"name": "Dogs"
},
"photoUrls": [
"字符串"
],
"tags": [
{
"id": 0,
"name": "字符串"
}
],
"status": "available"
}
]
参数
查询参数
| 参数名 | 类型 | 描述 |
|---|---|---|
status | 字符串 | 待查找宠物的状态。 默认值: available。允许的值: available、pending、sold。 |