deletePost
Delete request to delete a post
Use this method to delete a post
/posts{id}
Usage and SDK Samples
curl -X DELETE\
-H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json,application/xml"\
"https://virtserver.swaggerhub.com/B24979/APIDocumention/1.0.0/posts{id}?user_id=&title=&body="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.PostsApi;
import java.io.File;
import java.util.*;
public class PostsApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
PostsApi apiInstance = new PostsApi();
Integer id = 56; // Integer | id of the post
Integer userId = 56; // Integer | id of the user
String title = title_example; // String | title of post
String body = body_example; // String | body of post
try {
Posts result = apiInstance.deletePost(id, userId, title, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PostsApi#deletePost");
e.printStackTrace();
}
}
}
import io.swagger.client.api.PostsApi;
public class PostsApiExample {
public static void main(String[] args) {
PostsApi apiInstance = new PostsApi();
Integer id = 56; // Integer | id of the post
Integer userId = 56; // Integer | id of the user
String title = title_example; // String | title of post
String body = body_example; // String | body of post
try {
Posts result = apiInstance.deletePost(id, userId, title, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PostsApi#deletePost");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
Integer *id = 56; // id of the post
Integer *userId = 56; // id of the user
String *title = title_example; // title of post
String *body = body_example; // body of post
PostsApi *apiInstance = [[PostsApi alloc] init];
// Delete request to delete a post
[apiInstance deletePostWith:id
userId:userId
title:title
body:body
completionHandler: ^(Posts output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var GoRestApiDocumentation = require('go_rest_api_documentation');
var defaultClient = GoRestApiDocumentation.ApiClient.instance;
var api = new GoRestApiDocumentation.PostsApi()
var id = 56; // {{Integer}} id of the post
var userId = 56; // {{Integer}} id of the user
var title = title_example; // {{String}} title of post
var body = body_example; // {{String}} body of post
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.deletePost(id, userId, title, body, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class deletePostExample
{
public void main()
{
var apiInstance = new PostsApi();
var id = 56; // Integer | id of the post
var userId = 56; // Integer | id of the user
var title = title_example; // String | title of post
var body = body_example; // String | body of post
try
{
// Delete request to delete a post
Posts result = apiInstance.deletePost(id, userId, title, body);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling PostsApi.deletePost: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\ApiPostsApi();
$id = 56; // Integer | id of the post
$userId = 56; // Integer | id of the user
$title = title_example; // String | title of post
$body = body_example; // String | body of post
try {
$result = $api_instance->deletePost($id, $userId, $title, $body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling PostsApi->deletePost: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::PostsApi;
my $api_instance = WWW::SwaggerClient::PostsApi->new();
my $id = 56; # Integer | id of the post
my $userId = 56; # Integer | id of the user
my $title = title_example; # String | title of post
my $body = body_example; # String | body of post
eval {
my $result = $api_instance->deletePost(id => $id, userId => $userId, title => $title, body => $body);
print Dumper($result);
};
if ($@) {
warn "Exception when calling PostsApi->deletePost: $@\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.PostsApi()
id = 56 # Integer | id of the post
userId = 56 # Integer | id of the user
title = title_example # String | title of post
body = body_example # String | body of post
try:
# Delete request to delete a post
api_response = api_instance.delete_post(id, userId, title, body)
pprint(api_response)
except ApiException as e:
print("Exception when calling PostsApi->deletePost: %s\n" % e)
Parameters
Name | Description |
---|---|
id* |
Integer
id of the post
Required
|
Name | Description |
---|---|
user_id* |
Integer
id of the user
Required
|
title* |
String
title of post
Required
|
body* |
String
body of post
Required
|