宠物商店 Petstore
  1. 宠物
宠物商店 Petstore
  • 接口文档说明
  • 宠物
    • 查询宠物详情
      GET
    • 新建宠物信息
      POST
    • form-data 方式更新宠物信息
      POST
    • 删除宠物信息
      DELETE
    • 根据状态查找宠物列表
      GET
    • 上传宠物图片
      POST
    • 修改宠物信息
      PUT
    • 根据 tag 查找宠物列表
      GET
  • 店铺
    • 根据状态查询宠物库存数
      GET
    • 下单购买宠物
      POST
    • 查询订单详情
      GET
    • 删除订单
      DELETE
  • 用户
    • 新建用户
      POST
    • List 方式批量创建用户
      POST
    • Array 方式批量创建用户
      POST
    • 登录
      GET
    • 查询用户
      GET
    • 退出登录
      GET
    • 根据用户名查询用户信息
      GET
    • 更新用户信息
      PUT
    • 删除用户
      DELETE
  1. 宠物

新建宠物信息

正式环境
https://petstore-prod.apifox.cn
正式环境
https://petstore-prod.apifox.cn
POST
/pet
宠物
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://petstore-prod.apifox.cn/pet' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "string",
    "category": {
        "id": 0,
        "name": "string"
    }
}'
响应示例响应示例
{
  "id": 0,
  "category": {
    "id": 0,
    "name": "string"
  },
  "name": "doggie",
  "photoUrls": [
    "string"
  ],
  "tags": [
    {
      "id": 0,
      "name": "string"
    }
  ],
  "status": "available",
  "createTime": "string",
  "location": {
    "province": "string",
    "city": "string",
    "district": "string"
  }
}

请求参数

Body 参数application/json
name
string 
宠物名
必需
category
object (Category) 
必需
id
integer <int64>
分类ID
可选
name
string 
分类名
可选
示例

返回响应

🟢200成功
application/json
Body
id
integer <int64>
宠物ID
可选
category
object (Category) 
分类
可选
id
integer <int64>
分类ID
可选
name
string 
分类名
可选
name
string 
宠物名称
必需
示例值:
doggie
photoUrls
array[string]
照片URL
必需
tags
array[object (Tag) {2}] 
标签
可选
id
integer <int64>
可选
name
string 
标签名
可选
status
enum<string> 
销售状态
可选
枚举值:
availablependingsold
createTime
string 
创建时间
可选
location
object (Localtion) 
位置
可选
province
string 
省份
必需
city
string 
城市
必需
district
string 
区
必需
上一页
查询宠物详情
下一页
form-data 方式更新宠物信息
Built with