按状态查找宠物
按状态查找宠物。
GET https://petstore3.swagger.io/api/v3/pet/findByStatus
示例
- API Key
- OAuth 2.0
cURL
curl -X GET "https://petstore3.swagger.io/api/v3/pet/findByStatus?status=available" \
-H "accept: application/json" \
-H "api_key: <YOUR_API_KEY>"
cURL
curl -X 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: Successful operation
响应
[
{
"id": 210,
"name": "Krypto",
"category": {
"id": 1,
"name": "Dogs"
},
"photoUrls": [
"string"
],
"tags": [
{
"id": 0,
"name": "string"
}
],
"status": "available"
}
]
参数
查询参数
| 参数名 | 类型 | 描述 |
|---|---|---|
status | 字符串 | 必填。 要查找宠物的状态。 允许的值: available、pending、sold。 |