既存のペットを更新する
ID を指定して既存のペット情報を更新します。
PUT https://petstore3.swagger.io/api/v3/pet
例
- API Key
- OAuth 2.0
cURL
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"
}'
cURL
PUT "https://petstore3.swagger.io/api/v3/pet" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <YOUR_OAUTH_TOKEN>" \
-d '{
"id": 210,
"name": "Krypto",
"status": "available"
}'
レスポンス
| コード | 説明 |
|---|---|
| 200 | 操作成功 |
| 400 | 無効な入力 |
| 404 | ペットが見つかりません |
| 422 | バリデーション例外 |
| default | 予期せぬエラー |
レスポンス例
200: 操作成功
Response
{
"id": 210,
"name": "Krypto",
"category": {
"id": 1,
"name": "Dogs"
},
"photoUrls": [
"文字列"
],
"tags": [
{
"id": 0,
"name": "文字列"
}
],
"status": "available"
}
パラメータ
リクエスト本文
| 名前 | タイプ | 説明 |
|---|---|---|
body | Pet オブジェクト | Required. Pet オブジェクト to update. |