addPet
Add a new pet to the store
/pet
                        
Usage and SDK Samples
curl -X POST "http://petstore.swagger.io/v2/pet"
                          import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.PetApi;
import java.io.File;
import java.util.*;
public class PetApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure OAuth2 access token for authorization: petstore_auth
        OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
        petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
        PetApi apiInstance = new PetApi();
        Pet body = ; // Pet | Pet object that needs to be added to the store
        try {
            apiInstance.addPet(body);
        } catch (ApiException e) {
            System.err.println("Exception when calling PetApi#addPet");
            e.printStackTrace();
        }
    }
}
                          import io.swagger.client.api.PetApi;
public class PetApiExample {
    public static void main(String[] args) {
        PetApi apiInstance = new PetApi();
        Pet body = ; // Pet | Pet object that needs to be added to the store
        try {
            apiInstance.addPet(body);
        } catch (ApiException e) {
            System.err.println("Exception when calling PetApi#addPet");
            e.printStackTrace();
        }
    }
}
                          Configuration *apiConfig = [Configuration sharedConfig];
// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
Pet *body = ; // Pet object that needs to be added to the store
PetApi *apiInstance = [[PetApi alloc] init];
// Add a new pet to the store
[apiInstance addPetWith:body
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
                            var SwaggerPetstore = require('swagger_petstore');
var defaultClient = SwaggerPetstore.ApiClient.instance;
// Configure OAuth2 access token for authorization: petstore_auth
var petstore_auth = defaultClient.authentications['petstore_auth'];
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
var api = new SwaggerPetstore.PetApi()
var body = ; // {Pet} Pet object that needs to be added to the store
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.addPet(body, callback);
                            using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
    public class addPetExample
    {
        public void main()
        {
            
            // Configure OAuth2 access token for authorization: petstore_auth
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
            var apiInstance = new PetApi();
            var body = new Pet(); // Pet | Pet object that needs to be added to the store
            try
            {
                // Add a new pet to the store
                apiInstance.addPet(body);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling PetApi.addPet: " + e.Message );
            }
        }
    }
}
                            <?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: petstore_auth
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$api_instance = new Swagger\Client\Api\PetApi();
$body = ; // Pet | Pet object that needs to be added to the store
try {
    $api_instance->addPet($body);
} catch (Exception $e) {
    echo 'Exception when calling PetApi->addPet: ', $e->getMessage(), PHP_EOL;
}
?>
                            use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::PetApi;
# Configure OAuth2 access token for authorization: petstore_auth
$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
my $api_instance = WWW::SwaggerClient::PetApi->new();
my $body = WWW::SwaggerClient::Object::Pet->new(); # Pet | Pet object that needs to be added to the store
eval { 
    $api_instance->addPet(body => $body);
};
if ($@) {
    warn "Exception when calling PetApi->addPet: $@\n";
}
                            from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure OAuth2 access token for authorization: petstore_auth
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
# create an instance of the API class
api_instance = swagger_client.PetApi()
body =  # Pet | Pet object that needs to be added to the store
try: 
    # Add a new pet to the store
    api_instance.add_pet(body)
except ApiException as e:
    print("Exception when calling PetApi->addPet: %s\n" % e)
                            Parameters
| Name | Description | 
|---|---|
| body * |