上传图像
为宠物上传图像。
POST https://petstore3.swagger.io/api/v3/pet/{petId}/uploadImage
示例
- API Key
- OAuth 2.0
cURL
curl -X POST "https://petstore3.swagger.io/api/v3/pet/210/uploadImage" \
-H "accept: application/json" \
-H "api_key: <YOUR_API_KEY>" \
--form "additionalMetadata=string" \
--form "file=@/path/to/your/file"
cURL
curl -X POST "https://petstore3.swagger.io/api/v3/pet/210/uploadImage" \
-H "accept: application/json" \
-H "Authorization: Bearer <YOUR_OAUTH_TOKEN>" \
--form "additionalMetadata=string" \
--form "file=@/path/to/your/file"
响应
| 状态码 | 描述 |
|---|---|
| 200 | 操作成功 |
| 400 | 未上传文件 |
| 404 | 未找到宠物 |
| default | 意外错误 |
响应示例
200: Successful operation
响应
{
"code": 200,
"type": "unknown",
"message": "additional data"
}
参数
路径参数
| 参数名 | 类型 | 描述 |
|---|---|---|
petId | 整数 | 要更新的宠物的 ID |
查询参数
| 参数名 | 类型 | 描述 |
|---|---|---|
additionalMetadata | 字符串 | 要附加到上传内容中的可选元数据。 |
表单数据参数
| 参数名 | 类型 | 描述 |
|---|---|---|
file | 文件 | 必填。 要上传的图像文件。 |