Mettre à jour un animal de compagnie existant
Mettre à jour un animal de compagnie existant à l'aide de son identifiant.
PUT https://petstore3.swagger.io/api/v3/pet
Exemples
- 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"
}'
Réponses
| Code | Description |
|---|---|
| 200 | Opération réussie |
| 400 | Entrée non valide |
| 404 | Animal introuvable |
| 422 | Exception de validation |
| default | Erreur inattendue |
Exemple de réponse
200: Opération réussie
Response
{
"id": 210,
"name": "Krypto",
"category": {
"id": 1,
"name": "Dogs"
},
"photoUrls": [
"chaîne de caractères"
],
"tags": [
{
"id": 0,
"name": "chaîne de caractères"
}
],
"status": "available"
}
Paramètres
Corps de la requête
| Nom | Type | Description |
|---|---|---|
body | Objet Pet | Required. Objet Pet to update. |