createBook
/api/books/
Usage and SDK Samples
curl -X POST \
-H "Accept: */*" \
-H "Content-Type: application/json" \
"http://localhost:8443/api/books/" \
-d '{
"image" : true,
"description" : "description",
"id" : 0,
"title" : "title"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.BookRestControllerApi;
import java.io.File;
import java.util.*;
public class BookRestControllerApiExample {
public static void main(String[] args) {
// Create an instance of the API class
BookRestControllerApi apiInstance = new BookRestControllerApi();
Book book = ; // Book |
try {
Book result = apiInstance.createBook(book);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BookRestControllerApi#createBook");
e.printStackTrace();
}
}
}
import org.openapitools.client.api.BookRestControllerApi;
public class BookRestControllerApiExample {
public static void main(String[] args) {
BookRestControllerApi apiInstance = new BookRestControllerApi();
Book book = ; // Book |
try {
Book result = apiInstance.createBook(book);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BookRestControllerApi#createBook");
e.printStackTrace();
}
}
}
// Create an instance of the API class
BookRestControllerApi *apiInstance = [[BookRestControllerApi alloc] init];
Book *book = ; //
[apiInstance createBookWith:book
completionHandler: ^(Book output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var OpenApiDefinition = require('open_api_definition');
// Create an instance of the API class
var api = new OpenApiDefinition.BookRestControllerApi()
var book = ; // {Book}
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.createBook(book, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class createBookExample
{
public void main()
{
// Create an instance of the API class
var apiInstance = new BookRestControllerApi();
var book = new Book(); // Book |
try {
Book result = apiInstance.createBook(book);
Debug.WriteLine(result);
} catch (Exception e) {
Debug.Print("Exception when calling BookRestControllerApi.createBook: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\BookRestControllerApi();
$book = ; // Book |
try {
$result = $api_instance->createBook($book);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling BookRestControllerApi->createBook: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::BookRestControllerApi;
# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::BookRestControllerApi->new();
my $book = WWW::OPenAPIClient::Object::Book->new(); # Book |
eval {
my $result = $api_instance->createBook(book => $book);
print Dumper($result);
};
if ($@) {
warn "Exception when calling BookRestControllerApi->createBook: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint
# Create an instance of the API class
api_instance = openapi_client.BookRestControllerApi()
book = # Book |
try:
api_response = api_instance.create_book(book)
pprint(api_response)
except ApiException as e:
print("Exception when calling BookRestControllerApi->createBook: %s\n" % e)
extern crate BookRestControllerApi;
pub fn main() {
let book = ; // Book
let mut context = BookRestControllerApi::Context::default();
let result = client.createBook(book, &context).wait();
println!("{:?}", result);
}
Scopes
Parameters
Body parameters
Name | Description |
---|---|
book * |