createFood
To create a food
/foods/create
Usage and SDK Samples
curl -X POST "http://localhost:8080/foods/create"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.FoodsApi;
import java.io.File;
import java.util.*;
public class FoodsApiExample {
public static void main(String[] args) {
FoodsApi apiInstance = new FoodsApi();
Request body_8 request body = ; // Request body_8 | The body of the request should be constructed as follows
try {
apiInstance.createFood(request body);
} catch (ApiException e) {
System.err.println("Exception when calling FoodsApi#createFood");
e.printStackTrace();
}
}
}
import io.swagger.client.api.FoodsApi;
public class FoodsApiExample {
public static void main(String[] args) {
FoodsApi apiInstance = new FoodsApi();
Request body_8 request body = ; // Request body_8 | The body of the request should be constructed as follows
try {
apiInstance.createFood(request body);
} catch (ApiException e) {
System.err.println("Exception when calling FoodsApi#createFood");
e.printStackTrace();
}
}
}
Request body_8 *request body = ; // The body of the request should be constructed as follows (optional)
FoodsApi *apiInstance = [[FoodsApi alloc] init];
// To create a food
[apiInstance createFoodWith:request body
completionHandler: ^(NSError* error) {
if (error) {
NSLog(@"Error: %@", error);
}
}];
var FoodFactory = require('food_factory');
var api = new FoodFactory.FoodsApi()
var opts = {
'request body': // {Request body_8} The body of the request should be constructed as follows
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
api.createFood(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class createFoodExample
{
public void main()
{
var apiInstance = new FoodsApi();
var request body = new Request body_8(); // Request body_8 | The body of the request should be constructed as follows (optional)
try
{
// To create a food
apiInstance.createFood(request body);
}
catch (Exception e)
{
Debug.Print("Exception when calling FoodsApi.createFood: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\Api\FoodsApi();
$request body = ; // Request body_8 | The body of the request should be constructed as follows
try {
$api_instance->createFood($request body);
} catch (Exception $e) {
echo 'Exception when calling FoodsApi->createFood: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::FoodsApi;
my $api_instance = WWW::SwaggerClient::FoodsApi->new();
my $request body = WWW::SwaggerClient::Object::Request body_8->new(); # Request body_8 | The body of the request should be constructed as follows
eval {
$api_instance->createFood(request body => $request body);
};
if ($@) {
warn "Exception when calling FoodsApi->createFood: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = swagger_client.FoodsApi()
request body = # Request body_8 | The body of the request should be constructed as follows (optional)
try:
# To create a food
api_instance.create_food(request body=request body)
except ApiException as e:
print("Exception when calling FoodsApi->createFood: %s\n" % e)
Parameters
Name | Description |
---|---|
request body |