addCourse
Create a new course
/course
Usage and SDK Samples
curl -X POST\
-H "Content-Type: application/json"\
"https://virtserver.swaggerhub.com/mementomorri/REST_API_for_toplist_of_students/1.0.0/course"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.CourseApi;
import java.io.File;
import java.util.*;
public class CourseApiExample {
public static void main(String[] args) {
CourseApi apiInstance = new CourseApi();
Course body = ; // Course | Created course object
try {
apiInstance.addCourse(body);
} catch (ApiException e) {
System.err.println("Exception when calling CourseApi#addCourse");
e.printStackTrace();
}
}
}
import io.swagger.client.api.CourseApi;
public class CourseApiExample {
public static void main(String[] args) {
CourseApi apiInstance = new CourseApi();
Course body = ; // Course | Created course object
try {
apiInstance.addCourse(body);
} catch (ApiException e) {
System.err.println("Exception when calling CourseApi#addCourse");
e.printStackTrace();
}
}
}
Course *body = ; // Created course object
CourseApi *apiInstance = [[CourseApi alloc] init];
// Create a new course
[apiInstance addCourseWith:body
completionHandler: ^(NSError* error) {
if (error) {
NSLog(@"Error: %@", error);
}
}];
var RestServerApi = require('rest_server_api');
var api = new RestServerApi.CourseApi()
var body = ; // {{Course}} Created course object
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
api.addCourse(body, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class addCourseExample
{
public void main()
{
var apiInstance = new CourseApi();
var body = new Course(); // Course | Created course object
try
{
// Create a new course
apiInstance.addCourse(body);
}
catch (Exception e)
{
Debug.Print("Exception when calling CourseApi.addCourse: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\ApiCourseApi();
$body = ; // Course | Created course object
try {
$api_instance->addCourse($body);
} catch (Exception $e) {
echo 'Exception when calling CourseApi->addCourse: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::CourseApi;
my $api_instance = WWW::SwaggerClient::CourseApi->new();
my $body = WWW::SwaggerClient::Object::Course->new(); # Course | Created course object
eval {
$api_instance->addCourse(body => $body);
};
if ($@) {
warn "Exception when calling CourseApi->addCourse: $@\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.CourseApi()
body = # Course | Created course object
try:
# Create a new course
api_instance.add_course(body)
except ApiException as e:
print("Exception when calling CourseApi->addCourse: %s\n" % e)
Parameters
Name | Description |
---|---|
body * |