AWS Directory Service
AWS Directory Servicev2015-04-16
Directory Service Directory Service is a web service that makes it easy for you to setup and run directories in the Amazon Web Services cloud, or connect your Amazon Web Services resources with an existing self-managed Microsoft Active Directory. This guide provides detailed information about Directory Service operations, data types, parameters, and errors. For information about Directory Services features, see Directory Service and the Directory Service Administration Guide . Amazon Web Services provides SDKs that consist of libraries and sample code for various programming languages and…
- Endpoints
- 67 (67 POST)
- Base URL
http://ds.{region}.amazonaws.com- Authentication
- API key
- Spec format
- OpenAPI 3.0.0
- API version
- 2015-04-16
- Provider
- amazonaws.com
- License
- Apache 2.0 License
- Categories
- Cloud & Infrastructure
- Last updated
Use this API in Bruno:
- Download the Bruno collection above and unzip it.
- In Bruno, choose Open Collection and select the unzipped folder.
- Set the
baseUrlvariable (for examplehttp://ds.{region}.amazonaws.com) and your API key credentials, then send requests.
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AcceptSharedDirectory");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"SharedDirectoryId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AcceptSharedDirectory" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:SharedDirectoryId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AcceptSharedDirectory"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"SharedDirectoryId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AcceptSharedDirectory"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"SharedDirectoryId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AcceptSharedDirectory");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"SharedDirectoryId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AcceptSharedDirectory"
payload := strings.NewReader("{\n \"SharedDirectoryId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 29
{
"SharedDirectoryId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AcceptSharedDirectory")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"SharedDirectoryId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AcceptSharedDirectory"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"SharedDirectoryId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"SharedDirectoryId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AcceptSharedDirectory")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AcceptSharedDirectory")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"SharedDirectoryId\": \"\"\n}")
.asString();
const data = JSON.stringify({
SharedDirectoryId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AcceptSharedDirectory');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AcceptSharedDirectory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {SharedDirectoryId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AcceptSharedDirectory';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"SharedDirectoryId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AcceptSharedDirectory',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "SharedDirectoryId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"SharedDirectoryId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AcceptSharedDirectory")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({SharedDirectoryId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AcceptSharedDirectory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {SharedDirectoryId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AcceptSharedDirectory');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
SharedDirectoryId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AcceptSharedDirectory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {SharedDirectoryId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AcceptSharedDirectory';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"SharedDirectoryId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"SharedDirectoryId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AcceptSharedDirectory"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AcceptSharedDirectory" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"SharedDirectoryId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AcceptSharedDirectory",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'SharedDirectoryId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AcceptSharedDirectory', [
'body' => '{
"SharedDirectoryId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AcceptSharedDirectory');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'SharedDirectoryId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'SharedDirectoryId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AcceptSharedDirectory');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AcceptSharedDirectory' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SharedDirectoryId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AcceptSharedDirectory' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SharedDirectoryId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"SharedDirectoryId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AcceptSharedDirectory"
payload = { "SharedDirectoryId": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AcceptSharedDirectory"
payload <- "{\n \"SharedDirectoryId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AcceptSharedDirectory")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"SharedDirectoryId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"SharedDirectoryId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AcceptSharedDirectory";
let payload = json!({"SharedDirectoryId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AcceptSharedDirectory' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"SharedDirectoryId": ""
}'
echo '{
"SharedDirectoryId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AcceptSharedDirectory' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "SharedDirectoryId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AcceptSharedDirectory'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["SharedDirectoryId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AcceptSharedDirectory")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
AddIpRoutes
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddIpRoutes
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"IpRoutes": "",
"UpdateSecurityGroupForDirectoryControllers": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddIpRoutes");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"IpRoutes\": \"\",\n \"UpdateSecurityGroupForDirectoryControllers\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddIpRoutes" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:IpRoutes ""
:UpdateSecurityGroupForDirectoryControllers ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddIpRoutes"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"IpRoutes\": \"\",\n \"UpdateSecurityGroupForDirectoryControllers\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddIpRoutes"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"IpRoutes\": \"\",\n \"UpdateSecurityGroupForDirectoryControllers\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddIpRoutes");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"IpRoutes\": \"\",\n \"UpdateSecurityGroupForDirectoryControllers\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddIpRoutes"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"IpRoutes\": \"\",\n \"UpdateSecurityGroupForDirectoryControllers\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 93
{
"DirectoryId": "",
"IpRoutes": "",
"UpdateSecurityGroupForDirectoryControllers": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddIpRoutes")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"IpRoutes\": \"\",\n \"UpdateSecurityGroupForDirectoryControllers\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddIpRoutes"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"IpRoutes\": \"\",\n \"UpdateSecurityGroupForDirectoryControllers\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"IpRoutes\": \"\",\n \"UpdateSecurityGroupForDirectoryControllers\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddIpRoutes")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddIpRoutes")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"IpRoutes\": \"\",\n \"UpdateSecurityGroupForDirectoryControllers\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
IpRoutes: '',
UpdateSecurityGroupForDirectoryControllers: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddIpRoutes');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddIpRoutes',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', IpRoutes: '', UpdateSecurityGroupForDirectoryControllers: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddIpRoutes';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","IpRoutes":"","UpdateSecurityGroupForDirectoryControllers":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddIpRoutes',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "IpRoutes": "",\n "UpdateSecurityGroupForDirectoryControllers": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"IpRoutes\": \"\",\n \"UpdateSecurityGroupForDirectoryControllers\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddIpRoutes")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', IpRoutes: '', UpdateSecurityGroupForDirectoryControllers: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddIpRoutes',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', IpRoutes: '', UpdateSecurityGroupForDirectoryControllers: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddIpRoutes');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
IpRoutes: '',
UpdateSecurityGroupForDirectoryControllers: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddIpRoutes',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', IpRoutes: '', UpdateSecurityGroupForDirectoryControllers: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddIpRoutes';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","IpRoutes":"","UpdateSecurityGroupForDirectoryControllers":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"IpRoutes": @"",
@"UpdateSecurityGroupForDirectoryControllers": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddIpRoutes"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddIpRoutes" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"IpRoutes\": \"\",\n \"UpdateSecurityGroupForDirectoryControllers\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddIpRoutes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'IpRoutes' => '',
'UpdateSecurityGroupForDirectoryControllers' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddIpRoutes', [
'body' => '{
"DirectoryId": "",
"IpRoutes": "",
"UpdateSecurityGroupForDirectoryControllers": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddIpRoutes');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'IpRoutes' => '',
'UpdateSecurityGroupForDirectoryControllers' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'IpRoutes' => '',
'UpdateSecurityGroupForDirectoryControllers' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddIpRoutes');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddIpRoutes' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"IpRoutes": "",
"UpdateSecurityGroupForDirectoryControllers": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddIpRoutes' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"IpRoutes": "",
"UpdateSecurityGroupForDirectoryControllers": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"IpRoutes\": \"\",\n \"UpdateSecurityGroupForDirectoryControllers\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddIpRoutes"
payload = {
"DirectoryId": "",
"IpRoutes": "",
"UpdateSecurityGroupForDirectoryControllers": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddIpRoutes"
payload <- "{\n \"DirectoryId\": \"\",\n \"IpRoutes\": \"\",\n \"UpdateSecurityGroupForDirectoryControllers\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddIpRoutes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"IpRoutes\": \"\",\n \"UpdateSecurityGroupForDirectoryControllers\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"IpRoutes\": \"\",\n \"UpdateSecurityGroupForDirectoryControllers\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddIpRoutes";
let payload = json!({
"DirectoryId": "",
"IpRoutes": "",
"UpdateSecurityGroupForDirectoryControllers": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddIpRoutes' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"IpRoutes": "",
"UpdateSecurityGroupForDirectoryControllers": ""
}'
echo '{
"DirectoryId": "",
"IpRoutes": "",
"UpdateSecurityGroupForDirectoryControllers": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddIpRoutes' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "IpRoutes": "",\n "UpdateSecurityGroupForDirectoryControllers": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddIpRoutes'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"IpRoutes": "",
"UpdateSecurityGroupForDirectoryControllers": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddIpRoutes")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
AddRegion
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddRegion
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"RegionName": "",
"VPCSettings": {
"VpcId": "",
"SubnetIds": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddRegion");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"RegionName\": \"\",\n \"VPCSettings\": {\n \"VpcId\": \"\",\n \"SubnetIds\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddRegion" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:RegionName ""
:VPCSettings {:VpcId ""
:SubnetIds ""}}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddRegion"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"RegionName\": \"\",\n \"VPCSettings\": {\n \"VpcId\": \"\",\n \"SubnetIds\": \"\"\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddRegion"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"RegionName\": \"\",\n \"VPCSettings\": {\n \"VpcId\": \"\",\n \"SubnetIds\": \"\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddRegion");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"RegionName\": \"\",\n \"VPCSettings\": {\n \"VpcId\": \"\",\n \"SubnetIds\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddRegion"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"RegionName\": \"\",\n \"VPCSettings\": {\n \"VpcId\": \"\",\n \"SubnetIds\": \"\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 104
{
"DirectoryId": "",
"RegionName": "",
"VPCSettings": {
"VpcId": "",
"SubnetIds": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddRegion")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"RegionName\": \"\",\n \"VPCSettings\": {\n \"VpcId\": \"\",\n \"SubnetIds\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddRegion"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"RegionName\": \"\",\n \"VPCSettings\": {\n \"VpcId\": \"\",\n \"SubnetIds\": \"\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"RegionName\": \"\",\n \"VPCSettings\": {\n \"VpcId\": \"\",\n \"SubnetIds\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddRegion")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddRegion")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"RegionName\": \"\",\n \"VPCSettings\": {\n \"VpcId\": \"\",\n \"SubnetIds\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
RegionName: '',
VPCSettings: {
VpcId: '',
SubnetIds: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddRegion');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddRegion',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', RegionName: '', VPCSettings: {VpcId: '', SubnetIds: ''}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddRegion';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","RegionName":"","VPCSettings":{"VpcId":"","SubnetIds":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddRegion',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "RegionName": "",\n "VPCSettings": {\n "VpcId": "",\n "SubnetIds": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"RegionName\": \"\",\n \"VPCSettings\": {\n \"VpcId\": \"\",\n \"SubnetIds\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddRegion")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', RegionName: '', VPCSettings: {VpcId: '', SubnetIds: ''}}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddRegion',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', RegionName: '', VPCSettings: {VpcId: '', SubnetIds: ''}},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddRegion');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
RegionName: '',
VPCSettings: {
VpcId: '',
SubnetIds: ''
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddRegion',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', RegionName: '', VPCSettings: {VpcId: '', SubnetIds: ''}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddRegion';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","RegionName":"","VPCSettings":{"VpcId":"","SubnetIds":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"RegionName": @"",
@"VPCSettings": @{ @"VpcId": @"", @"SubnetIds": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddRegion"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddRegion" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"RegionName\": \"\",\n \"VPCSettings\": {\n \"VpcId\": \"\",\n \"SubnetIds\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddRegion",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'RegionName' => '',
'VPCSettings' => [
'VpcId' => '',
'SubnetIds' => ''
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddRegion', [
'body' => '{
"DirectoryId": "",
"RegionName": "",
"VPCSettings": {
"VpcId": "",
"SubnetIds": ""
}
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddRegion');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'RegionName' => '',
'VPCSettings' => [
'VpcId' => '',
'SubnetIds' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'RegionName' => '',
'VPCSettings' => [
'VpcId' => '',
'SubnetIds' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddRegion');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddRegion' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"RegionName": "",
"VPCSettings": {
"VpcId": "",
"SubnetIds": ""
}
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddRegion' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"RegionName": "",
"VPCSettings": {
"VpcId": "",
"SubnetIds": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"RegionName\": \"\",\n \"VPCSettings\": {\n \"VpcId\": \"\",\n \"SubnetIds\": \"\"\n }\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddRegion"
payload = {
"DirectoryId": "",
"RegionName": "",
"VPCSettings": {
"VpcId": "",
"SubnetIds": ""
}
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddRegion"
payload <- "{\n \"DirectoryId\": \"\",\n \"RegionName\": \"\",\n \"VPCSettings\": {\n \"VpcId\": \"\",\n \"SubnetIds\": \"\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddRegion")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"RegionName\": \"\",\n \"VPCSettings\": {\n \"VpcId\": \"\",\n \"SubnetIds\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"RegionName\": \"\",\n \"VPCSettings\": {\n \"VpcId\": \"\",\n \"SubnetIds\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddRegion";
let payload = json!({
"DirectoryId": "",
"RegionName": "",
"VPCSettings": json!({
"VpcId": "",
"SubnetIds": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddRegion' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"RegionName": "",
"VPCSettings": {
"VpcId": "",
"SubnetIds": ""
}
}'
echo '{
"DirectoryId": "",
"RegionName": "",
"VPCSettings": {
"VpcId": "",
"SubnetIds": ""
}
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddRegion' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "RegionName": "",\n "VPCSettings": {\n "VpcId": "",\n "SubnetIds": ""\n }\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddRegion'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"RegionName": "",
"VPCSettings": [
"VpcId": "",
"SubnetIds": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddRegion")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
AddTagsToResource
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddTagsToResource
HEADERS
X-Amz-Target
BODY json
{
"ResourceId": "",
"Tags": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddTagsToResource");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"ResourceId\": \"\",\n \"Tags\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddTagsToResource" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ResourceId ""
:Tags ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddTagsToResource"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ResourceId\": \"\",\n \"Tags\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddTagsToResource"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ResourceId\": \"\",\n \"Tags\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddTagsToResource");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ResourceId\": \"\",\n \"Tags\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddTagsToResource"
payload := strings.NewReader("{\n \"ResourceId\": \"\",\n \"Tags\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 36
{
"ResourceId": "",
"Tags": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddTagsToResource")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ResourceId\": \"\",\n \"Tags\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddTagsToResource"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ResourceId\": \"\",\n \"Tags\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"ResourceId\": \"\",\n \"Tags\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddTagsToResource")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddTagsToResource")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ResourceId\": \"\",\n \"Tags\": \"\"\n}")
.asString();
const data = JSON.stringify({
ResourceId: '',
Tags: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddTagsToResource');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddTagsToResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ResourceId: '', Tags: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddTagsToResource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ResourceId":"","Tags":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddTagsToResource',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ResourceId": "",\n "Tags": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ResourceId\": \"\",\n \"Tags\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddTagsToResource")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({ResourceId: '', Tags: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddTagsToResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {ResourceId: '', Tags: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddTagsToResource');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ResourceId: '',
Tags: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddTagsToResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ResourceId: '', Tags: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddTagsToResource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ResourceId":"","Tags":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"ResourceId": @"",
@"Tags": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddTagsToResource"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddTagsToResource" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"ResourceId\": \"\",\n \"Tags\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddTagsToResource",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ResourceId' => '',
'Tags' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddTagsToResource', [
'body' => '{
"ResourceId": "",
"Tags": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddTagsToResource');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ResourceId' => '',
'Tags' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ResourceId' => '',
'Tags' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddTagsToResource');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddTagsToResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ResourceId": "",
"Tags": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddTagsToResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ResourceId": "",
"Tags": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ResourceId\": \"\",\n \"Tags\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddTagsToResource"
payload = {
"ResourceId": "",
"Tags": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddTagsToResource"
payload <- "{\n \"ResourceId\": \"\",\n \"Tags\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddTagsToResource")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"ResourceId\": \"\",\n \"Tags\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"ResourceId\": \"\",\n \"Tags\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddTagsToResource";
let payload = json!({
"ResourceId": "",
"Tags": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddTagsToResource' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ResourceId": "",
"Tags": ""
}'
echo '{
"ResourceId": "",
"Tags": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddTagsToResource' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ResourceId": "",\n "Tags": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddTagsToResource'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"ResourceId": "",
"Tags": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.AddTagsToResource")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
CancelSchemaExtension
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CancelSchemaExtension
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"SchemaExtensionId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CancelSchemaExtension");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"SchemaExtensionId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CancelSchemaExtension" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:SchemaExtensionId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CancelSchemaExtension"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"SchemaExtensionId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CancelSchemaExtension"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"SchemaExtensionId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CancelSchemaExtension");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"SchemaExtensionId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CancelSchemaExtension"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"SchemaExtensionId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 50
{
"DirectoryId": "",
"SchemaExtensionId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CancelSchemaExtension")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"SchemaExtensionId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CancelSchemaExtension"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"SchemaExtensionId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"SchemaExtensionId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CancelSchemaExtension")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CancelSchemaExtension")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"SchemaExtensionId\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
SchemaExtensionId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CancelSchemaExtension');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CancelSchemaExtension',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', SchemaExtensionId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CancelSchemaExtension';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","SchemaExtensionId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CancelSchemaExtension',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "SchemaExtensionId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"SchemaExtensionId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CancelSchemaExtension")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', SchemaExtensionId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CancelSchemaExtension',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', SchemaExtensionId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CancelSchemaExtension');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
SchemaExtensionId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CancelSchemaExtension',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', SchemaExtensionId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CancelSchemaExtension';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","SchemaExtensionId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"SchemaExtensionId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CancelSchemaExtension"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CancelSchemaExtension" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"SchemaExtensionId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CancelSchemaExtension",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'SchemaExtensionId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CancelSchemaExtension', [
'body' => '{
"DirectoryId": "",
"SchemaExtensionId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CancelSchemaExtension');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'SchemaExtensionId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'SchemaExtensionId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CancelSchemaExtension');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CancelSchemaExtension' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"SchemaExtensionId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CancelSchemaExtension' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"SchemaExtensionId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"SchemaExtensionId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CancelSchemaExtension"
payload = {
"DirectoryId": "",
"SchemaExtensionId": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CancelSchemaExtension"
payload <- "{\n \"DirectoryId\": \"\",\n \"SchemaExtensionId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CancelSchemaExtension")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"SchemaExtensionId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"SchemaExtensionId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CancelSchemaExtension";
let payload = json!({
"DirectoryId": "",
"SchemaExtensionId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CancelSchemaExtension' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"SchemaExtensionId": ""
}'
echo '{
"DirectoryId": "",
"SchemaExtensionId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CancelSchemaExtension' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "SchemaExtensionId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CancelSchemaExtension'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"SchemaExtensionId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CancelSchemaExtension")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
ConnectDirectory
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ConnectDirectory
HEADERS
X-Amz-Target
BODY json
{
"Name": "",
"ShortName": "",
"Password": "",
"Description": "",
"Size": "",
"ConnectSettings": "",
"Tags": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ConnectDirectory");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"Size\": \"\",\n \"ConnectSettings\": \"\",\n \"Tags\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ConnectDirectory" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Name ""
:ShortName ""
:Password ""
:Description ""
:Size ""
:ConnectSettings ""
:Tags ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ConnectDirectory"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"Size\": \"\",\n \"ConnectSettings\": \"\",\n \"Tags\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ConnectDirectory"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"Size\": \"\",\n \"ConnectSettings\": \"\",\n \"Tags\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ConnectDirectory");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"Size\": \"\",\n \"ConnectSettings\": \"\",\n \"Tags\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ConnectDirectory"
payload := strings.NewReader("{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"Size\": \"\",\n \"ConnectSettings\": \"\",\n \"Tags\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 127
{
"Name": "",
"ShortName": "",
"Password": "",
"Description": "",
"Size": "",
"ConnectSettings": "",
"Tags": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ConnectDirectory")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"Size\": \"\",\n \"ConnectSettings\": \"\",\n \"Tags\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ConnectDirectory"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"Size\": \"\",\n \"ConnectSettings\": \"\",\n \"Tags\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"Size\": \"\",\n \"ConnectSettings\": \"\",\n \"Tags\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ConnectDirectory")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ConnectDirectory")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"Size\": \"\",\n \"ConnectSettings\": \"\",\n \"Tags\": \"\"\n}")
.asString();
const data = JSON.stringify({
Name: '',
ShortName: '',
Password: '',
Description: '',
Size: '',
ConnectSettings: '',
Tags: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ConnectDirectory');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ConnectDirectory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Name: '',
ShortName: '',
Password: '',
Description: '',
Size: '',
ConnectSettings: '',
Tags: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ConnectDirectory';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","ShortName":"","Password":"","Description":"","Size":"","ConnectSettings":"","Tags":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ConnectDirectory',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Name": "",\n "ShortName": "",\n "Password": "",\n "Description": "",\n "Size": "",\n "ConnectSettings": "",\n "Tags": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"Size\": \"\",\n \"ConnectSettings\": \"\",\n \"Tags\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ConnectDirectory")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
Name: '',
ShortName: '',
Password: '',
Description: '',
Size: '',
ConnectSettings: '',
Tags: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ConnectDirectory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
Name: '',
ShortName: '',
Password: '',
Description: '',
Size: '',
ConnectSettings: '',
Tags: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ConnectDirectory');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Name: '',
ShortName: '',
Password: '',
Description: '',
Size: '',
ConnectSettings: '',
Tags: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ConnectDirectory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Name: '',
ShortName: '',
Password: '',
Description: '',
Size: '',
ConnectSettings: '',
Tags: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ConnectDirectory';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","ShortName":"","Password":"","Description":"","Size":"","ConnectSettings":"","Tags":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"Name": @"",
@"ShortName": @"",
@"Password": @"",
@"Description": @"",
@"Size": @"",
@"ConnectSettings": @"",
@"Tags": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ConnectDirectory"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ConnectDirectory" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"Size\": \"\",\n \"ConnectSettings\": \"\",\n \"Tags\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ConnectDirectory",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'Name' => '',
'ShortName' => '',
'Password' => '',
'Description' => '',
'Size' => '',
'ConnectSettings' => '',
'Tags' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ConnectDirectory', [
'body' => '{
"Name": "",
"ShortName": "",
"Password": "",
"Description": "",
"Size": "",
"ConnectSettings": "",
"Tags": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ConnectDirectory');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Name' => '',
'ShortName' => '',
'Password' => '',
'Description' => '',
'Size' => '',
'ConnectSettings' => '',
'Tags' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Name' => '',
'ShortName' => '',
'Password' => '',
'Description' => '',
'Size' => '',
'ConnectSettings' => '',
'Tags' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ConnectDirectory');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ConnectDirectory' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"ShortName": "",
"Password": "",
"Description": "",
"Size": "",
"ConnectSettings": "",
"Tags": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ConnectDirectory' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"ShortName": "",
"Password": "",
"Description": "",
"Size": "",
"ConnectSettings": "",
"Tags": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"Size\": \"\",\n \"ConnectSettings\": \"\",\n \"Tags\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ConnectDirectory"
payload = {
"Name": "",
"ShortName": "",
"Password": "",
"Description": "",
"Size": "",
"ConnectSettings": "",
"Tags": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ConnectDirectory"
payload <- "{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"Size\": \"\",\n \"ConnectSettings\": \"\",\n \"Tags\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ConnectDirectory")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"Size\": \"\",\n \"ConnectSettings\": \"\",\n \"Tags\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"Size\": \"\",\n \"ConnectSettings\": \"\",\n \"Tags\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ConnectDirectory";
let payload = json!({
"Name": "",
"ShortName": "",
"Password": "",
"Description": "",
"Size": "",
"ConnectSettings": "",
"Tags": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ConnectDirectory' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Name": "",
"ShortName": "",
"Password": "",
"Description": "",
"Size": "",
"ConnectSettings": "",
"Tags": ""
}'
echo '{
"Name": "",
"ShortName": "",
"Password": "",
"Description": "",
"Size": "",
"ConnectSettings": "",
"Tags": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ConnectDirectory' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Name": "",\n "ShortName": "",\n "Password": "",\n "Description": "",\n "Size": "",\n "ConnectSettings": "",\n "Tags": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ConnectDirectory'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Name": "",
"ShortName": "",
"Password": "",
"Description": "",
"Size": "",
"ConnectSettings": "",
"Tags": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ConnectDirectory")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
CreateAlias
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateAlias
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"Alias": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateAlias");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"Alias\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateAlias" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:Alias ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateAlias"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"Alias\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateAlias"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"Alias\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateAlias");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"Alias\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateAlias"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"Alias\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 38
{
"DirectoryId": "",
"Alias": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateAlias")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"Alias\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateAlias"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"Alias\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"Alias\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateAlias")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateAlias")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"Alias\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
Alias: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateAlias');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateAlias',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', Alias: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateAlias';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","Alias":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateAlias',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "Alias": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"Alias\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateAlias")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', Alias: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateAlias',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', Alias: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateAlias');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
Alias: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateAlias',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', Alias: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateAlias';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","Alias":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"Alias": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateAlias"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateAlias" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"Alias\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateAlias",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'Alias' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateAlias', [
'body' => '{
"DirectoryId": "",
"Alias": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateAlias');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'Alias' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'Alias' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateAlias');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateAlias' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"Alias": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateAlias' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"Alias": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"Alias\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateAlias"
payload = {
"DirectoryId": "",
"Alias": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateAlias"
payload <- "{\n \"DirectoryId\": \"\",\n \"Alias\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateAlias")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"Alias\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"Alias\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateAlias";
let payload = json!({
"DirectoryId": "",
"Alias": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateAlias' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"Alias": ""
}'
echo '{
"DirectoryId": "",
"Alias": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateAlias' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "Alias": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateAlias'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"Alias": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateAlias")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
CreateComputer
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateComputer
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"ComputerName": "",
"Password": "",
"OrganizationalUnitDistinguishedName": "",
"ComputerAttributes": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateComputer");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"ComputerName\": \"\",\n \"Password\": \"\",\n \"OrganizationalUnitDistinguishedName\": \"\",\n \"ComputerAttributes\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateComputer" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:ComputerName ""
:Password ""
:OrganizationalUnitDistinguishedName ""
:ComputerAttributes ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateComputer"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"ComputerName\": \"\",\n \"Password\": \"\",\n \"OrganizationalUnitDistinguishedName\": \"\",\n \"ComputerAttributes\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateComputer"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"ComputerName\": \"\",\n \"Password\": \"\",\n \"OrganizationalUnitDistinguishedName\": \"\",\n \"ComputerAttributes\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateComputer");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"ComputerName\": \"\",\n \"Password\": \"\",\n \"OrganizationalUnitDistinguishedName\": \"\",\n \"ComputerAttributes\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateComputer"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"ComputerName\": \"\",\n \"Password\": \"\",\n \"OrganizationalUnitDistinguishedName\": \"\",\n \"ComputerAttributes\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 136
{
"DirectoryId": "",
"ComputerName": "",
"Password": "",
"OrganizationalUnitDistinguishedName": "",
"ComputerAttributes": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateComputer")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"ComputerName\": \"\",\n \"Password\": \"\",\n \"OrganizationalUnitDistinguishedName\": \"\",\n \"ComputerAttributes\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateComputer"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"ComputerName\": \"\",\n \"Password\": \"\",\n \"OrganizationalUnitDistinguishedName\": \"\",\n \"ComputerAttributes\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"ComputerName\": \"\",\n \"Password\": \"\",\n \"OrganizationalUnitDistinguishedName\": \"\",\n \"ComputerAttributes\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateComputer")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateComputer")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"ComputerName\": \"\",\n \"Password\": \"\",\n \"OrganizationalUnitDistinguishedName\": \"\",\n \"ComputerAttributes\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
ComputerName: '',
Password: '',
OrganizationalUnitDistinguishedName: '',
ComputerAttributes: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateComputer');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateComputer',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
DirectoryId: '',
ComputerName: '',
Password: '',
OrganizationalUnitDistinguishedName: '',
ComputerAttributes: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateComputer';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","ComputerName":"","Password":"","OrganizationalUnitDistinguishedName":"","ComputerAttributes":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateComputer',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "ComputerName": "",\n "Password": "",\n "OrganizationalUnitDistinguishedName": "",\n "ComputerAttributes": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"ComputerName\": \"\",\n \"Password\": \"\",\n \"OrganizationalUnitDistinguishedName\": \"\",\n \"ComputerAttributes\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateComputer")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
DirectoryId: '',
ComputerName: '',
Password: '',
OrganizationalUnitDistinguishedName: '',
ComputerAttributes: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateComputer',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
DirectoryId: '',
ComputerName: '',
Password: '',
OrganizationalUnitDistinguishedName: '',
ComputerAttributes: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateComputer');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
ComputerName: '',
Password: '',
OrganizationalUnitDistinguishedName: '',
ComputerAttributes: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateComputer',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
DirectoryId: '',
ComputerName: '',
Password: '',
OrganizationalUnitDistinguishedName: '',
ComputerAttributes: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateComputer';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","ComputerName":"","Password":"","OrganizationalUnitDistinguishedName":"","ComputerAttributes":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"ComputerName": @"",
@"Password": @"",
@"OrganizationalUnitDistinguishedName": @"",
@"ComputerAttributes": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateComputer"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateComputer" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"ComputerName\": \"\",\n \"Password\": \"\",\n \"OrganizationalUnitDistinguishedName\": \"\",\n \"ComputerAttributes\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateComputer",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'ComputerName' => '',
'Password' => '',
'OrganizationalUnitDistinguishedName' => '',
'ComputerAttributes' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateComputer', [
'body' => '{
"DirectoryId": "",
"ComputerName": "",
"Password": "",
"OrganizationalUnitDistinguishedName": "",
"ComputerAttributes": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateComputer');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'ComputerName' => '',
'Password' => '',
'OrganizationalUnitDistinguishedName' => '',
'ComputerAttributes' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'ComputerName' => '',
'Password' => '',
'OrganizationalUnitDistinguishedName' => '',
'ComputerAttributes' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateComputer');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateComputer' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"ComputerName": "",
"Password": "",
"OrganizationalUnitDistinguishedName": "",
"ComputerAttributes": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateComputer' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"ComputerName": "",
"Password": "",
"OrganizationalUnitDistinguishedName": "",
"ComputerAttributes": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"ComputerName\": \"\",\n \"Password\": \"\",\n \"OrganizationalUnitDistinguishedName\": \"\",\n \"ComputerAttributes\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateComputer"
payload = {
"DirectoryId": "",
"ComputerName": "",
"Password": "",
"OrganizationalUnitDistinguishedName": "",
"ComputerAttributes": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateComputer"
payload <- "{\n \"DirectoryId\": \"\",\n \"ComputerName\": \"\",\n \"Password\": \"\",\n \"OrganizationalUnitDistinguishedName\": \"\",\n \"ComputerAttributes\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateComputer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"ComputerName\": \"\",\n \"Password\": \"\",\n \"OrganizationalUnitDistinguishedName\": \"\",\n \"ComputerAttributes\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"ComputerName\": \"\",\n \"Password\": \"\",\n \"OrganizationalUnitDistinguishedName\": \"\",\n \"ComputerAttributes\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateComputer";
let payload = json!({
"DirectoryId": "",
"ComputerName": "",
"Password": "",
"OrganizationalUnitDistinguishedName": "",
"ComputerAttributes": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateComputer' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"ComputerName": "",
"Password": "",
"OrganizationalUnitDistinguishedName": "",
"ComputerAttributes": ""
}'
echo '{
"DirectoryId": "",
"ComputerName": "",
"Password": "",
"OrganizationalUnitDistinguishedName": "",
"ComputerAttributes": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateComputer' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "ComputerName": "",\n "Password": "",\n "OrganizationalUnitDistinguishedName": "",\n "ComputerAttributes": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateComputer'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"ComputerName": "",
"Password": "",
"OrganizationalUnitDistinguishedName": "",
"ComputerAttributes": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateComputer")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
CreateConditionalForwarder
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateConditionalForwarder
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"RemoteDomainName": "",
"DnsIpAddrs": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateConditionalForwarder");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"DnsIpAddrs\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateConditionalForwarder" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:RemoteDomainName ""
:DnsIpAddrs ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateConditionalForwarder"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"DnsIpAddrs\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateConditionalForwarder"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"DnsIpAddrs\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateConditionalForwarder");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"DnsIpAddrs\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateConditionalForwarder"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"DnsIpAddrs\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 69
{
"DirectoryId": "",
"RemoteDomainName": "",
"DnsIpAddrs": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateConditionalForwarder")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"DnsIpAddrs\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateConditionalForwarder"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"DnsIpAddrs\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"DnsIpAddrs\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateConditionalForwarder")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateConditionalForwarder")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"DnsIpAddrs\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
RemoteDomainName: '',
DnsIpAddrs: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateConditionalForwarder');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateConditionalForwarder',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', RemoteDomainName: '', DnsIpAddrs: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateConditionalForwarder';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","RemoteDomainName":"","DnsIpAddrs":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateConditionalForwarder',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "RemoteDomainName": "",\n "DnsIpAddrs": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"DnsIpAddrs\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateConditionalForwarder")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', RemoteDomainName: '', DnsIpAddrs: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateConditionalForwarder',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', RemoteDomainName: '', DnsIpAddrs: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateConditionalForwarder');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
RemoteDomainName: '',
DnsIpAddrs: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateConditionalForwarder',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', RemoteDomainName: '', DnsIpAddrs: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateConditionalForwarder';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","RemoteDomainName":"","DnsIpAddrs":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"RemoteDomainName": @"",
@"DnsIpAddrs": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateConditionalForwarder"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateConditionalForwarder" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"DnsIpAddrs\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateConditionalForwarder",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'RemoteDomainName' => '',
'DnsIpAddrs' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateConditionalForwarder', [
'body' => '{
"DirectoryId": "",
"RemoteDomainName": "",
"DnsIpAddrs": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateConditionalForwarder');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'RemoteDomainName' => '',
'DnsIpAddrs' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'RemoteDomainName' => '',
'DnsIpAddrs' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateConditionalForwarder');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateConditionalForwarder' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"RemoteDomainName": "",
"DnsIpAddrs": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateConditionalForwarder' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"RemoteDomainName": "",
"DnsIpAddrs": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"DnsIpAddrs\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateConditionalForwarder"
payload = {
"DirectoryId": "",
"RemoteDomainName": "",
"DnsIpAddrs": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateConditionalForwarder"
payload <- "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"DnsIpAddrs\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateConditionalForwarder")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"DnsIpAddrs\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"DnsIpAddrs\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateConditionalForwarder";
let payload = json!({
"DirectoryId": "",
"RemoteDomainName": "",
"DnsIpAddrs": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateConditionalForwarder' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"RemoteDomainName": "",
"DnsIpAddrs": ""
}'
echo '{
"DirectoryId": "",
"RemoteDomainName": "",
"DnsIpAddrs": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateConditionalForwarder' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "RemoteDomainName": "",\n "DnsIpAddrs": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateConditionalForwarder'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"RemoteDomainName": "",
"DnsIpAddrs": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateConditionalForwarder")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
CreateDirectory
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateDirectory
HEADERS
X-Amz-Target
BODY json
{
"Name": "",
"ShortName": "",
"Password": "",
"Description": "",
"Size": "",
"VpcSettings": "",
"Tags": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateDirectory");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"Size\": \"\",\n \"VpcSettings\": \"\",\n \"Tags\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateDirectory" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Name ""
:ShortName ""
:Password ""
:Description ""
:Size ""
:VpcSettings ""
:Tags ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateDirectory"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"Size\": \"\",\n \"VpcSettings\": \"\",\n \"Tags\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateDirectory"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"Size\": \"\",\n \"VpcSettings\": \"\",\n \"Tags\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateDirectory");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"Size\": \"\",\n \"VpcSettings\": \"\",\n \"Tags\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateDirectory"
payload := strings.NewReader("{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"Size\": \"\",\n \"VpcSettings\": \"\",\n \"Tags\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 123
{
"Name": "",
"ShortName": "",
"Password": "",
"Description": "",
"Size": "",
"VpcSettings": "",
"Tags": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateDirectory")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"Size\": \"\",\n \"VpcSettings\": \"\",\n \"Tags\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateDirectory"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"Size\": \"\",\n \"VpcSettings\": \"\",\n \"Tags\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"Size\": \"\",\n \"VpcSettings\": \"\",\n \"Tags\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateDirectory")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateDirectory")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"Size\": \"\",\n \"VpcSettings\": \"\",\n \"Tags\": \"\"\n}")
.asString();
const data = JSON.stringify({
Name: '',
ShortName: '',
Password: '',
Description: '',
Size: '',
VpcSettings: '',
Tags: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateDirectory');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateDirectory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Name: '',
ShortName: '',
Password: '',
Description: '',
Size: '',
VpcSettings: '',
Tags: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateDirectory';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","ShortName":"","Password":"","Description":"","Size":"","VpcSettings":"","Tags":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateDirectory',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Name": "",\n "ShortName": "",\n "Password": "",\n "Description": "",\n "Size": "",\n "VpcSettings": "",\n "Tags": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"Size\": \"\",\n \"VpcSettings\": \"\",\n \"Tags\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateDirectory")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
Name: '',
ShortName: '',
Password: '',
Description: '',
Size: '',
VpcSettings: '',
Tags: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateDirectory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
Name: '',
ShortName: '',
Password: '',
Description: '',
Size: '',
VpcSettings: '',
Tags: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateDirectory');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Name: '',
ShortName: '',
Password: '',
Description: '',
Size: '',
VpcSettings: '',
Tags: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateDirectory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Name: '',
ShortName: '',
Password: '',
Description: '',
Size: '',
VpcSettings: '',
Tags: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateDirectory';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","ShortName":"","Password":"","Description":"","Size":"","VpcSettings":"","Tags":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"Name": @"",
@"ShortName": @"",
@"Password": @"",
@"Description": @"",
@"Size": @"",
@"VpcSettings": @"",
@"Tags": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateDirectory"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateDirectory" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"Size\": \"\",\n \"VpcSettings\": \"\",\n \"Tags\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateDirectory",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'Name' => '',
'ShortName' => '',
'Password' => '',
'Description' => '',
'Size' => '',
'VpcSettings' => '',
'Tags' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateDirectory', [
'body' => '{
"Name": "",
"ShortName": "",
"Password": "",
"Description": "",
"Size": "",
"VpcSettings": "",
"Tags": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateDirectory');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Name' => '',
'ShortName' => '',
'Password' => '',
'Description' => '',
'Size' => '',
'VpcSettings' => '',
'Tags' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Name' => '',
'ShortName' => '',
'Password' => '',
'Description' => '',
'Size' => '',
'VpcSettings' => '',
'Tags' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateDirectory');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateDirectory' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"ShortName": "",
"Password": "",
"Description": "",
"Size": "",
"VpcSettings": "",
"Tags": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateDirectory' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"ShortName": "",
"Password": "",
"Description": "",
"Size": "",
"VpcSettings": "",
"Tags": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"Size\": \"\",\n \"VpcSettings\": \"\",\n \"Tags\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateDirectory"
payload = {
"Name": "",
"ShortName": "",
"Password": "",
"Description": "",
"Size": "",
"VpcSettings": "",
"Tags": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateDirectory"
payload <- "{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"Size\": \"\",\n \"VpcSettings\": \"\",\n \"Tags\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateDirectory")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"Size\": \"\",\n \"VpcSettings\": \"\",\n \"Tags\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"Size\": \"\",\n \"VpcSettings\": \"\",\n \"Tags\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateDirectory";
let payload = json!({
"Name": "",
"ShortName": "",
"Password": "",
"Description": "",
"Size": "",
"VpcSettings": "",
"Tags": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateDirectory' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Name": "",
"ShortName": "",
"Password": "",
"Description": "",
"Size": "",
"VpcSettings": "",
"Tags": ""
}'
echo '{
"Name": "",
"ShortName": "",
"Password": "",
"Description": "",
"Size": "",
"VpcSettings": "",
"Tags": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateDirectory' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Name": "",\n "ShortName": "",\n "Password": "",\n "Description": "",\n "Size": "",\n "VpcSettings": "",\n "Tags": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateDirectory'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Name": "",
"ShortName": "",
"Password": "",
"Description": "",
"Size": "",
"VpcSettings": "",
"Tags": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateDirectory")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
CreateLogSubscription
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateLogSubscription
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"LogGroupName": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateLogSubscription");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"LogGroupName\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateLogSubscription" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:LogGroupName ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateLogSubscription"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"LogGroupName\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateLogSubscription"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"LogGroupName\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateLogSubscription");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"LogGroupName\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateLogSubscription"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"LogGroupName\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 45
{
"DirectoryId": "",
"LogGroupName": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateLogSubscription")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"LogGroupName\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateLogSubscription"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"LogGroupName\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"LogGroupName\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateLogSubscription")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateLogSubscription")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"LogGroupName\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
LogGroupName: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateLogSubscription');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateLogSubscription',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', LogGroupName: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateLogSubscription';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","LogGroupName":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateLogSubscription',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "LogGroupName": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"LogGroupName\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateLogSubscription")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', LogGroupName: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateLogSubscription',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', LogGroupName: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateLogSubscription');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
LogGroupName: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateLogSubscription',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', LogGroupName: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateLogSubscription';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","LogGroupName":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"LogGroupName": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateLogSubscription"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateLogSubscription" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"LogGroupName\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateLogSubscription",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'LogGroupName' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateLogSubscription', [
'body' => '{
"DirectoryId": "",
"LogGroupName": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateLogSubscription');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'LogGroupName' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'LogGroupName' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateLogSubscription');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateLogSubscription' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"LogGroupName": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateLogSubscription' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"LogGroupName": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"LogGroupName\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateLogSubscription"
payload = {
"DirectoryId": "",
"LogGroupName": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateLogSubscription"
payload <- "{\n \"DirectoryId\": \"\",\n \"LogGroupName\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateLogSubscription")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"LogGroupName\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"LogGroupName\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateLogSubscription";
let payload = json!({
"DirectoryId": "",
"LogGroupName": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateLogSubscription' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"LogGroupName": ""
}'
echo '{
"DirectoryId": "",
"LogGroupName": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateLogSubscription' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "LogGroupName": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateLogSubscription'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"LogGroupName": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateLogSubscription")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
CreateMicrosoftAD
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateMicrosoftAD
HEADERS
X-Amz-Target
BODY json
{
"Name": "",
"ShortName": "",
"Password": "",
"Description": "",
"VpcSettings": "",
"Edition": "",
"Tags": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateMicrosoftAD");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"VpcSettings\": \"\",\n \"Edition\": \"\",\n \"Tags\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateMicrosoftAD" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Name ""
:ShortName ""
:Password ""
:Description ""
:VpcSettings ""
:Edition ""
:Tags ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateMicrosoftAD"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"VpcSettings\": \"\",\n \"Edition\": \"\",\n \"Tags\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateMicrosoftAD"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"VpcSettings\": \"\",\n \"Edition\": \"\",\n \"Tags\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateMicrosoftAD");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"VpcSettings\": \"\",\n \"Edition\": \"\",\n \"Tags\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateMicrosoftAD"
payload := strings.NewReader("{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"VpcSettings\": \"\",\n \"Edition\": \"\",\n \"Tags\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 126
{
"Name": "",
"ShortName": "",
"Password": "",
"Description": "",
"VpcSettings": "",
"Edition": "",
"Tags": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateMicrosoftAD")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"VpcSettings\": \"\",\n \"Edition\": \"\",\n \"Tags\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateMicrosoftAD"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"VpcSettings\": \"\",\n \"Edition\": \"\",\n \"Tags\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"VpcSettings\": \"\",\n \"Edition\": \"\",\n \"Tags\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateMicrosoftAD")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateMicrosoftAD")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"VpcSettings\": \"\",\n \"Edition\": \"\",\n \"Tags\": \"\"\n}")
.asString();
const data = JSON.stringify({
Name: '',
ShortName: '',
Password: '',
Description: '',
VpcSettings: '',
Edition: '',
Tags: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateMicrosoftAD');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateMicrosoftAD',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Name: '',
ShortName: '',
Password: '',
Description: '',
VpcSettings: '',
Edition: '',
Tags: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateMicrosoftAD';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","ShortName":"","Password":"","Description":"","VpcSettings":"","Edition":"","Tags":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateMicrosoftAD',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Name": "",\n "ShortName": "",\n "Password": "",\n "Description": "",\n "VpcSettings": "",\n "Edition": "",\n "Tags": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"VpcSettings\": \"\",\n \"Edition\": \"\",\n \"Tags\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateMicrosoftAD")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
Name: '',
ShortName: '',
Password: '',
Description: '',
VpcSettings: '',
Edition: '',
Tags: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateMicrosoftAD',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
Name: '',
ShortName: '',
Password: '',
Description: '',
VpcSettings: '',
Edition: '',
Tags: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateMicrosoftAD');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Name: '',
ShortName: '',
Password: '',
Description: '',
VpcSettings: '',
Edition: '',
Tags: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateMicrosoftAD',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Name: '',
ShortName: '',
Password: '',
Description: '',
VpcSettings: '',
Edition: '',
Tags: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateMicrosoftAD';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","ShortName":"","Password":"","Description":"","VpcSettings":"","Edition":"","Tags":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"Name": @"",
@"ShortName": @"",
@"Password": @"",
@"Description": @"",
@"VpcSettings": @"",
@"Edition": @"",
@"Tags": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateMicrosoftAD"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateMicrosoftAD" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"VpcSettings\": \"\",\n \"Edition\": \"\",\n \"Tags\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateMicrosoftAD",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'Name' => '',
'ShortName' => '',
'Password' => '',
'Description' => '',
'VpcSettings' => '',
'Edition' => '',
'Tags' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateMicrosoftAD', [
'body' => '{
"Name": "",
"ShortName": "",
"Password": "",
"Description": "",
"VpcSettings": "",
"Edition": "",
"Tags": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateMicrosoftAD');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Name' => '',
'ShortName' => '',
'Password' => '',
'Description' => '',
'VpcSettings' => '',
'Edition' => '',
'Tags' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Name' => '',
'ShortName' => '',
'Password' => '',
'Description' => '',
'VpcSettings' => '',
'Edition' => '',
'Tags' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateMicrosoftAD');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateMicrosoftAD' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"ShortName": "",
"Password": "",
"Description": "",
"VpcSettings": "",
"Edition": "",
"Tags": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateMicrosoftAD' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"ShortName": "",
"Password": "",
"Description": "",
"VpcSettings": "",
"Edition": "",
"Tags": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"VpcSettings\": \"\",\n \"Edition\": \"\",\n \"Tags\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateMicrosoftAD"
payload = {
"Name": "",
"ShortName": "",
"Password": "",
"Description": "",
"VpcSettings": "",
"Edition": "",
"Tags": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateMicrosoftAD"
payload <- "{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"VpcSettings\": \"\",\n \"Edition\": \"\",\n \"Tags\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateMicrosoftAD")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"VpcSettings\": \"\",\n \"Edition\": \"\",\n \"Tags\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"Name\": \"\",\n \"ShortName\": \"\",\n \"Password\": \"\",\n \"Description\": \"\",\n \"VpcSettings\": \"\",\n \"Edition\": \"\",\n \"Tags\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateMicrosoftAD";
let payload = json!({
"Name": "",
"ShortName": "",
"Password": "",
"Description": "",
"VpcSettings": "",
"Edition": "",
"Tags": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateMicrosoftAD' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Name": "",
"ShortName": "",
"Password": "",
"Description": "",
"VpcSettings": "",
"Edition": "",
"Tags": ""
}'
echo '{
"Name": "",
"ShortName": "",
"Password": "",
"Description": "",
"VpcSettings": "",
"Edition": "",
"Tags": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateMicrosoftAD' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Name": "",\n "ShortName": "",\n "Password": "",\n "Description": "",\n "VpcSettings": "",\n "Edition": "",\n "Tags": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateMicrosoftAD'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Name": "",
"ShortName": "",
"Password": "",
"Description": "",
"VpcSettings": "",
"Edition": "",
"Tags": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateMicrosoftAD")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
CreateSnapshot
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateSnapshot
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"Name": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateSnapshot");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"Name\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateSnapshot" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:Name ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateSnapshot"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"Name\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateSnapshot"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"Name\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateSnapshot");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"Name\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateSnapshot"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"Name\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 37
{
"DirectoryId": "",
"Name": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateSnapshot")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"Name\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateSnapshot"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"Name\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"Name\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateSnapshot")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateSnapshot")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"Name\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
Name: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateSnapshot');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateSnapshot',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', Name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateSnapshot';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","Name":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateSnapshot',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "Name": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"Name\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateSnapshot")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', Name: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateSnapshot',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', Name: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateSnapshot');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
Name: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateSnapshot',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', Name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateSnapshot';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","Name":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"Name": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateSnapshot"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateSnapshot" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"Name\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateSnapshot",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'Name' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateSnapshot', [
'body' => '{
"DirectoryId": "",
"Name": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateSnapshot');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'Name' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'Name' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateSnapshot');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateSnapshot' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"Name": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateSnapshot' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"Name": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"Name\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateSnapshot"
payload = {
"DirectoryId": "",
"Name": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateSnapshot"
payload <- "{\n \"DirectoryId\": \"\",\n \"Name\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateSnapshot")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"Name\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"Name\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateSnapshot";
let payload = json!({
"DirectoryId": "",
"Name": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateSnapshot' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"Name": ""
}'
echo '{
"DirectoryId": "",
"Name": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateSnapshot' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "Name": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateSnapshot'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"Name": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateSnapshot")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
CreateTrust
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateTrust
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"RemoteDomainName": "",
"TrustPassword": "",
"TrustDirection": "",
"TrustType": "",
"ConditionalForwarderIpAddrs": "",
"SelectiveAuth": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateTrust");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"TrustPassword\": \"\",\n \"TrustDirection\": \"\",\n \"TrustType\": \"\",\n \"ConditionalForwarderIpAddrs\": \"\",\n \"SelectiveAuth\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateTrust" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:RemoteDomainName ""
:TrustPassword ""
:TrustDirection ""
:TrustType ""
:ConditionalForwarderIpAddrs ""
:SelectiveAuth ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateTrust"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"TrustPassword\": \"\",\n \"TrustDirection\": \"\",\n \"TrustType\": \"\",\n \"ConditionalForwarderIpAddrs\": \"\",\n \"SelectiveAuth\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateTrust"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"TrustPassword\": \"\",\n \"TrustDirection\": \"\",\n \"TrustType\": \"\",\n \"ConditionalForwarderIpAddrs\": \"\",\n \"SelectiveAuth\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateTrust");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"TrustPassword\": \"\",\n \"TrustDirection\": \"\",\n \"TrustType\": \"\",\n \"ConditionalForwarderIpAddrs\": \"\",\n \"SelectiveAuth\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateTrust"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"TrustPassword\": \"\",\n \"TrustDirection\": \"\",\n \"TrustType\": \"\",\n \"ConditionalForwarderIpAddrs\": \"\",\n \"SelectiveAuth\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 175
{
"DirectoryId": "",
"RemoteDomainName": "",
"TrustPassword": "",
"TrustDirection": "",
"TrustType": "",
"ConditionalForwarderIpAddrs": "",
"SelectiveAuth": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateTrust")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"TrustPassword\": \"\",\n \"TrustDirection\": \"\",\n \"TrustType\": \"\",\n \"ConditionalForwarderIpAddrs\": \"\",\n \"SelectiveAuth\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateTrust"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"TrustPassword\": \"\",\n \"TrustDirection\": \"\",\n \"TrustType\": \"\",\n \"ConditionalForwarderIpAddrs\": \"\",\n \"SelectiveAuth\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"TrustPassword\": \"\",\n \"TrustDirection\": \"\",\n \"TrustType\": \"\",\n \"ConditionalForwarderIpAddrs\": \"\",\n \"SelectiveAuth\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateTrust")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateTrust")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"TrustPassword\": \"\",\n \"TrustDirection\": \"\",\n \"TrustType\": \"\",\n \"ConditionalForwarderIpAddrs\": \"\",\n \"SelectiveAuth\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
RemoteDomainName: '',
TrustPassword: '',
TrustDirection: '',
TrustType: '',
ConditionalForwarderIpAddrs: '',
SelectiveAuth: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateTrust');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateTrust',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
DirectoryId: '',
RemoteDomainName: '',
TrustPassword: '',
TrustDirection: '',
TrustType: '',
ConditionalForwarderIpAddrs: '',
SelectiveAuth: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateTrust';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","RemoteDomainName":"","TrustPassword":"","TrustDirection":"","TrustType":"","ConditionalForwarderIpAddrs":"","SelectiveAuth":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateTrust',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "RemoteDomainName": "",\n "TrustPassword": "",\n "TrustDirection": "",\n "TrustType": "",\n "ConditionalForwarderIpAddrs": "",\n "SelectiveAuth": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"TrustPassword\": \"\",\n \"TrustDirection\": \"\",\n \"TrustType\": \"\",\n \"ConditionalForwarderIpAddrs\": \"\",\n \"SelectiveAuth\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateTrust")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
DirectoryId: '',
RemoteDomainName: '',
TrustPassword: '',
TrustDirection: '',
TrustType: '',
ConditionalForwarderIpAddrs: '',
SelectiveAuth: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateTrust',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
DirectoryId: '',
RemoteDomainName: '',
TrustPassword: '',
TrustDirection: '',
TrustType: '',
ConditionalForwarderIpAddrs: '',
SelectiveAuth: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateTrust');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
RemoteDomainName: '',
TrustPassword: '',
TrustDirection: '',
TrustType: '',
ConditionalForwarderIpAddrs: '',
SelectiveAuth: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateTrust',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
DirectoryId: '',
RemoteDomainName: '',
TrustPassword: '',
TrustDirection: '',
TrustType: '',
ConditionalForwarderIpAddrs: '',
SelectiveAuth: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateTrust';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","RemoteDomainName":"","TrustPassword":"","TrustDirection":"","TrustType":"","ConditionalForwarderIpAddrs":"","SelectiveAuth":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"RemoteDomainName": @"",
@"TrustPassword": @"",
@"TrustDirection": @"",
@"TrustType": @"",
@"ConditionalForwarderIpAddrs": @"",
@"SelectiveAuth": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateTrust"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateTrust" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"TrustPassword\": \"\",\n \"TrustDirection\": \"\",\n \"TrustType\": \"\",\n \"ConditionalForwarderIpAddrs\": \"\",\n \"SelectiveAuth\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateTrust",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'RemoteDomainName' => '',
'TrustPassword' => '',
'TrustDirection' => '',
'TrustType' => '',
'ConditionalForwarderIpAddrs' => '',
'SelectiveAuth' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateTrust', [
'body' => '{
"DirectoryId": "",
"RemoteDomainName": "",
"TrustPassword": "",
"TrustDirection": "",
"TrustType": "",
"ConditionalForwarderIpAddrs": "",
"SelectiveAuth": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateTrust');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'RemoteDomainName' => '',
'TrustPassword' => '',
'TrustDirection' => '',
'TrustType' => '',
'ConditionalForwarderIpAddrs' => '',
'SelectiveAuth' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'RemoteDomainName' => '',
'TrustPassword' => '',
'TrustDirection' => '',
'TrustType' => '',
'ConditionalForwarderIpAddrs' => '',
'SelectiveAuth' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateTrust');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateTrust' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"RemoteDomainName": "",
"TrustPassword": "",
"TrustDirection": "",
"TrustType": "",
"ConditionalForwarderIpAddrs": "",
"SelectiveAuth": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateTrust' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"RemoteDomainName": "",
"TrustPassword": "",
"TrustDirection": "",
"TrustType": "",
"ConditionalForwarderIpAddrs": "",
"SelectiveAuth": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"TrustPassword\": \"\",\n \"TrustDirection\": \"\",\n \"TrustType\": \"\",\n \"ConditionalForwarderIpAddrs\": \"\",\n \"SelectiveAuth\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateTrust"
payload = {
"DirectoryId": "",
"RemoteDomainName": "",
"TrustPassword": "",
"TrustDirection": "",
"TrustType": "",
"ConditionalForwarderIpAddrs": "",
"SelectiveAuth": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateTrust"
payload <- "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"TrustPassword\": \"\",\n \"TrustDirection\": \"\",\n \"TrustType\": \"\",\n \"ConditionalForwarderIpAddrs\": \"\",\n \"SelectiveAuth\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateTrust")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"TrustPassword\": \"\",\n \"TrustDirection\": \"\",\n \"TrustType\": \"\",\n \"ConditionalForwarderIpAddrs\": \"\",\n \"SelectiveAuth\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"TrustPassword\": \"\",\n \"TrustDirection\": \"\",\n \"TrustType\": \"\",\n \"ConditionalForwarderIpAddrs\": \"\",\n \"SelectiveAuth\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateTrust";
let payload = json!({
"DirectoryId": "",
"RemoteDomainName": "",
"TrustPassword": "",
"TrustDirection": "",
"TrustType": "",
"ConditionalForwarderIpAddrs": "",
"SelectiveAuth": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateTrust' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"RemoteDomainName": "",
"TrustPassword": "",
"TrustDirection": "",
"TrustType": "",
"ConditionalForwarderIpAddrs": "",
"SelectiveAuth": ""
}'
echo '{
"DirectoryId": "",
"RemoteDomainName": "",
"TrustPassword": "",
"TrustDirection": "",
"TrustType": "",
"ConditionalForwarderIpAddrs": "",
"SelectiveAuth": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateTrust' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "RemoteDomainName": "",\n "TrustPassword": "",\n "TrustDirection": "",\n "TrustType": "",\n "ConditionalForwarderIpAddrs": "",\n "SelectiveAuth": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateTrust'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"RemoteDomainName": "",
"TrustPassword": "",
"TrustDirection": "",
"TrustType": "",
"ConditionalForwarderIpAddrs": "",
"SelectiveAuth": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.CreateTrust")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DeleteConditionalForwarder
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteConditionalForwarder
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"RemoteDomainName": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteConditionalForwarder");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteConditionalForwarder" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:RemoteDomainName ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteConditionalForwarder"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteConditionalForwarder"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteConditionalForwarder");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteConditionalForwarder"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 49
{
"DirectoryId": "",
"RemoteDomainName": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteConditionalForwarder")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteConditionalForwarder"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteConditionalForwarder")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteConditionalForwarder")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
RemoteDomainName: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteConditionalForwarder');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteConditionalForwarder',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', RemoteDomainName: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteConditionalForwarder';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","RemoteDomainName":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteConditionalForwarder',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "RemoteDomainName": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteConditionalForwarder")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', RemoteDomainName: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteConditionalForwarder',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', RemoteDomainName: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteConditionalForwarder');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
RemoteDomainName: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteConditionalForwarder',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', RemoteDomainName: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteConditionalForwarder';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","RemoteDomainName":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"RemoteDomainName": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteConditionalForwarder"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteConditionalForwarder" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteConditionalForwarder",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'RemoteDomainName' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteConditionalForwarder', [
'body' => '{
"DirectoryId": "",
"RemoteDomainName": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteConditionalForwarder');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'RemoteDomainName' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'RemoteDomainName' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteConditionalForwarder');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteConditionalForwarder' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"RemoteDomainName": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteConditionalForwarder' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"RemoteDomainName": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteConditionalForwarder"
payload = {
"DirectoryId": "",
"RemoteDomainName": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteConditionalForwarder"
payload <- "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteConditionalForwarder")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteConditionalForwarder";
let payload = json!({
"DirectoryId": "",
"RemoteDomainName": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteConditionalForwarder' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"RemoteDomainName": ""
}'
echo '{
"DirectoryId": "",
"RemoteDomainName": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteConditionalForwarder' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "RemoteDomainName": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteConditionalForwarder'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"RemoteDomainName": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteConditionalForwarder")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DeleteDirectory
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteDirectory
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteDirectory");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteDirectory" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteDirectory"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteDirectory"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteDirectory");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteDirectory"
payload := strings.NewReader("{\n \"DirectoryId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 23
{
"DirectoryId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteDirectory")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteDirectory"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteDirectory")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteDirectory")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteDirectory');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteDirectory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteDirectory';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteDirectory',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteDirectory")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteDirectory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteDirectory');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteDirectory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteDirectory';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteDirectory"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteDirectory" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteDirectory",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteDirectory', [
'body' => '{
"DirectoryId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteDirectory');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteDirectory');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteDirectory' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteDirectory' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteDirectory"
payload = { "DirectoryId": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteDirectory"
payload <- "{\n \"DirectoryId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteDirectory")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteDirectory";
let payload = json!({"DirectoryId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteDirectory' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": ""
}'
echo '{
"DirectoryId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteDirectory' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteDirectory'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["DirectoryId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteDirectory")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DeleteLogSubscription
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteLogSubscription
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteLogSubscription");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteLogSubscription" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteLogSubscription"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteLogSubscription"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteLogSubscription");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteLogSubscription"
payload := strings.NewReader("{\n \"DirectoryId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 23
{
"DirectoryId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteLogSubscription")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteLogSubscription"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteLogSubscription")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteLogSubscription")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteLogSubscription');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteLogSubscription',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteLogSubscription';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteLogSubscription',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteLogSubscription")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteLogSubscription',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteLogSubscription');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteLogSubscription',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteLogSubscription';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteLogSubscription"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteLogSubscription" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteLogSubscription",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteLogSubscription', [
'body' => '{
"DirectoryId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteLogSubscription');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteLogSubscription');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteLogSubscription' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteLogSubscription' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteLogSubscription"
payload = { "DirectoryId": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteLogSubscription"
payload <- "{\n \"DirectoryId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteLogSubscription")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteLogSubscription";
let payload = json!({"DirectoryId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteLogSubscription' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": ""
}'
echo '{
"DirectoryId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteLogSubscription' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteLogSubscription'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["DirectoryId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteLogSubscription")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DeleteSnapshot
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteSnapshot
HEADERS
X-Amz-Target
BODY json
{
"SnapshotId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteSnapshot");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"SnapshotId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteSnapshot" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:SnapshotId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteSnapshot"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"SnapshotId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteSnapshot"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"SnapshotId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteSnapshot");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"SnapshotId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteSnapshot"
payload := strings.NewReader("{\n \"SnapshotId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 22
{
"SnapshotId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteSnapshot")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"SnapshotId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteSnapshot"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"SnapshotId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"SnapshotId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteSnapshot")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteSnapshot")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"SnapshotId\": \"\"\n}")
.asString();
const data = JSON.stringify({
SnapshotId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteSnapshot');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteSnapshot',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {SnapshotId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteSnapshot';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"SnapshotId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteSnapshot',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "SnapshotId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"SnapshotId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteSnapshot")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({SnapshotId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteSnapshot',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {SnapshotId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteSnapshot');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
SnapshotId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteSnapshot',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {SnapshotId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteSnapshot';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"SnapshotId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"SnapshotId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteSnapshot"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteSnapshot" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"SnapshotId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteSnapshot",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'SnapshotId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteSnapshot', [
'body' => '{
"SnapshotId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteSnapshot');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'SnapshotId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'SnapshotId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteSnapshot');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteSnapshot' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SnapshotId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteSnapshot' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SnapshotId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"SnapshotId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteSnapshot"
payload = { "SnapshotId": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteSnapshot"
payload <- "{\n \"SnapshotId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteSnapshot")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"SnapshotId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"SnapshotId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteSnapshot";
let payload = json!({"SnapshotId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteSnapshot' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"SnapshotId": ""
}'
echo '{
"SnapshotId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteSnapshot' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "SnapshotId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteSnapshot'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["SnapshotId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteSnapshot")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DeleteTrust
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteTrust
HEADERS
X-Amz-Target
BODY json
{
"TrustId": "",
"DeleteAssociatedConditionalForwarder": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteTrust");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"TrustId\": \"\",\n \"DeleteAssociatedConditionalForwarder\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteTrust" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:TrustId ""
:DeleteAssociatedConditionalForwarder ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteTrust"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"TrustId\": \"\",\n \"DeleteAssociatedConditionalForwarder\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteTrust"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"TrustId\": \"\",\n \"DeleteAssociatedConditionalForwarder\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteTrust");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"TrustId\": \"\",\n \"DeleteAssociatedConditionalForwarder\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteTrust"
payload := strings.NewReader("{\n \"TrustId\": \"\",\n \"DeleteAssociatedConditionalForwarder\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 65
{
"TrustId": "",
"DeleteAssociatedConditionalForwarder": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteTrust")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"TrustId\": \"\",\n \"DeleteAssociatedConditionalForwarder\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteTrust"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"TrustId\": \"\",\n \"DeleteAssociatedConditionalForwarder\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"TrustId\": \"\",\n \"DeleteAssociatedConditionalForwarder\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteTrust")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteTrust")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"TrustId\": \"\",\n \"DeleteAssociatedConditionalForwarder\": \"\"\n}")
.asString();
const data = JSON.stringify({
TrustId: '',
DeleteAssociatedConditionalForwarder: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteTrust');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteTrust',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {TrustId: '', DeleteAssociatedConditionalForwarder: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteTrust';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"TrustId":"","DeleteAssociatedConditionalForwarder":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteTrust',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "TrustId": "",\n "DeleteAssociatedConditionalForwarder": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"TrustId\": \"\",\n \"DeleteAssociatedConditionalForwarder\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteTrust")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({TrustId: '', DeleteAssociatedConditionalForwarder: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteTrust',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {TrustId: '', DeleteAssociatedConditionalForwarder: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteTrust');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
TrustId: '',
DeleteAssociatedConditionalForwarder: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteTrust',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {TrustId: '', DeleteAssociatedConditionalForwarder: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteTrust';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"TrustId":"","DeleteAssociatedConditionalForwarder":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"TrustId": @"",
@"DeleteAssociatedConditionalForwarder": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteTrust"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteTrust" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"TrustId\": \"\",\n \"DeleteAssociatedConditionalForwarder\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteTrust",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'TrustId' => '',
'DeleteAssociatedConditionalForwarder' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteTrust', [
'body' => '{
"TrustId": "",
"DeleteAssociatedConditionalForwarder": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteTrust');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'TrustId' => '',
'DeleteAssociatedConditionalForwarder' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'TrustId' => '',
'DeleteAssociatedConditionalForwarder' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteTrust');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteTrust' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"TrustId": "",
"DeleteAssociatedConditionalForwarder": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteTrust' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"TrustId": "",
"DeleteAssociatedConditionalForwarder": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"TrustId\": \"\",\n \"DeleteAssociatedConditionalForwarder\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteTrust"
payload = {
"TrustId": "",
"DeleteAssociatedConditionalForwarder": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteTrust"
payload <- "{\n \"TrustId\": \"\",\n \"DeleteAssociatedConditionalForwarder\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteTrust")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"TrustId\": \"\",\n \"DeleteAssociatedConditionalForwarder\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"TrustId\": \"\",\n \"DeleteAssociatedConditionalForwarder\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteTrust";
let payload = json!({
"TrustId": "",
"DeleteAssociatedConditionalForwarder": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteTrust' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"TrustId": "",
"DeleteAssociatedConditionalForwarder": ""
}'
echo '{
"TrustId": "",
"DeleteAssociatedConditionalForwarder": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteTrust' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "TrustId": "",\n "DeleteAssociatedConditionalForwarder": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteTrust'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"TrustId": "",
"DeleteAssociatedConditionalForwarder": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeleteTrust")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DeregisterCertificate
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterCertificate
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"CertificateId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterCertificate");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"CertificateId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterCertificate" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:CertificateId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterCertificate"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"CertificateId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterCertificate"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"CertificateId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterCertificate");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"CertificateId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterCertificate"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"CertificateId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 46
{
"DirectoryId": "",
"CertificateId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterCertificate")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"CertificateId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterCertificate"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"CertificateId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"CertificateId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterCertificate")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterCertificate")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"CertificateId\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
CertificateId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterCertificate');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterCertificate',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', CertificateId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterCertificate';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","CertificateId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterCertificate',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "CertificateId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"CertificateId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterCertificate")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', CertificateId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterCertificate',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', CertificateId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterCertificate');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
CertificateId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterCertificate',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', CertificateId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterCertificate';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","CertificateId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"CertificateId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterCertificate"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterCertificate" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"CertificateId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterCertificate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'CertificateId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterCertificate', [
'body' => '{
"DirectoryId": "",
"CertificateId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterCertificate');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'CertificateId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'CertificateId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterCertificate');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterCertificate' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"CertificateId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterCertificate' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"CertificateId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"CertificateId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterCertificate"
payload = {
"DirectoryId": "",
"CertificateId": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterCertificate"
payload <- "{\n \"DirectoryId\": \"\",\n \"CertificateId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterCertificate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"CertificateId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"CertificateId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterCertificate";
let payload = json!({
"DirectoryId": "",
"CertificateId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterCertificate' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"CertificateId": ""
}'
echo '{
"DirectoryId": "",
"CertificateId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterCertificate' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "CertificateId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterCertificate'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"CertificateId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterCertificate")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DeregisterEventTopic
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterEventTopic
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"TopicName": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterEventTopic");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"TopicName\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterEventTopic" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:TopicName ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterEventTopic"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"TopicName\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterEventTopic"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"TopicName\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterEventTopic");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"TopicName\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterEventTopic"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"TopicName\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 42
{
"DirectoryId": "",
"TopicName": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterEventTopic")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"TopicName\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterEventTopic"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"TopicName\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"TopicName\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterEventTopic")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterEventTopic")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"TopicName\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
TopicName: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterEventTopic');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterEventTopic',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', TopicName: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterEventTopic';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","TopicName":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterEventTopic',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "TopicName": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"TopicName\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterEventTopic")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', TopicName: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterEventTopic',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', TopicName: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterEventTopic');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
TopicName: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterEventTopic',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', TopicName: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterEventTopic';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","TopicName":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"TopicName": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterEventTopic"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterEventTopic" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"TopicName\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterEventTopic",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'TopicName' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterEventTopic', [
'body' => '{
"DirectoryId": "",
"TopicName": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterEventTopic');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'TopicName' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'TopicName' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterEventTopic');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterEventTopic' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"TopicName": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterEventTopic' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"TopicName": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"TopicName\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterEventTopic"
payload = {
"DirectoryId": "",
"TopicName": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterEventTopic"
payload <- "{\n \"DirectoryId\": \"\",\n \"TopicName\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterEventTopic")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"TopicName\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"TopicName\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterEventTopic";
let payload = json!({
"DirectoryId": "",
"TopicName": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterEventTopic' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"TopicName": ""
}'
echo '{
"DirectoryId": "",
"TopicName": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterEventTopic' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "TopicName": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterEventTopic'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"TopicName": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DeregisterEventTopic")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DescribeCertificate
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeCertificate
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"CertificateId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeCertificate");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"CertificateId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeCertificate" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:CertificateId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeCertificate"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"CertificateId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeCertificate"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"CertificateId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeCertificate");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"CertificateId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeCertificate"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"CertificateId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 46
{
"DirectoryId": "",
"CertificateId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeCertificate")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"CertificateId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeCertificate"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"CertificateId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"CertificateId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeCertificate")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeCertificate")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"CertificateId\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
CertificateId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeCertificate');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeCertificate',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', CertificateId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeCertificate';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","CertificateId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeCertificate',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "CertificateId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"CertificateId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeCertificate")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', CertificateId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeCertificate',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', CertificateId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeCertificate');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
CertificateId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeCertificate',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', CertificateId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeCertificate';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","CertificateId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"CertificateId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeCertificate"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeCertificate" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"CertificateId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeCertificate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'CertificateId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeCertificate', [
'body' => '{
"DirectoryId": "",
"CertificateId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeCertificate');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'CertificateId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'CertificateId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeCertificate');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeCertificate' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"CertificateId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeCertificate' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"CertificateId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"CertificateId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeCertificate"
payload = {
"DirectoryId": "",
"CertificateId": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeCertificate"
payload <- "{\n \"DirectoryId\": \"\",\n \"CertificateId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeCertificate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"CertificateId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"CertificateId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeCertificate";
let payload = json!({
"DirectoryId": "",
"CertificateId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeCertificate' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"CertificateId": ""
}'
echo '{
"DirectoryId": "",
"CertificateId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeCertificate' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "CertificateId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeCertificate'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"CertificateId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeCertificate")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DescribeClientAuthenticationSettings
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeClientAuthenticationSettings
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"Type": "",
"NextToken": "",
"Limit": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeClientAuthenticationSettings");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"Type\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeClientAuthenticationSettings" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:Type ""
:NextToken ""
:Limit ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeClientAuthenticationSettings"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"Type\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeClientAuthenticationSettings"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"Type\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeClientAuthenticationSettings");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"Type\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeClientAuthenticationSettings"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"Type\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 71
{
"DirectoryId": "",
"Type": "",
"NextToken": "",
"Limit": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeClientAuthenticationSettings")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"Type\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeClientAuthenticationSettings"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"Type\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"Type\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeClientAuthenticationSettings")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeClientAuthenticationSettings")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"Type\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
Type: '',
NextToken: '',
Limit: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeClientAuthenticationSettings');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeClientAuthenticationSettings',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', Type: '', NextToken: '', Limit: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeClientAuthenticationSettings';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","Type":"","NextToken":"","Limit":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeClientAuthenticationSettings',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "Type": "",\n "NextToken": "",\n "Limit": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"Type\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeClientAuthenticationSettings")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', Type: '', NextToken: '', Limit: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeClientAuthenticationSettings',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', Type: '', NextToken: '', Limit: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeClientAuthenticationSettings');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
Type: '',
NextToken: '',
Limit: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeClientAuthenticationSettings',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', Type: '', NextToken: '', Limit: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeClientAuthenticationSettings';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","Type":"","NextToken":"","Limit":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"Type": @"",
@"NextToken": @"",
@"Limit": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeClientAuthenticationSettings"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeClientAuthenticationSettings" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"Type\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeClientAuthenticationSettings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'Type' => '',
'NextToken' => '',
'Limit' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeClientAuthenticationSettings', [
'body' => '{
"DirectoryId": "",
"Type": "",
"NextToken": "",
"Limit": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeClientAuthenticationSettings');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'Type' => '',
'NextToken' => '',
'Limit' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'Type' => '',
'NextToken' => '',
'Limit' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeClientAuthenticationSettings');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeClientAuthenticationSettings' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"Type": "",
"NextToken": "",
"Limit": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeClientAuthenticationSettings' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"Type": "",
"NextToken": "",
"Limit": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"Type\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeClientAuthenticationSettings"
payload = {
"DirectoryId": "",
"Type": "",
"NextToken": "",
"Limit": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeClientAuthenticationSettings"
payload <- "{\n \"DirectoryId\": \"\",\n \"Type\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeClientAuthenticationSettings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"Type\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"Type\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeClientAuthenticationSettings";
let payload = json!({
"DirectoryId": "",
"Type": "",
"NextToken": "",
"Limit": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeClientAuthenticationSettings' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"Type": "",
"NextToken": "",
"Limit": ""
}'
echo '{
"DirectoryId": "",
"Type": "",
"NextToken": "",
"Limit": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeClientAuthenticationSettings' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "Type": "",\n "NextToken": "",\n "Limit": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeClientAuthenticationSettings'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"Type": "",
"NextToken": "",
"Limit": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeClientAuthenticationSettings")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DescribeConditionalForwarders
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeConditionalForwarders
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"RemoteDomainNames": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeConditionalForwarders");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"RemoteDomainNames\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeConditionalForwarders" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:RemoteDomainNames ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeConditionalForwarders"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"RemoteDomainNames\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeConditionalForwarders"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"RemoteDomainNames\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeConditionalForwarders");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"RemoteDomainNames\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeConditionalForwarders"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"RemoteDomainNames\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 50
{
"DirectoryId": "",
"RemoteDomainNames": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeConditionalForwarders")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"RemoteDomainNames\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeConditionalForwarders"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"RemoteDomainNames\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"RemoteDomainNames\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeConditionalForwarders")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeConditionalForwarders")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"RemoteDomainNames\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
RemoteDomainNames: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeConditionalForwarders');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeConditionalForwarders',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', RemoteDomainNames: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeConditionalForwarders';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","RemoteDomainNames":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeConditionalForwarders',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "RemoteDomainNames": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"RemoteDomainNames\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeConditionalForwarders")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', RemoteDomainNames: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeConditionalForwarders',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', RemoteDomainNames: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeConditionalForwarders');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
RemoteDomainNames: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeConditionalForwarders',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', RemoteDomainNames: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeConditionalForwarders';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","RemoteDomainNames":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"RemoteDomainNames": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeConditionalForwarders"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeConditionalForwarders" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"RemoteDomainNames\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeConditionalForwarders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'RemoteDomainNames' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeConditionalForwarders', [
'body' => '{
"DirectoryId": "",
"RemoteDomainNames": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeConditionalForwarders');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'RemoteDomainNames' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'RemoteDomainNames' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeConditionalForwarders');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeConditionalForwarders' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"RemoteDomainNames": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeConditionalForwarders' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"RemoteDomainNames": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"RemoteDomainNames\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeConditionalForwarders"
payload = {
"DirectoryId": "",
"RemoteDomainNames": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeConditionalForwarders"
payload <- "{\n \"DirectoryId\": \"\",\n \"RemoteDomainNames\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeConditionalForwarders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"RemoteDomainNames\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"RemoteDomainNames\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeConditionalForwarders";
let payload = json!({
"DirectoryId": "",
"RemoteDomainNames": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeConditionalForwarders' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"RemoteDomainNames": ""
}'
echo '{
"DirectoryId": "",
"RemoteDomainNames": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeConditionalForwarders' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "RemoteDomainNames": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeConditionalForwarders'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"RemoteDomainNames": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeConditionalForwarders")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DescribeDirectories
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDirectories
HEADERS
X-Amz-Target
BODY json
{
"DirectoryIds": "",
"NextToken": "",
"Limit": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDirectories");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDirectories" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryIds ""
:NextToken ""
:Limit ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDirectories"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDirectories"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDirectories");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDirectories"
payload := strings.NewReader("{\n \"DirectoryIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 58
{
"DirectoryIds": "",
"NextToken": "",
"Limit": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDirectories")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDirectories"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDirectories")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDirectories")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryIds: '',
NextToken: '',
Limit: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDirectories');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDirectories',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryIds: '', NextToken: '', Limit: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDirectories';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryIds":"","NextToken":"","Limit":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDirectories',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryIds": "",\n "NextToken": "",\n "Limit": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDirectories")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryIds: '', NextToken: '', Limit: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDirectories',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryIds: '', NextToken: '', Limit: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDirectories');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryIds: '',
NextToken: '',
Limit: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDirectories',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryIds: '', NextToken: '', Limit: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDirectories';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryIds":"","NextToken":"","Limit":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryIds": @"",
@"NextToken": @"",
@"Limit": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDirectories"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDirectories" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDirectories",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryIds' => '',
'NextToken' => '',
'Limit' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDirectories', [
'body' => '{
"DirectoryIds": "",
"NextToken": "",
"Limit": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDirectories');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryIds' => '',
'NextToken' => '',
'Limit' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryIds' => '',
'NextToken' => '',
'Limit' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDirectories');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDirectories' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryIds": "",
"NextToken": "",
"Limit": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDirectories' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryIds": "",
"NextToken": "",
"Limit": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDirectories"
payload = {
"DirectoryIds": "",
"NextToken": "",
"Limit": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDirectories"
payload <- "{\n \"DirectoryIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDirectories")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDirectories";
let payload = json!({
"DirectoryIds": "",
"NextToken": "",
"Limit": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDirectories' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryIds": "",
"NextToken": "",
"Limit": ""
}'
echo '{
"DirectoryIds": "",
"NextToken": "",
"Limit": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDirectories' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryIds": "",\n "NextToken": "",\n "Limit": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDirectories'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryIds": "",
"NextToken": "",
"Limit": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDirectories")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DescribeDomainControllers
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDomainControllers
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"DomainControllerIds": "",
"NextToken": "",
"Limit": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDomainControllers");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"DomainControllerIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDomainControllers" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:DomainControllerIds ""
:NextToken ""
:Limit ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDomainControllers"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"DomainControllerIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDomainControllers"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"DomainControllerIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDomainControllers");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"DomainControllerIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDomainControllers"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"DomainControllerIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 86
{
"DirectoryId": "",
"DomainControllerIds": "",
"NextToken": "",
"Limit": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDomainControllers")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"DomainControllerIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDomainControllers"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"DomainControllerIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"DomainControllerIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDomainControllers")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDomainControllers")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"DomainControllerIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
DomainControllerIds: '',
NextToken: '',
Limit: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDomainControllers');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDomainControllers',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', DomainControllerIds: '', NextToken: '', Limit: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDomainControllers';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","DomainControllerIds":"","NextToken":"","Limit":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDomainControllers',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "DomainControllerIds": "",\n "NextToken": "",\n "Limit": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"DomainControllerIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDomainControllers")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', DomainControllerIds: '', NextToken: '', Limit: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDomainControllers',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', DomainControllerIds: '', NextToken: '', Limit: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDomainControllers');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
DomainControllerIds: '',
NextToken: '',
Limit: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDomainControllers',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', DomainControllerIds: '', NextToken: '', Limit: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDomainControllers';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","DomainControllerIds":"","NextToken":"","Limit":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"DomainControllerIds": @"",
@"NextToken": @"",
@"Limit": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDomainControllers"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDomainControllers" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"DomainControllerIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDomainControllers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'DomainControllerIds' => '',
'NextToken' => '',
'Limit' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDomainControllers', [
'body' => '{
"DirectoryId": "",
"DomainControllerIds": "",
"NextToken": "",
"Limit": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDomainControllers');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'DomainControllerIds' => '',
'NextToken' => '',
'Limit' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'DomainControllerIds' => '',
'NextToken' => '',
'Limit' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDomainControllers');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDomainControllers' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"DomainControllerIds": "",
"NextToken": "",
"Limit": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDomainControllers' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"DomainControllerIds": "",
"NextToken": "",
"Limit": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"DomainControllerIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDomainControllers"
payload = {
"DirectoryId": "",
"DomainControllerIds": "",
"NextToken": "",
"Limit": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDomainControllers"
payload <- "{\n \"DirectoryId\": \"\",\n \"DomainControllerIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDomainControllers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"DomainControllerIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"DomainControllerIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDomainControllers";
let payload = json!({
"DirectoryId": "",
"DomainControllerIds": "",
"NextToken": "",
"Limit": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDomainControllers' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"DomainControllerIds": "",
"NextToken": "",
"Limit": ""
}'
echo '{
"DirectoryId": "",
"DomainControllerIds": "",
"NextToken": "",
"Limit": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDomainControllers' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "DomainControllerIds": "",\n "NextToken": "",\n "Limit": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDomainControllers'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"DomainControllerIds": "",
"NextToken": "",
"Limit": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeDomainControllers")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DescribeEventTopics
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeEventTopics
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"TopicNames": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeEventTopics");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"TopicNames\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeEventTopics" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:TopicNames ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeEventTopics"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"TopicNames\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeEventTopics"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"TopicNames\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeEventTopics");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"TopicNames\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeEventTopics"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"TopicNames\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 43
{
"DirectoryId": "",
"TopicNames": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeEventTopics")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"TopicNames\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeEventTopics"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"TopicNames\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"TopicNames\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeEventTopics")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeEventTopics")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"TopicNames\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
TopicNames: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeEventTopics');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeEventTopics',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', TopicNames: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeEventTopics';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","TopicNames":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeEventTopics',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "TopicNames": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"TopicNames\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeEventTopics")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', TopicNames: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeEventTopics',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', TopicNames: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeEventTopics');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
TopicNames: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeEventTopics',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', TopicNames: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeEventTopics';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","TopicNames":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"TopicNames": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeEventTopics"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeEventTopics" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"TopicNames\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeEventTopics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'TopicNames' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeEventTopics', [
'body' => '{
"DirectoryId": "",
"TopicNames": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeEventTopics');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'TopicNames' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'TopicNames' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeEventTopics');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeEventTopics' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"TopicNames": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeEventTopics' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"TopicNames": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"TopicNames\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeEventTopics"
payload = {
"DirectoryId": "",
"TopicNames": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeEventTopics"
payload <- "{\n \"DirectoryId\": \"\",\n \"TopicNames\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeEventTopics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"TopicNames\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"TopicNames\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeEventTopics";
let payload = json!({
"DirectoryId": "",
"TopicNames": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeEventTopics' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"TopicNames": ""
}'
echo '{
"DirectoryId": "",
"TopicNames": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeEventTopics' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "TopicNames": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeEventTopics'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"TopicNames": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeEventTopics")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DescribeLDAPSSettings
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeLDAPSSettings
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"Type": "",
"NextToken": "",
"Limit": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeLDAPSSettings");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"Type\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeLDAPSSettings" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:Type ""
:NextToken ""
:Limit ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeLDAPSSettings"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"Type\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeLDAPSSettings"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"Type\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeLDAPSSettings");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"Type\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeLDAPSSettings"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"Type\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 71
{
"DirectoryId": "",
"Type": "",
"NextToken": "",
"Limit": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeLDAPSSettings")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"Type\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeLDAPSSettings"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"Type\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"Type\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeLDAPSSettings")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeLDAPSSettings")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"Type\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
Type: '',
NextToken: '',
Limit: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeLDAPSSettings');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeLDAPSSettings',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', Type: '', NextToken: '', Limit: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeLDAPSSettings';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","Type":"","NextToken":"","Limit":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeLDAPSSettings',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "Type": "",\n "NextToken": "",\n "Limit": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"Type\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeLDAPSSettings")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', Type: '', NextToken: '', Limit: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeLDAPSSettings',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', Type: '', NextToken: '', Limit: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeLDAPSSettings');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
Type: '',
NextToken: '',
Limit: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeLDAPSSettings',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', Type: '', NextToken: '', Limit: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeLDAPSSettings';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","Type":"","NextToken":"","Limit":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"Type": @"",
@"NextToken": @"",
@"Limit": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeLDAPSSettings"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeLDAPSSettings" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"Type\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeLDAPSSettings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'Type' => '',
'NextToken' => '',
'Limit' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeLDAPSSettings', [
'body' => '{
"DirectoryId": "",
"Type": "",
"NextToken": "",
"Limit": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeLDAPSSettings');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'Type' => '',
'NextToken' => '',
'Limit' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'Type' => '',
'NextToken' => '',
'Limit' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeLDAPSSettings');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeLDAPSSettings' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"Type": "",
"NextToken": "",
"Limit": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeLDAPSSettings' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"Type": "",
"NextToken": "",
"Limit": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"Type\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeLDAPSSettings"
payload = {
"DirectoryId": "",
"Type": "",
"NextToken": "",
"Limit": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeLDAPSSettings"
payload <- "{\n \"DirectoryId\": \"\",\n \"Type\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeLDAPSSettings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"Type\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"Type\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeLDAPSSettings";
let payload = json!({
"DirectoryId": "",
"Type": "",
"NextToken": "",
"Limit": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeLDAPSSettings' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"Type": "",
"NextToken": "",
"Limit": ""
}'
echo '{
"DirectoryId": "",
"Type": "",
"NextToken": "",
"Limit": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeLDAPSSettings' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "Type": "",\n "NextToken": "",\n "Limit": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeLDAPSSettings'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"Type": "",
"NextToken": "",
"Limit": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeLDAPSSettings")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DescribeRegions
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeRegions
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"RegionName": "",
"NextToken": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeRegions");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"RegionName\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeRegions" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:RegionName ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeRegions"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"RegionName\": \"\",\n \"NextToken\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeRegions"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"RegionName\": \"\",\n \"NextToken\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeRegions");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"RegionName\": \"\",\n \"NextToken\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeRegions"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"RegionName\": \"\",\n \"NextToken\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 62
{
"DirectoryId": "",
"RegionName": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeRegions")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"RegionName\": \"\",\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeRegions"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"RegionName\": \"\",\n \"NextToken\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"RegionName\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeRegions")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeRegions")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"RegionName\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
RegionName: '',
NextToken: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeRegions');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeRegions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', RegionName: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeRegions';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","RegionName":"","NextToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeRegions',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "RegionName": "",\n "NextToken": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"RegionName\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeRegions")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', RegionName: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeRegions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', RegionName: '', NextToken: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeRegions');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
RegionName: '',
NextToken: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeRegions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', RegionName: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeRegions';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","RegionName":"","NextToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"RegionName": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeRegions"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeRegions" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"RegionName\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeRegions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'RegionName' => '',
'NextToken' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeRegions', [
'body' => '{
"DirectoryId": "",
"RegionName": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeRegions');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'RegionName' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'RegionName' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeRegions');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeRegions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"RegionName": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeRegions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"RegionName": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"RegionName\": \"\",\n \"NextToken\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeRegions"
payload = {
"DirectoryId": "",
"RegionName": "",
"NextToken": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeRegions"
payload <- "{\n \"DirectoryId\": \"\",\n \"RegionName\": \"\",\n \"NextToken\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeRegions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"RegionName\": \"\",\n \"NextToken\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"RegionName\": \"\",\n \"NextToken\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeRegions";
let payload = json!({
"DirectoryId": "",
"RegionName": "",
"NextToken": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeRegions' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"RegionName": "",
"NextToken": ""
}'
echo '{
"DirectoryId": "",
"RegionName": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeRegions' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "RegionName": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeRegions'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"RegionName": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeRegions")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DescribeSettings
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSettings
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"Status": "",
"NextToken": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSettings");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"Status\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSettings" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:Status ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSettings"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"Status\": \"\",\n \"NextToken\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSettings"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"Status\": \"\",\n \"NextToken\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSettings");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"Status\": \"\",\n \"NextToken\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSettings"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"Status\": \"\",\n \"NextToken\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 58
{
"DirectoryId": "",
"Status": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSettings")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"Status\": \"\",\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSettings"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"Status\": \"\",\n \"NextToken\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"Status\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSettings")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSettings")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"Status\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
Status: '',
NextToken: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSettings');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSettings',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', Status: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSettings';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","Status":"","NextToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSettings',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "Status": "",\n "NextToken": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"Status\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSettings")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', Status: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSettings',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', Status: '', NextToken: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSettings');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
Status: '',
NextToken: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSettings',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', Status: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSettings';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","Status":"","NextToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"Status": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSettings"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSettings" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"Status\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSettings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'Status' => '',
'NextToken' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSettings', [
'body' => '{
"DirectoryId": "",
"Status": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSettings');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'Status' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'Status' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSettings');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSettings' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"Status": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSettings' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"Status": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"Status\": \"\",\n \"NextToken\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSettings"
payload = {
"DirectoryId": "",
"Status": "",
"NextToken": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSettings"
payload <- "{\n \"DirectoryId\": \"\",\n \"Status\": \"\",\n \"NextToken\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSettings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"Status\": \"\",\n \"NextToken\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"Status\": \"\",\n \"NextToken\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSettings";
let payload = json!({
"DirectoryId": "",
"Status": "",
"NextToken": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSettings' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"Status": "",
"NextToken": ""
}'
echo '{
"DirectoryId": "",
"Status": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSettings' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "Status": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSettings'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"Status": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSettings")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSharedDirectories");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"OwnerDirectoryId\": \"\",\n \"SharedDirectoryIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSharedDirectories" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OwnerDirectoryId ""
:SharedDirectoryIds ""
:NextToken ""
:Limit ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSharedDirectories"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OwnerDirectoryId\": \"\",\n \"SharedDirectoryIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSharedDirectories"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OwnerDirectoryId\": \"\",\n \"SharedDirectoryIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSharedDirectories");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OwnerDirectoryId\": \"\",\n \"SharedDirectoryIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSharedDirectories"
payload := strings.NewReader("{\n \"OwnerDirectoryId\": \"\",\n \"SharedDirectoryIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 90
{
"OwnerDirectoryId": "",
"SharedDirectoryIds": "",
"NextToken": "",
"Limit": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSharedDirectories")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OwnerDirectoryId\": \"\",\n \"SharedDirectoryIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSharedDirectories"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OwnerDirectoryId\": \"\",\n \"SharedDirectoryIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"OwnerDirectoryId\": \"\",\n \"SharedDirectoryIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSharedDirectories")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSharedDirectories")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OwnerDirectoryId\": \"\",\n \"SharedDirectoryIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
.asString();
const data = JSON.stringify({
OwnerDirectoryId: '',
SharedDirectoryIds: '',
NextToken: '',
Limit: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSharedDirectories');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSharedDirectories',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OwnerDirectoryId: '', SharedDirectoryIds: '', NextToken: '', Limit: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSharedDirectories';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OwnerDirectoryId":"","SharedDirectoryIds":"","NextToken":"","Limit":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSharedDirectories',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OwnerDirectoryId": "",\n "SharedDirectoryIds": "",\n "NextToken": "",\n "Limit": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OwnerDirectoryId\": \"\",\n \"SharedDirectoryIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSharedDirectories")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({OwnerDirectoryId: '', SharedDirectoryIds: '', NextToken: '', Limit: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSharedDirectories',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OwnerDirectoryId: '', SharedDirectoryIds: '', NextToken: '', Limit: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSharedDirectories');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OwnerDirectoryId: '',
SharedDirectoryIds: '',
NextToken: '',
Limit: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSharedDirectories',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OwnerDirectoryId: '', SharedDirectoryIds: '', NextToken: '', Limit: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSharedDirectories';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OwnerDirectoryId":"","SharedDirectoryIds":"","NextToken":"","Limit":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"OwnerDirectoryId": @"",
@"SharedDirectoryIds": @"",
@"NextToken": @"",
@"Limit": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSharedDirectories"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSharedDirectories" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OwnerDirectoryId\": \"\",\n \"SharedDirectoryIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSharedDirectories",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'OwnerDirectoryId' => '',
'SharedDirectoryIds' => '',
'NextToken' => '',
'Limit' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSharedDirectories', [
'body' => '{
"OwnerDirectoryId": "",
"SharedDirectoryIds": "",
"NextToken": "",
"Limit": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSharedDirectories');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OwnerDirectoryId' => '',
'SharedDirectoryIds' => '',
'NextToken' => '',
'Limit' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OwnerDirectoryId' => '',
'SharedDirectoryIds' => '',
'NextToken' => '',
'Limit' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSharedDirectories');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSharedDirectories' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OwnerDirectoryId": "",
"SharedDirectoryIds": "",
"NextToken": "",
"Limit": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSharedDirectories' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OwnerDirectoryId": "",
"SharedDirectoryIds": "",
"NextToken": "",
"Limit": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OwnerDirectoryId\": \"\",\n \"SharedDirectoryIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSharedDirectories"
payload = {
"OwnerDirectoryId": "",
"SharedDirectoryIds": "",
"NextToken": "",
"Limit": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSharedDirectories"
payload <- "{\n \"OwnerDirectoryId\": \"\",\n \"SharedDirectoryIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSharedDirectories")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"OwnerDirectoryId\": \"\",\n \"SharedDirectoryIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"OwnerDirectoryId\": \"\",\n \"SharedDirectoryIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSharedDirectories";
let payload = json!({
"OwnerDirectoryId": "",
"SharedDirectoryIds": "",
"NextToken": "",
"Limit": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSharedDirectories' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OwnerDirectoryId": "",
"SharedDirectoryIds": "",
"NextToken": "",
"Limit": ""
}'
echo '{
"OwnerDirectoryId": "",
"SharedDirectoryIds": "",
"NextToken": "",
"Limit": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSharedDirectories' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OwnerDirectoryId": "",\n "SharedDirectoryIds": "",\n "NextToken": "",\n "Limit": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSharedDirectories'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OwnerDirectoryId": "",
"SharedDirectoryIds": "",
"NextToken": "",
"Limit": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSharedDirectories")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DescribeSnapshots
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSnapshots
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"SnapshotIds": "",
"NextToken": "",
"Limit": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSnapshots");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"SnapshotIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSnapshots" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:SnapshotIds ""
:NextToken ""
:Limit ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSnapshots"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"SnapshotIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSnapshots"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"SnapshotIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSnapshots");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"SnapshotIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSnapshots"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"SnapshotIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 78
{
"DirectoryId": "",
"SnapshotIds": "",
"NextToken": "",
"Limit": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSnapshots")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"SnapshotIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSnapshots"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"SnapshotIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"SnapshotIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSnapshots")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSnapshots")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"SnapshotIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
SnapshotIds: '',
NextToken: '',
Limit: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSnapshots');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSnapshots',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', SnapshotIds: '', NextToken: '', Limit: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSnapshots';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","SnapshotIds":"","NextToken":"","Limit":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSnapshots',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "SnapshotIds": "",\n "NextToken": "",\n "Limit": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"SnapshotIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSnapshots")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', SnapshotIds: '', NextToken: '', Limit: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSnapshots',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', SnapshotIds: '', NextToken: '', Limit: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSnapshots');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
SnapshotIds: '',
NextToken: '',
Limit: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSnapshots',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', SnapshotIds: '', NextToken: '', Limit: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSnapshots';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","SnapshotIds":"","NextToken":"","Limit":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"SnapshotIds": @"",
@"NextToken": @"",
@"Limit": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSnapshots"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSnapshots" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"SnapshotIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSnapshots",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'SnapshotIds' => '',
'NextToken' => '',
'Limit' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSnapshots', [
'body' => '{
"DirectoryId": "",
"SnapshotIds": "",
"NextToken": "",
"Limit": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSnapshots');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'SnapshotIds' => '',
'NextToken' => '',
'Limit' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'SnapshotIds' => '',
'NextToken' => '',
'Limit' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSnapshots');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSnapshots' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"SnapshotIds": "",
"NextToken": "",
"Limit": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSnapshots' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"SnapshotIds": "",
"NextToken": "",
"Limit": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"SnapshotIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSnapshots"
payload = {
"DirectoryId": "",
"SnapshotIds": "",
"NextToken": "",
"Limit": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSnapshots"
payload <- "{\n \"DirectoryId\": \"\",\n \"SnapshotIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSnapshots")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"SnapshotIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"SnapshotIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSnapshots";
let payload = json!({
"DirectoryId": "",
"SnapshotIds": "",
"NextToken": "",
"Limit": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSnapshots' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"SnapshotIds": "",
"NextToken": "",
"Limit": ""
}'
echo '{
"DirectoryId": "",
"SnapshotIds": "",
"NextToken": "",
"Limit": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSnapshots' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "SnapshotIds": "",\n "NextToken": "",\n "Limit": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSnapshots'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"SnapshotIds": "",
"NextToken": "",
"Limit": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeSnapshots")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DescribeTrusts
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeTrusts
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"TrustIds": "",
"NextToken": "",
"Limit": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeTrusts");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"TrustIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeTrusts" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:TrustIds ""
:NextToken ""
:Limit ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeTrusts"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"TrustIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeTrusts"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"TrustIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeTrusts");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"TrustIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeTrusts"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"TrustIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 75
{
"DirectoryId": "",
"TrustIds": "",
"NextToken": "",
"Limit": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeTrusts")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"TrustIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeTrusts"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"TrustIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"TrustIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeTrusts")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeTrusts")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"TrustIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
TrustIds: '',
NextToken: '',
Limit: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeTrusts');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeTrusts',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', TrustIds: '', NextToken: '', Limit: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeTrusts';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","TrustIds":"","NextToken":"","Limit":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeTrusts',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "TrustIds": "",\n "NextToken": "",\n "Limit": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"TrustIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeTrusts")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', TrustIds: '', NextToken: '', Limit: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeTrusts',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', TrustIds: '', NextToken: '', Limit: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeTrusts');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
TrustIds: '',
NextToken: '',
Limit: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeTrusts',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', TrustIds: '', NextToken: '', Limit: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeTrusts';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","TrustIds":"","NextToken":"","Limit":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"TrustIds": @"",
@"NextToken": @"",
@"Limit": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeTrusts"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeTrusts" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"TrustIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeTrusts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'TrustIds' => '',
'NextToken' => '',
'Limit' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeTrusts', [
'body' => '{
"DirectoryId": "",
"TrustIds": "",
"NextToken": "",
"Limit": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeTrusts');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'TrustIds' => '',
'NextToken' => '',
'Limit' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'TrustIds' => '',
'NextToken' => '',
'Limit' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeTrusts');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeTrusts' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"TrustIds": "",
"NextToken": "",
"Limit": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeTrusts' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"TrustIds": "",
"NextToken": "",
"Limit": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"TrustIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeTrusts"
payload = {
"DirectoryId": "",
"TrustIds": "",
"NextToken": "",
"Limit": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeTrusts"
payload <- "{\n \"DirectoryId\": \"\",\n \"TrustIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeTrusts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"TrustIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"TrustIds\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeTrusts";
let payload = json!({
"DirectoryId": "",
"TrustIds": "",
"NextToken": "",
"Limit": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeTrusts' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"TrustIds": "",
"NextToken": "",
"Limit": ""
}'
echo '{
"DirectoryId": "",
"TrustIds": "",
"NextToken": "",
"Limit": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeTrusts' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "TrustIds": "",\n "NextToken": "",\n "Limit": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeTrusts'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"TrustIds": "",
"NextToken": "",
"Limit": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeTrusts")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DescribeUpdateDirectory
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeUpdateDirectory
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"UpdateType": "",
"RegionName": "",
"NextToken": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeUpdateDirectory");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"UpdateType\": \"\",\n \"RegionName\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeUpdateDirectory" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:UpdateType ""
:RegionName ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeUpdateDirectory"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"UpdateType\": \"\",\n \"RegionName\": \"\",\n \"NextToken\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeUpdateDirectory"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"UpdateType\": \"\",\n \"RegionName\": \"\",\n \"NextToken\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeUpdateDirectory");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"UpdateType\": \"\",\n \"RegionName\": \"\",\n \"NextToken\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeUpdateDirectory"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"UpdateType\": \"\",\n \"RegionName\": \"\",\n \"NextToken\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 82
{
"DirectoryId": "",
"UpdateType": "",
"RegionName": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeUpdateDirectory")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"UpdateType\": \"\",\n \"RegionName\": \"\",\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeUpdateDirectory"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"UpdateType\": \"\",\n \"RegionName\": \"\",\n \"NextToken\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"UpdateType\": \"\",\n \"RegionName\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeUpdateDirectory")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeUpdateDirectory")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"UpdateType\": \"\",\n \"RegionName\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
UpdateType: '',
RegionName: '',
NextToken: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeUpdateDirectory');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeUpdateDirectory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', UpdateType: '', RegionName: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeUpdateDirectory';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","UpdateType":"","RegionName":"","NextToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeUpdateDirectory',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "UpdateType": "",\n "RegionName": "",\n "NextToken": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"UpdateType\": \"\",\n \"RegionName\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeUpdateDirectory")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', UpdateType: '', RegionName: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeUpdateDirectory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', UpdateType: '', RegionName: '', NextToken: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeUpdateDirectory');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
UpdateType: '',
RegionName: '',
NextToken: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeUpdateDirectory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', UpdateType: '', RegionName: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeUpdateDirectory';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","UpdateType":"","RegionName":"","NextToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"UpdateType": @"",
@"RegionName": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeUpdateDirectory"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeUpdateDirectory" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"UpdateType\": \"\",\n \"RegionName\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeUpdateDirectory",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'UpdateType' => '',
'RegionName' => '',
'NextToken' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeUpdateDirectory', [
'body' => '{
"DirectoryId": "",
"UpdateType": "",
"RegionName": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeUpdateDirectory');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'UpdateType' => '',
'RegionName' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'UpdateType' => '',
'RegionName' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeUpdateDirectory');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeUpdateDirectory' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"UpdateType": "",
"RegionName": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeUpdateDirectory' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"UpdateType": "",
"RegionName": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"UpdateType\": \"\",\n \"RegionName\": \"\",\n \"NextToken\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeUpdateDirectory"
payload = {
"DirectoryId": "",
"UpdateType": "",
"RegionName": "",
"NextToken": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeUpdateDirectory"
payload <- "{\n \"DirectoryId\": \"\",\n \"UpdateType\": \"\",\n \"RegionName\": \"\",\n \"NextToken\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeUpdateDirectory")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"UpdateType\": \"\",\n \"RegionName\": \"\",\n \"NextToken\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"UpdateType\": \"\",\n \"RegionName\": \"\",\n \"NextToken\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeUpdateDirectory";
let payload = json!({
"DirectoryId": "",
"UpdateType": "",
"RegionName": "",
"NextToken": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeUpdateDirectory' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"UpdateType": "",
"RegionName": "",
"NextToken": ""
}'
echo '{
"DirectoryId": "",
"UpdateType": "",
"RegionName": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeUpdateDirectory' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "UpdateType": "",\n "RegionName": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeUpdateDirectory'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"UpdateType": "",
"RegionName": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DescribeUpdateDirectory")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DisableClientAuthentication
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableClientAuthentication
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"Type": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableClientAuthentication");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableClientAuthentication" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:Type ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableClientAuthentication"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableClientAuthentication"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableClientAuthentication");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableClientAuthentication"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 37
{
"DirectoryId": "",
"Type": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableClientAuthentication")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableClientAuthentication"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableClientAuthentication")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableClientAuthentication")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
Type: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableClientAuthentication');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableClientAuthentication',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', Type: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableClientAuthentication';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","Type":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableClientAuthentication',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "Type": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableClientAuthentication")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', Type: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableClientAuthentication',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', Type: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableClientAuthentication');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
Type: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableClientAuthentication',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', Type: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableClientAuthentication';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","Type":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"Type": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableClientAuthentication"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableClientAuthentication" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableClientAuthentication",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'Type' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableClientAuthentication', [
'body' => '{
"DirectoryId": "",
"Type": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableClientAuthentication');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'Type' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'Type' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableClientAuthentication');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableClientAuthentication' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"Type": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableClientAuthentication' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"Type": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableClientAuthentication"
payload = {
"DirectoryId": "",
"Type": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableClientAuthentication"
payload <- "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableClientAuthentication")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableClientAuthentication";
let payload = json!({
"DirectoryId": "",
"Type": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableClientAuthentication' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"Type": ""
}'
echo '{
"DirectoryId": "",
"Type": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableClientAuthentication' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "Type": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableClientAuthentication'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"Type": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableClientAuthentication")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DisableLDAPS
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableLDAPS
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"Type": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableLDAPS");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableLDAPS" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:Type ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableLDAPS"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableLDAPS"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableLDAPS");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableLDAPS"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 37
{
"DirectoryId": "",
"Type": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableLDAPS")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableLDAPS"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableLDAPS")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableLDAPS")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
Type: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableLDAPS');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableLDAPS',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', Type: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableLDAPS';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","Type":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableLDAPS',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "Type": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableLDAPS")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', Type: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableLDAPS',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', Type: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableLDAPS');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
Type: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableLDAPS',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', Type: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableLDAPS';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","Type":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"Type": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableLDAPS"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableLDAPS" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableLDAPS",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'Type' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableLDAPS', [
'body' => '{
"DirectoryId": "",
"Type": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableLDAPS');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'Type' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'Type' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableLDAPS');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableLDAPS' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"Type": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableLDAPS' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"Type": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableLDAPS"
payload = {
"DirectoryId": "",
"Type": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableLDAPS"
payload <- "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableLDAPS")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableLDAPS";
let payload = json!({
"DirectoryId": "",
"Type": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableLDAPS' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"Type": ""
}'
echo '{
"DirectoryId": "",
"Type": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableLDAPS' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "Type": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableLDAPS'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"Type": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableLDAPS")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DisableRadius
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableRadius
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableRadius");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableRadius" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableRadius"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableRadius"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableRadius");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableRadius"
payload := strings.NewReader("{\n \"DirectoryId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 23
{
"DirectoryId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableRadius")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableRadius"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableRadius")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableRadius")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableRadius');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableRadius',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableRadius';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableRadius',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableRadius")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableRadius',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableRadius');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableRadius',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableRadius';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableRadius"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableRadius" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableRadius",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableRadius', [
'body' => '{
"DirectoryId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableRadius');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableRadius');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableRadius' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableRadius' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableRadius"
payload = { "DirectoryId": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableRadius"
payload <- "{\n \"DirectoryId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableRadius")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableRadius";
let payload = json!({"DirectoryId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableRadius' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": ""
}'
echo '{
"DirectoryId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableRadius' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableRadius'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["DirectoryId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableRadius")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DisableSso
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableSso
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"UserName": "",
"Password": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableSso");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"Password\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableSso" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:UserName ""
:Password ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableSso"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"Password\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableSso"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"Password\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableSso");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"Password\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableSso"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"Password\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 59
{
"DirectoryId": "",
"UserName": "",
"Password": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableSso")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"Password\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableSso"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"Password\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"Password\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableSso")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableSso")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"Password\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
UserName: '',
Password: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableSso');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableSso',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', UserName: '', Password: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableSso';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","UserName":"","Password":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableSso',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "UserName": "",\n "Password": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"Password\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableSso")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', UserName: '', Password: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableSso',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', UserName: '', Password: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableSso');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
UserName: '',
Password: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableSso',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', UserName: '', Password: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableSso';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","UserName":"","Password":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"UserName": @"",
@"Password": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableSso"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableSso" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"Password\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableSso",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'UserName' => '',
'Password' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableSso', [
'body' => '{
"DirectoryId": "",
"UserName": "",
"Password": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableSso');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'UserName' => '',
'Password' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'UserName' => '',
'Password' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableSso');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableSso' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"UserName": "",
"Password": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableSso' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"UserName": "",
"Password": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"Password\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableSso"
payload = {
"DirectoryId": "",
"UserName": "",
"Password": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableSso"
payload <- "{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"Password\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableSso")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"Password\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"Password\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableSso";
let payload = json!({
"DirectoryId": "",
"UserName": "",
"Password": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableSso' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"UserName": "",
"Password": ""
}'
echo '{
"DirectoryId": "",
"UserName": "",
"Password": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableSso' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "UserName": "",\n "Password": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableSso'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"UserName": "",
"Password": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.DisableSso")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
EnableClientAuthentication
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableClientAuthentication
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"Type": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableClientAuthentication");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableClientAuthentication" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:Type ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableClientAuthentication"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableClientAuthentication"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableClientAuthentication");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableClientAuthentication"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 37
{
"DirectoryId": "",
"Type": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableClientAuthentication")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableClientAuthentication"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableClientAuthentication")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableClientAuthentication")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
Type: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableClientAuthentication');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableClientAuthentication',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', Type: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableClientAuthentication';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","Type":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableClientAuthentication',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "Type": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableClientAuthentication")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', Type: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableClientAuthentication',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', Type: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableClientAuthentication');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
Type: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableClientAuthentication',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', Type: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableClientAuthentication';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","Type":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"Type": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableClientAuthentication"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableClientAuthentication" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableClientAuthentication",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'Type' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableClientAuthentication', [
'body' => '{
"DirectoryId": "",
"Type": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableClientAuthentication');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'Type' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'Type' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableClientAuthentication');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableClientAuthentication' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"Type": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableClientAuthentication' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"Type": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableClientAuthentication"
payload = {
"DirectoryId": "",
"Type": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableClientAuthentication"
payload <- "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableClientAuthentication")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableClientAuthentication";
let payload = json!({
"DirectoryId": "",
"Type": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableClientAuthentication' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"Type": ""
}'
echo '{
"DirectoryId": "",
"Type": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableClientAuthentication' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "Type": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableClientAuthentication'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"Type": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableClientAuthentication")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
EnableLDAPS
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableLDAPS
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"Type": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableLDAPS");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableLDAPS" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:Type ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableLDAPS"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableLDAPS"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableLDAPS");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableLDAPS"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 37
{
"DirectoryId": "",
"Type": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableLDAPS")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableLDAPS"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableLDAPS")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableLDAPS")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
Type: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableLDAPS');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableLDAPS',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', Type: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableLDAPS';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","Type":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableLDAPS',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "Type": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableLDAPS")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', Type: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableLDAPS',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', Type: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableLDAPS');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
Type: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableLDAPS',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', Type: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableLDAPS';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","Type":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"Type": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableLDAPS"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableLDAPS" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableLDAPS",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'Type' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableLDAPS', [
'body' => '{
"DirectoryId": "",
"Type": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableLDAPS');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'Type' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'Type' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableLDAPS');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableLDAPS' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"Type": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableLDAPS' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"Type": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableLDAPS"
payload = {
"DirectoryId": "",
"Type": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableLDAPS"
payload <- "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableLDAPS")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"Type\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableLDAPS";
let payload = json!({
"DirectoryId": "",
"Type": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableLDAPS' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"Type": ""
}'
echo '{
"DirectoryId": "",
"Type": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableLDAPS' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "Type": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableLDAPS'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"Type": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableLDAPS")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
EnableRadius
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableRadius
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"RadiusSettings": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableRadius");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"RadiusSettings\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableRadius" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:RadiusSettings ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableRadius"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"RadiusSettings\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableRadius"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"RadiusSettings\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableRadius");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"RadiusSettings\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableRadius"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"RadiusSettings\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 47
{
"DirectoryId": "",
"RadiusSettings": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableRadius")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"RadiusSettings\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableRadius"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"RadiusSettings\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"RadiusSettings\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableRadius")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableRadius")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"RadiusSettings\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
RadiusSettings: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableRadius');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableRadius',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', RadiusSettings: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableRadius';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","RadiusSettings":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableRadius',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "RadiusSettings": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"RadiusSettings\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableRadius")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', RadiusSettings: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableRadius',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', RadiusSettings: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableRadius');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
RadiusSettings: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableRadius',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', RadiusSettings: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableRadius';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","RadiusSettings":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"RadiusSettings": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableRadius"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableRadius" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"RadiusSettings\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableRadius",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'RadiusSettings' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableRadius', [
'body' => '{
"DirectoryId": "",
"RadiusSettings": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableRadius');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'RadiusSettings' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'RadiusSettings' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableRadius');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableRadius' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"RadiusSettings": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableRadius' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"RadiusSettings": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"RadiusSettings\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableRadius"
payload = {
"DirectoryId": "",
"RadiusSettings": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableRadius"
payload <- "{\n \"DirectoryId\": \"\",\n \"RadiusSettings\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableRadius")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"RadiusSettings\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"RadiusSettings\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableRadius";
let payload = json!({
"DirectoryId": "",
"RadiusSettings": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableRadius' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"RadiusSettings": ""
}'
echo '{
"DirectoryId": "",
"RadiusSettings": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableRadius' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "RadiusSettings": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableRadius'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"RadiusSettings": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableRadius")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
EnableSso
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableSso
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"UserName": "",
"Password": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableSso");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"Password\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableSso" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:UserName ""
:Password ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableSso"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"Password\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableSso"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"Password\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableSso");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"Password\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableSso"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"Password\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 59
{
"DirectoryId": "",
"UserName": "",
"Password": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableSso")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"Password\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableSso"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"Password\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"Password\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableSso")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableSso")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"Password\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
UserName: '',
Password: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableSso');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableSso',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', UserName: '', Password: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableSso';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","UserName":"","Password":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableSso',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "UserName": "",\n "Password": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"Password\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableSso")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', UserName: '', Password: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableSso',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', UserName: '', Password: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableSso');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
UserName: '',
Password: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableSso',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', UserName: '', Password: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableSso';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","UserName":"","Password":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"UserName": @"",
@"Password": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableSso"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableSso" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"Password\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableSso",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'UserName' => '',
'Password' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableSso', [
'body' => '{
"DirectoryId": "",
"UserName": "",
"Password": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableSso');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'UserName' => '',
'Password' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'UserName' => '',
'Password' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableSso');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableSso' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"UserName": "",
"Password": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableSso' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"UserName": "",
"Password": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"Password\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableSso"
payload = {
"DirectoryId": "",
"UserName": "",
"Password": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableSso"
payload <- "{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"Password\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableSso")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"Password\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"Password\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableSso";
let payload = json!({
"DirectoryId": "",
"UserName": "",
"Password": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableSso' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"UserName": "",
"Password": ""
}'
echo '{
"DirectoryId": "",
"UserName": "",
"Password": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableSso' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "UserName": "",\n "Password": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableSso'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"UserName": "",
"Password": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.EnableSso")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
GetDirectoryLimits
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetDirectoryLimits
HEADERS
X-Amz-Target
BODY json
{}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetDirectoryLimits");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetDirectoryLimits" {:headers {:x-amz-target ""}
:content-type :json})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetDirectoryLimits"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetDirectoryLimits"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetDirectoryLimits");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetDirectoryLimits"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 2
{}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetDirectoryLimits")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetDirectoryLimits"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetDirectoryLimits")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetDirectoryLimits")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{}")
.asString();
const data = JSON.stringify({});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetDirectoryLimits');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetDirectoryLimits',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetDirectoryLimits';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetDirectoryLimits',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetDirectoryLimits")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetDirectoryLimits',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetDirectoryLimits');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetDirectoryLimits',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetDirectoryLimits';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetDirectoryLimits"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetDirectoryLimits" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetDirectoryLimits",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetDirectoryLimits', [
'body' => '{}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetDirectoryLimits');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetDirectoryLimits');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetDirectoryLimits' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetDirectoryLimits' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetDirectoryLimits"
payload = {}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetDirectoryLimits"
payload <- "{}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetDirectoryLimits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetDirectoryLimits";
let payload = json!({});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetDirectoryLimits' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{}'
echo '{}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetDirectoryLimits' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetDirectoryLimits'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetDirectoryLimits")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
GetSnapshotLimits
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetSnapshotLimits
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetSnapshotLimits");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetSnapshotLimits" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetSnapshotLimits"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetSnapshotLimits"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetSnapshotLimits");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetSnapshotLimits"
payload := strings.NewReader("{\n \"DirectoryId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 23
{
"DirectoryId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetSnapshotLimits")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetSnapshotLimits"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetSnapshotLimits")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetSnapshotLimits")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetSnapshotLimits');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetSnapshotLimits',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetSnapshotLimits';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetSnapshotLimits',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetSnapshotLimits")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetSnapshotLimits',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetSnapshotLimits');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetSnapshotLimits',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetSnapshotLimits';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetSnapshotLimits"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetSnapshotLimits" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetSnapshotLimits",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetSnapshotLimits', [
'body' => '{
"DirectoryId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetSnapshotLimits');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetSnapshotLimits');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetSnapshotLimits' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetSnapshotLimits' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetSnapshotLimits"
payload = { "DirectoryId": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetSnapshotLimits"
payload <- "{\n \"DirectoryId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetSnapshotLimits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetSnapshotLimits";
let payload = json!({"DirectoryId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetSnapshotLimits' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": ""
}'
echo '{
"DirectoryId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetSnapshotLimits' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetSnapshotLimits'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["DirectoryId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.GetSnapshotLimits")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
ListCertificates
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListCertificates
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"NextToken": "",
"Limit": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListCertificates");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListCertificates" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:NextToken ""
:Limit ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListCertificates"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListCertificates"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListCertificates");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListCertificates"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 57
{
"DirectoryId": "",
"NextToken": "",
"Limit": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListCertificates")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListCertificates"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListCertificates")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListCertificates")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
NextToken: '',
Limit: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListCertificates');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListCertificates',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', NextToken: '', Limit: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListCertificates';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","NextToken":"","Limit":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListCertificates',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "NextToken": "",\n "Limit": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListCertificates")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', NextToken: '', Limit: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListCertificates',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', NextToken: '', Limit: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListCertificates');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
NextToken: '',
Limit: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListCertificates',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', NextToken: '', Limit: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListCertificates';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","NextToken":"","Limit":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"NextToken": @"",
@"Limit": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListCertificates"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListCertificates" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListCertificates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'NextToken' => '',
'Limit' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListCertificates', [
'body' => '{
"DirectoryId": "",
"NextToken": "",
"Limit": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListCertificates');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'NextToken' => '',
'Limit' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'NextToken' => '',
'Limit' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListCertificates');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListCertificates' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"NextToken": "",
"Limit": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListCertificates' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"NextToken": "",
"Limit": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListCertificates"
payload = {
"DirectoryId": "",
"NextToken": "",
"Limit": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListCertificates"
payload <- "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListCertificates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListCertificates";
let payload = json!({
"DirectoryId": "",
"NextToken": "",
"Limit": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListCertificates' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"NextToken": "",
"Limit": ""
}'
echo '{
"DirectoryId": "",
"NextToken": "",
"Limit": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListCertificates' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "NextToken": "",\n "Limit": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListCertificates'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"NextToken": "",
"Limit": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListCertificates")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
ListIpRoutes
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListIpRoutes
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"NextToken": "",
"Limit": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListIpRoutes");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListIpRoutes" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:NextToken ""
:Limit ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListIpRoutes"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListIpRoutes"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListIpRoutes");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListIpRoutes"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 57
{
"DirectoryId": "",
"NextToken": "",
"Limit": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListIpRoutes")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListIpRoutes"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListIpRoutes")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListIpRoutes")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
NextToken: '',
Limit: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListIpRoutes');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListIpRoutes',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', NextToken: '', Limit: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListIpRoutes';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","NextToken":"","Limit":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListIpRoutes',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "NextToken": "",\n "Limit": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListIpRoutes")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', NextToken: '', Limit: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListIpRoutes',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', NextToken: '', Limit: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListIpRoutes');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
NextToken: '',
Limit: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListIpRoutes',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', NextToken: '', Limit: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListIpRoutes';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","NextToken":"","Limit":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"NextToken": @"",
@"Limit": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListIpRoutes"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListIpRoutes" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListIpRoutes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'NextToken' => '',
'Limit' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListIpRoutes', [
'body' => '{
"DirectoryId": "",
"NextToken": "",
"Limit": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListIpRoutes');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'NextToken' => '',
'Limit' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'NextToken' => '',
'Limit' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListIpRoutes');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListIpRoutes' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"NextToken": "",
"Limit": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListIpRoutes' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"NextToken": "",
"Limit": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListIpRoutes"
payload = {
"DirectoryId": "",
"NextToken": "",
"Limit": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListIpRoutes"
payload <- "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListIpRoutes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListIpRoutes";
let payload = json!({
"DirectoryId": "",
"NextToken": "",
"Limit": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListIpRoutes' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"NextToken": "",
"Limit": ""
}'
echo '{
"DirectoryId": "",
"NextToken": "",
"Limit": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListIpRoutes' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "NextToken": "",\n "Limit": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListIpRoutes'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"NextToken": "",
"Limit": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListIpRoutes")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
ListLogSubscriptions
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListLogSubscriptions
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"NextToken": "",
"Limit": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListLogSubscriptions");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListLogSubscriptions" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:NextToken ""
:Limit ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListLogSubscriptions"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListLogSubscriptions"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListLogSubscriptions");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListLogSubscriptions"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 57
{
"DirectoryId": "",
"NextToken": "",
"Limit": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListLogSubscriptions")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListLogSubscriptions"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListLogSubscriptions")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListLogSubscriptions")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
NextToken: '',
Limit: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListLogSubscriptions');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListLogSubscriptions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', NextToken: '', Limit: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListLogSubscriptions';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","NextToken":"","Limit":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListLogSubscriptions',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "NextToken": "",\n "Limit": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListLogSubscriptions")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', NextToken: '', Limit: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListLogSubscriptions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', NextToken: '', Limit: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListLogSubscriptions');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
NextToken: '',
Limit: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListLogSubscriptions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', NextToken: '', Limit: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListLogSubscriptions';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","NextToken":"","Limit":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"NextToken": @"",
@"Limit": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListLogSubscriptions"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListLogSubscriptions" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListLogSubscriptions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'NextToken' => '',
'Limit' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListLogSubscriptions', [
'body' => '{
"DirectoryId": "",
"NextToken": "",
"Limit": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListLogSubscriptions');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'NextToken' => '',
'Limit' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'NextToken' => '',
'Limit' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListLogSubscriptions');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListLogSubscriptions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"NextToken": "",
"Limit": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListLogSubscriptions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"NextToken": "",
"Limit": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListLogSubscriptions"
payload = {
"DirectoryId": "",
"NextToken": "",
"Limit": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListLogSubscriptions"
payload <- "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListLogSubscriptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListLogSubscriptions";
let payload = json!({
"DirectoryId": "",
"NextToken": "",
"Limit": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListLogSubscriptions' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"NextToken": "",
"Limit": ""
}'
echo '{
"DirectoryId": "",
"NextToken": "",
"Limit": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListLogSubscriptions' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "NextToken": "",\n "Limit": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListLogSubscriptions'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"NextToken": "",
"Limit": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListLogSubscriptions")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
ListSchemaExtensions
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListSchemaExtensions
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"NextToken": "",
"Limit": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListSchemaExtensions");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListSchemaExtensions" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:NextToken ""
:Limit ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListSchemaExtensions"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListSchemaExtensions"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListSchemaExtensions");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListSchemaExtensions"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 57
{
"DirectoryId": "",
"NextToken": "",
"Limit": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListSchemaExtensions")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListSchemaExtensions"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListSchemaExtensions")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListSchemaExtensions")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
NextToken: '',
Limit: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListSchemaExtensions');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListSchemaExtensions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', NextToken: '', Limit: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListSchemaExtensions';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","NextToken":"","Limit":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListSchemaExtensions',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "NextToken": "",\n "Limit": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListSchemaExtensions")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', NextToken: '', Limit: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListSchemaExtensions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', NextToken: '', Limit: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListSchemaExtensions');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
NextToken: '',
Limit: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListSchemaExtensions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', NextToken: '', Limit: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListSchemaExtensions';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","NextToken":"","Limit":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"NextToken": @"",
@"Limit": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListSchemaExtensions"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListSchemaExtensions" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListSchemaExtensions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'NextToken' => '',
'Limit' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListSchemaExtensions', [
'body' => '{
"DirectoryId": "",
"NextToken": "",
"Limit": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListSchemaExtensions');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'NextToken' => '',
'Limit' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'NextToken' => '',
'Limit' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListSchemaExtensions');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListSchemaExtensions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"NextToken": "",
"Limit": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListSchemaExtensions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"NextToken": "",
"Limit": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListSchemaExtensions"
payload = {
"DirectoryId": "",
"NextToken": "",
"Limit": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListSchemaExtensions"
payload <- "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListSchemaExtensions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListSchemaExtensions";
let payload = json!({
"DirectoryId": "",
"NextToken": "",
"Limit": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListSchemaExtensions' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"NextToken": "",
"Limit": ""
}'
echo '{
"DirectoryId": "",
"NextToken": "",
"Limit": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListSchemaExtensions' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "NextToken": "",\n "Limit": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListSchemaExtensions'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"NextToken": "",
"Limit": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListSchemaExtensions")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
ListTagsForResource
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListTagsForResource
HEADERS
X-Amz-Target
BODY json
{
"ResourceId": "",
"NextToken": "",
"Limit": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListTagsForResource");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"ResourceId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListTagsForResource" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ResourceId ""
:NextToken ""
:Limit ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListTagsForResource"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ResourceId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListTagsForResource"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ResourceId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListTagsForResource");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ResourceId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListTagsForResource"
payload := strings.NewReader("{\n \"ResourceId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 56
{
"ResourceId": "",
"NextToken": "",
"Limit": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListTagsForResource")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ResourceId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListTagsForResource"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ResourceId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"ResourceId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListTagsForResource")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListTagsForResource")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ResourceId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
.asString();
const data = JSON.stringify({
ResourceId: '',
NextToken: '',
Limit: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListTagsForResource');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListTagsForResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ResourceId: '', NextToken: '', Limit: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListTagsForResource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ResourceId":"","NextToken":"","Limit":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListTagsForResource',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ResourceId": "",\n "NextToken": "",\n "Limit": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ResourceId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListTagsForResource")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({ResourceId: '', NextToken: '', Limit: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListTagsForResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {ResourceId: '', NextToken: '', Limit: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListTagsForResource');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ResourceId: '',
NextToken: '',
Limit: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListTagsForResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ResourceId: '', NextToken: '', Limit: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListTagsForResource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ResourceId":"","NextToken":"","Limit":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"ResourceId": @"",
@"NextToken": @"",
@"Limit": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListTagsForResource"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListTagsForResource" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"ResourceId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListTagsForResource",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ResourceId' => '',
'NextToken' => '',
'Limit' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListTagsForResource', [
'body' => '{
"ResourceId": "",
"NextToken": "",
"Limit": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListTagsForResource');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ResourceId' => '',
'NextToken' => '',
'Limit' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ResourceId' => '',
'NextToken' => '',
'Limit' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListTagsForResource');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListTagsForResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ResourceId": "",
"NextToken": "",
"Limit": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListTagsForResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ResourceId": "",
"NextToken": "",
"Limit": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ResourceId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListTagsForResource"
payload = {
"ResourceId": "",
"NextToken": "",
"Limit": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListTagsForResource"
payload <- "{\n \"ResourceId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListTagsForResource")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"ResourceId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"ResourceId\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListTagsForResource";
let payload = json!({
"ResourceId": "",
"NextToken": "",
"Limit": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListTagsForResource' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ResourceId": "",
"NextToken": "",
"Limit": ""
}'
echo '{
"ResourceId": "",
"NextToken": "",
"Limit": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListTagsForResource' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ResourceId": "",\n "NextToken": "",\n "Limit": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListTagsForResource'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"ResourceId": "",
"NextToken": "",
"Limit": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ListTagsForResource")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
RegisterCertificate
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterCertificate
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"CertificateData": "",
"Type": "",
"ClientCertAuthSettings": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterCertificate");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"CertificateData\": \"\",\n \"Type\": \"\",\n \"ClientCertAuthSettings\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterCertificate" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:CertificateData ""
:Type ""
:ClientCertAuthSettings ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterCertificate"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"CertificateData\": \"\",\n \"Type\": \"\",\n \"ClientCertAuthSettings\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterCertificate"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"CertificateData\": \"\",\n \"Type\": \"\",\n \"ClientCertAuthSettings\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterCertificate");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"CertificateData\": \"\",\n \"Type\": \"\",\n \"ClientCertAuthSettings\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterCertificate"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"CertificateData\": \"\",\n \"Type\": \"\",\n \"ClientCertAuthSettings\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 94
{
"DirectoryId": "",
"CertificateData": "",
"Type": "",
"ClientCertAuthSettings": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterCertificate")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"CertificateData\": \"\",\n \"Type\": \"\",\n \"ClientCertAuthSettings\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterCertificate"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"CertificateData\": \"\",\n \"Type\": \"\",\n \"ClientCertAuthSettings\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"CertificateData\": \"\",\n \"Type\": \"\",\n \"ClientCertAuthSettings\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterCertificate")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterCertificate")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"CertificateData\": \"\",\n \"Type\": \"\",\n \"ClientCertAuthSettings\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
CertificateData: '',
Type: '',
ClientCertAuthSettings: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterCertificate');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterCertificate',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', CertificateData: '', Type: '', ClientCertAuthSettings: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterCertificate';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","CertificateData":"","Type":"","ClientCertAuthSettings":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterCertificate',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "CertificateData": "",\n "Type": "",\n "ClientCertAuthSettings": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"CertificateData\": \"\",\n \"Type\": \"\",\n \"ClientCertAuthSettings\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterCertificate")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', CertificateData: '', Type: '', ClientCertAuthSettings: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterCertificate',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', CertificateData: '', Type: '', ClientCertAuthSettings: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterCertificate');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
CertificateData: '',
Type: '',
ClientCertAuthSettings: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterCertificate',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', CertificateData: '', Type: '', ClientCertAuthSettings: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterCertificate';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","CertificateData":"","Type":"","ClientCertAuthSettings":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"CertificateData": @"",
@"Type": @"",
@"ClientCertAuthSettings": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterCertificate"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterCertificate" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"CertificateData\": \"\",\n \"Type\": \"\",\n \"ClientCertAuthSettings\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterCertificate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'CertificateData' => '',
'Type' => '',
'ClientCertAuthSettings' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterCertificate', [
'body' => '{
"DirectoryId": "",
"CertificateData": "",
"Type": "",
"ClientCertAuthSettings": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterCertificate');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'CertificateData' => '',
'Type' => '',
'ClientCertAuthSettings' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'CertificateData' => '',
'Type' => '',
'ClientCertAuthSettings' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterCertificate');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterCertificate' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"CertificateData": "",
"Type": "",
"ClientCertAuthSettings": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterCertificate' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"CertificateData": "",
"Type": "",
"ClientCertAuthSettings": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"CertificateData\": \"\",\n \"Type\": \"\",\n \"ClientCertAuthSettings\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterCertificate"
payload = {
"DirectoryId": "",
"CertificateData": "",
"Type": "",
"ClientCertAuthSettings": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterCertificate"
payload <- "{\n \"DirectoryId\": \"\",\n \"CertificateData\": \"\",\n \"Type\": \"\",\n \"ClientCertAuthSettings\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterCertificate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"CertificateData\": \"\",\n \"Type\": \"\",\n \"ClientCertAuthSettings\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"CertificateData\": \"\",\n \"Type\": \"\",\n \"ClientCertAuthSettings\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterCertificate";
let payload = json!({
"DirectoryId": "",
"CertificateData": "",
"Type": "",
"ClientCertAuthSettings": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterCertificate' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"CertificateData": "",
"Type": "",
"ClientCertAuthSettings": ""
}'
echo '{
"DirectoryId": "",
"CertificateData": "",
"Type": "",
"ClientCertAuthSettings": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterCertificate' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "CertificateData": "",\n "Type": "",\n "ClientCertAuthSettings": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterCertificate'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"CertificateData": "",
"Type": "",
"ClientCertAuthSettings": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterCertificate")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
RegisterEventTopic
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterEventTopic
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"TopicName": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterEventTopic");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"TopicName\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterEventTopic" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:TopicName ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterEventTopic"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"TopicName\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterEventTopic"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"TopicName\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterEventTopic");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"TopicName\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterEventTopic"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"TopicName\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 42
{
"DirectoryId": "",
"TopicName": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterEventTopic")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"TopicName\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterEventTopic"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"TopicName\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"TopicName\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterEventTopic")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterEventTopic")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"TopicName\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
TopicName: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterEventTopic');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterEventTopic',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', TopicName: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterEventTopic';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","TopicName":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterEventTopic',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "TopicName": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"TopicName\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterEventTopic")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', TopicName: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterEventTopic',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', TopicName: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterEventTopic');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
TopicName: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterEventTopic',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', TopicName: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterEventTopic';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","TopicName":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"TopicName": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterEventTopic"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterEventTopic" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"TopicName\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterEventTopic",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'TopicName' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterEventTopic', [
'body' => '{
"DirectoryId": "",
"TopicName": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterEventTopic');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'TopicName' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'TopicName' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterEventTopic');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterEventTopic' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"TopicName": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterEventTopic' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"TopicName": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"TopicName\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterEventTopic"
payload = {
"DirectoryId": "",
"TopicName": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterEventTopic"
payload <- "{\n \"DirectoryId\": \"\",\n \"TopicName\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterEventTopic")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"TopicName\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"TopicName\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterEventTopic";
let payload = json!({
"DirectoryId": "",
"TopicName": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterEventTopic' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"TopicName": ""
}'
echo '{
"DirectoryId": "",
"TopicName": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterEventTopic' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "TopicName": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterEventTopic'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"TopicName": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RegisterEventTopic")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RejectSharedDirectory");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"SharedDirectoryId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RejectSharedDirectory" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:SharedDirectoryId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RejectSharedDirectory"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"SharedDirectoryId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RejectSharedDirectory"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"SharedDirectoryId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RejectSharedDirectory");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"SharedDirectoryId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RejectSharedDirectory"
payload := strings.NewReader("{\n \"SharedDirectoryId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 29
{
"SharedDirectoryId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RejectSharedDirectory")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"SharedDirectoryId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RejectSharedDirectory"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"SharedDirectoryId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"SharedDirectoryId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RejectSharedDirectory")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RejectSharedDirectory")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"SharedDirectoryId\": \"\"\n}")
.asString();
const data = JSON.stringify({
SharedDirectoryId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RejectSharedDirectory');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RejectSharedDirectory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {SharedDirectoryId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RejectSharedDirectory';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"SharedDirectoryId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RejectSharedDirectory',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "SharedDirectoryId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"SharedDirectoryId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RejectSharedDirectory")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({SharedDirectoryId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RejectSharedDirectory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {SharedDirectoryId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RejectSharedDirectory');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
SharedDirectoryId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RejectSharedDirectory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {SharedDirectoryId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RejectSharedDirectory';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"SharedDirectoryId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"SharedDirectoryId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RejectSharedDirectory"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RejectSharedDirectory" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"SharedDirectoryId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RejectSharedDirectory",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'SharedDirectoryId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RejectSharedDirectory', [
'body' => '{
"SharedDirectoryId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RejectSharedDirectory');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'SharedDirectoryId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'SharedDirectoryId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RejectSharedDirectory');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RejectSharedDirectory' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SharedDirectoryId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RejectSharedDirectory' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SharedDirectoryId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"SharedDirectoryId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RejectSharedDirectory"
payload = { "SharedDirectoryId": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RejectSharedDirectory"
payload <- "{\n \"SharedDirectoryId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RejectSharedDirectory")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"SharedDirectoryId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"SharedDirectoryId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RejectSharedDirectory";
let payload = json!({"SharedDirectoryId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RejectSharedDirectory' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"SharedDirectoryId": ""
}'
echo '{
"SharedDirectoryId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RejectSharedDirectory' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "SharedDirectoryId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RejectSharedDirectory'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["SharedDirectoryId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RejectSharedDirectory")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
RemoveIpRoutes
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveIpRoutes
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"CidrIps": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveIpRoutes");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"CidrIps\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveIpRoutes" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:CidrIps ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveIpRoutes"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"CidrIps\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveIpRoutes"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"CidrIps\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveIpRoutes");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"CidrIps\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveIpRoutes"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"CidrIps\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 40
{
"DirectoryId": "",
"CidrIps": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveIpRoutes")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"CidrIps\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveIpRoutes"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"CidrIps\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"CidrIps\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveIpRoutes")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveIpRoutes")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"CidrIps\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
CidrIps: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveIpRoutes');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveIpRoutes',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', CidrIps: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveIpRoutes';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","CidrIps":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveIpRoutes',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "CidrIps": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"CidrIps\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveIpRoutes")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', CidrIps: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveIpRoutes',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', CidrIps: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveIpRoutes');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
CidrIps: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveIpRoutes',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', CidrIps: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveIpRoutes';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","CidrIps":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"CidrIps": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveIpRoutes"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveIpRoutes" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"CidrIps\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveIpRoutes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'CidrIps' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveIpRoutes', [
'body' => '{
"DirectoryId": "",
"CidrIps": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveIpRoutes');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'CidrIps' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'CidrIps' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveIpRoutes');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveIpRoutes' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"CidrIps": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveIpRoutes' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"CidrIps": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"CidrIps\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveIpRoutes"
payload = {
"DirectoryId": "",
"CidrIps": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveIpRoutes"
payload <- "{\n \"DirectoryId\": \"\",\n \"CidrIps\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveIpRoutes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"CidrIps\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"CidrIps\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveIpRoutes";
let payload = json!({
"DirectoryId": "",
"CidrIps": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveIpRoutes' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"CidrIps": ""
}'
echo '{
"DirectoryId": "",
"CidrIps": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveIpRoutes' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "CidrIps": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveIpRoutes'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"CidrIps": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveIpRoutes")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
RemoveRegion
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveRegion
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveRegion");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveRegion" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveRegion"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveRegion"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveRegion");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveRegion"
payload := strings.NewReader("{\n \"DirectoryId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 23
{
"DirectoryId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveRegion")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveRegion"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveRegion")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveRegion")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveRegion');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveRegion',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveRegion';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveRegion',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveRegion")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveRegion',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveRegion');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveRegion',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveRegion';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveRegion"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveRegion" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveRegion",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveRegion', [
'body' => '{
"DirectoryId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveRegion');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveRegion');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveRegion' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveRegion' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveRegion"
payload = { "DirectoryId": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveRegion"
payload <- "{\n \"DirectoryId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveRegion")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveRegion";
let payload = json!({"DirectoryId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveRegion' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": ""
}'
echo '{
"DirectoryId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveRegion' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveRegion'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["DirectoryId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveRegion")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
RemoveTagsFromResource
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveTagsFromResource
HEADERS
X-Amz-Target
BODY json
{
"ResourceId": "",
"TagKeys": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveTagsFromResource");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"ResourceId\": \"\",\n \"TagKeys\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveTagsFromResource" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ResourceId ""
:TagKeys ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveTagsFromResource"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ResourceId\": \"\",\n \"TagKeys\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveTagsFromResource"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ResourceId\": \"\",\n \"TagKeys\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveTagsFromResource");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ResourceId\": \"\",\n \"TagKeys\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveTagsFromResource"
payload := strings.NewReader("{\n \"ResourceId\": \"\",\n \"TagKeys\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 39
{
"ResourceId": "",
"TagKeys": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveTagsFromResource")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ResourceId\": \"\",\n \"TagKeys\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveTagsFromResource"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ResourceId\": \"\",\n \"TagKeys\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"ResourceId\": \"\",\n \"TagKeys\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveTagsFromResource")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveTagsFromResource")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ResourceId\": \"\",\n \"TagKeys\": \"\"\n}")
.asString();
const data = JSON.stringify({
ResourceId: '',
TagKeys: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveTagsFromResource');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveTagsFromResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ResourceId: '', TagKeys: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveTagsFromResource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ResourceId":"","TagKeys":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveTagsFromResource',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ResourceId": "",\n "TagKeys": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ResourceId\": \"\",\n \"TagKeys\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveTagsFromResource")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({ResourceId: '', TagKeys: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveTagsFromResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {ResourceId: '', TagKeys: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveTagsFromResource');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ResourceId: '',
TagKeys: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveTagsFromResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ResourceId: '', TagKeys: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveTagsFromResource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ResourceId":"","TagKeys":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"ResourceId": @"",
@"TagKeys": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveTagsFromResource"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveTagsFromResource" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"ResourceId\": \"\",\n \"TagKeys\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveTagsFromResource",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ResourceId' => '',
'TagKeys' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveTagsFromResource', [
'body' => '{
"ResourceId": "",
"TagKeys": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveTagsFromResource');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ResourceId' => '',
'TagKeys' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ResourceId' => '',
'TagKeys' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveTagsFromResource');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveTagsFromResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ResourceId": "",
"TagKeys": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveTagsFromResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ResourceId": "",
"TagKeys": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ResourceId\": \"\",\n \"TagKeys\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveTagsFromResource"
payload = {
"ResourceId": "",
"TagKeys": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveTagsFromResource"
payload <- "{\n \"ResourceId\": \"\",\n \"TagKeys\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveTagsFromResource")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"ResourceId\": \"\",\n \"TagKeys\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"ResourceId\": \"\",\n \"TagKeys\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveTagsFromResource";
let payload = json!({
"ResourceId": "",
"TagKeys": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveTagsFromResource' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ResourceId": "",
"TagKeys": ""
}'
echo '{
"ResourceId": "",
"TagKeys": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveTagsFromResource' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ResourceId": "",\n "TagKeys": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveTagsFromResource'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"ResourceId": "",
"TagKeys": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RemoveTagsFromResource")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
ResetUserPassword
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ResetUserPassword
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"UserName": "",
"NewPassword": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ResetUserPassword");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"NewPassword\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ResetUserPassword" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:UserName ""
:NewPassword ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ResetUserPassword"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"NewPassword\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ResetUserPassword"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"NewPassword\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ResetUserPassword");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"NewPassword\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ResetUserPassword"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"NewPassword\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 62
{
"DirectoryId": "",
"UserName": "",
"NewPassword": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ResetUserPassword")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"NewPassword\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ResetUserPassword"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"NewPassword\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"NewPassword\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ResetUserPassword")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ResetUserPassword")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"NewPassword\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
UserName: '',
NewPassword: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ResetUserPassword');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ResetUserPassword',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', UserName: '', NewPassword: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ResetUserPassword';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","UserName":"","NewPassword":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ResetUserPassword',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "UserName": "",\n "NewPassword": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"NewPassword\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ResetUserPassword")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', UserName: '', NewPassword: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ResetUserPassword',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', UserName: '', NewPassword: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ResetUserPassword');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
UserName: '',
NewPassword: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ResetUserPassword',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', UserName: '', NewPassword: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ResetUserPassword';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","UserName":"","NewPassword":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"UserName": @"",
@"NewPassword": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ResetUserPassword"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ResetUserPassword" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"NewPassword\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ResetUserPassword",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'UserName' => '',
'NewPassword' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ResetUserPassword', [
'body' => '{
"DirectoryId": "",
"UserName": "",
"NewPassword": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ResetUserPassword');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'UserName' => '',
'NewPassword' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'UserName' => '',
'NewPassword' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ResetUserPassword');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ResetUserPassword' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"UserName": "",
"NewPassword": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ResetUserPassword' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"UserName": "",
"NewPassword": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"NewPassword\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ResetUserPassword"
payload = {
"DirectoryId": "",
"UserName": "",
"NewPassword": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ResetUserPassword"
payload <- "{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"NewPassword\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ResetUserPassword")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"NewPassword\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"UserName\": \"\",\n \"NewPassword\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ResetUserPassword";
let payload = json!({
"DirectoryId": "",
"UserName": "",
"NewPassword": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ResetUserPassword' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"UserName": "",
"NewPassword": ""
}'
echo '{
"DirectoryId": "",
"UserName": "",
"NewPassword": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ResetUserPassword' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "UserName": "",\n "NewPassword": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ResetUserPassword'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"UserName": "",
"NewPassword": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ResetUserPassword")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
RestoreFromSnapshot
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RestoreFromSnapshot
HEADERS
X-Amz-Target
BODY json
{
"SnapshotId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RestoreFromSnapshot");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"SnapshotId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RestoreFromSnapshot" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:SnapshotId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RestoreFromSnapshot"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"SnapshotId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RestoreFromSnapshot"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"SnapshotId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RestoreFromSnapshot");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"SnapshotId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RestoreFromSnapshot"
payload := strings.NewReader("{\n \"SnapshotId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 22
{
"SnapshotId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RestoreFromSnapshot")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"SnapshotId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RestoreFromSnapshot"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"SnapshotId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"SnapshotId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RestoreFromSnapshot")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RestoreFromSnapshot")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"SnapshotId\": \"\"\n}")
.asString();
const data = JSON.stringify({
SnapshotId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RestoreFromSnapshot');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RestoreFromSnapshot',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {SnapshotId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RestoreFromSnapshot';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"SnapshotId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RestoreFromSnapshot',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "SnapshotId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"SnapshotId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RestoreFromSnapshot")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({SnapshotId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RestoreFromSnapshot',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {SnapshotId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RestoreFromSnapshot');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
SnapshotId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RestoreFromSnapshot',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {SnapshotId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RestoreFromSnapshot';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"SnapshotId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"SnapshotId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RestoreFromSnapshot"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RestoreFromSnapshot" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"SnapshotId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RestoreFromSnapshot",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'SnapshotId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RestoreFromSnapshot', [
'body' => '{
"SnapshotId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RestoreFromSnapshot');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'SnapshotId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'SnapshotId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RestoreFromSnapshot');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RestoreFromSnapshot' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SnapshotId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RestoreFromSnapshot' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SnapshotId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"SnapshotId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RestoreFromSnapshot"
payload = { "SnapshotId": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RestoreFromSnapshot"
payload <- "{\n \"SnapshotId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RestoreFromSnapshot")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"SnapshotId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"SnapshotId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RestoreFromSnapshot";
let payload = json!({"SnapshotId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RestoreFromSnapshot' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"SnapshotId": ""
}'
echo '{
"SnapshotId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RestoreFromSnapshot' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "SnapshotId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RestoreFromSnapshot'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["SnapshotId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.RestoreFromSnapshot")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ShareDirectory");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"ShareNotes\": \"\",\n \"ShareTarget\": \"\",\n \"ShareMethod\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ShareDirectory" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:ShareNotes ""
:ShareTarget ""
:ShareMethod ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ShareDirectory"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"ShareNotes\": \"\",\n \"ShareTarget\": \"\",\n \"ShareMethod\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ShareDirectory"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"ShareNotes\": \"\",\n \"ShareTarget\": \"\",\n \"ShareMethod\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ShareDirectory");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"ShareNotes\": \"\",\n \"ShareTarget\": \"\",\n \"ShareMethod\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ShareDirectory"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"ShareNotes\": \"\",\n \"ShareTarget\": \"\",\n \"ShareMethod\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 85
{
"DirectoryId": "",
"ShareNotes": "",
"ShareTarget": "",
"ShareMethod": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ShareDirectory")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"ShareNotes\": \"\",\n \"ShareTarget\": \"\",\n \"ShareMethod\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ShareDirectory"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"ShareNotes\": \"\",\n \"ShareTarget\": \"\",\n \"ShareMethod\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"ShareNotes\": \"\",\n \"ShareTarget\": \"\",\n \"ShareMethod\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ShareDirectory")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ShareDirectory")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"ShareNotes\": \"\",\n \"ShareTarget\": \"\",\n \"ShareMethod\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
ShareNotes: '',
ShareTarget: '',
ShareMethod: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ShareDirectory');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ShareDirectory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', ShareNotes: '', ShareTarget: '', ShareMethod: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ShareDirectory';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","ShareNotes":"","ShareTarget":"","ShareMethod":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ShareDirectory',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "ShareNotes": "",\n "ShareTarget": "",\n "ShareMethod": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"ShareNotes\": \"\",\n \"ShareTarget\": \"\",\n \"ShareMethod\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ShareDirectory")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', ShareNotes: '', ShareTarget: '', ShareMethod: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ShareDirectory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', ShareNotes: '', ShareTarget: '', ShareMethod: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ShareDirectory');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
ShareNotes: '',
ShareTarget: '',
ShareMethod: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ShareDirectory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', ShareNotes: '', ShareTarget: '', ShareMethod: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ShareDirectory';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","ShareNotes":"","ShareTarget":"","ShareMethod":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"ShareNotes": @"",
@"ShareTarget": @"",
@"ShareMethod": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ShareDirectory"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ShareDirectory" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"ShareNotes\": \"\",\n \"ShareTarget\": \"\",\n \"ShareMethod\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ShareDirectory",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'ShareNotes' => '',
'ShareTarget' => '',
'ShareMethod' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ShareDirectory', [
'body' => '{
"DirectoryId": "",
"ShareNotes": "",
"ShareTarget": "",
"ShareMethod": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ShareDirectory');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'ShareNotes' => '',
'ShareTarget' => '',
'ShareMethod' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'ShareNotes' => '',
'ShareTarget' => '',
'ShareMethod' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ShareDirectory');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ShareDirectory' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"ShareNotes": "",
"ShareTarget": "",
"ShareMethod": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ShareDirectory' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"ShareNotes": "",
"ShareTarget": "",
"ShareMethod": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"ShareNotes\": \"\",\n \"ShareTarget\": \"\",\n \"ShareMethod\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ShareDirectory"
payload = {
"DirectoryId": "",
"ShareNotes": "",
"ShareTarget": "",
"ShareMethod": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ShareDirectory"
payload <- "{\n \"DirectoryId\": \"\",\n \"ShareNotes\": \"\",\n \"ShareTarget\": \"\",\n \"ShareMethod\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ShareDirectory")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"ShareNotes\": \"\",\n \"ShareTarget\": \"\",\n \"ShareMethod\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"ShareNotes\": \"\",\n \"ShareTarget\": \"\",\n \"ShareMethod\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ShareDirectory";
let payload = json!({
"DirectoryId": "",
"ShareNotes": "",
"ShareTarget": "",
"ShareMethod": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ShareDirectory' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"ShareNotes": "",
"ShareTarget": "",
"ShareMethod": ""
}'
echo '{
"DirectoryId": "",
"ShareNotes": "",
"ShareTarget": "",
"ShareMethod": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ShareDirectory' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "ShareNotes": "",\n "ShareTarget": "",\n "ShareMethod": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ShareDirectory'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"ShareNotes": "",
"ShareTarget": "",
"ShareMethod": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.ShareDirectory")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
StartSchemaExtension
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.StartSchemaExtension
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"CreateSnapshotBeforeSchemaExtension": "",
"LdifContent": "",
"Description": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.StartSchemaExtension");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"CreateSnapshotBeforeSchemaExtension\": \"\",\n \"LdifContent\": \"\",\n \"Description\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.StartSchemaExtension" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:CreateSnapshotBeforeSchemaExtension ""
:LdifContent ""
:Description ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.StartSchemaExtension"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"CreateSnapshotBeforeSchemaExtension\": \"\",\n \"LdifContent\": \"\",\n \"Description\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.StartSchemaExtension"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"CreateSnapshotBeforeSchemaExtension\": \"\",\n \"LdifContent\": \"\",\n \"Description\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.StartSchemaExtension");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"CreateSnapshotBeforeSchemaExtension\": \"\",\n \"LdifContent\": \"\",\n \"Description\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.StartSchemaExtension"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"CreateSnapshotBeforeSchemaExtension\": \"\",\n \"LdifContent\": \"\",\n \"Description\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 110
{
"DirectoryId": "",
"CreateSnapshotBeforeSchemaExtension": "",
"LdifContent": "",
"Description": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.StartSchemaExtension")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"CreateSnapshotBeforeSchemaExtension\": \"\",\n \"LdifContent\": \"\",\n \"Description\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.StartSchemaExtension"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"CreateSnapshotBeforeSchemaExtension\": \"\",\n \"LdifContent\": \"\",\n \"Description\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"CreateSnapshotBeforeSchemaExtension\": \"\",\n \"LdifContent\": \"\",\n \"Description\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.StartSchemaExtension")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.StartSchemaExtension")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"CreateSnapshotBeforeSchemaExtension\": \"\",\n \"LdifContent\": \"\",\n \"Description\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
CreateSnapshotBeforeSchemaExtension: '',
LdifContent: '',
Description: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.StartSchemaExtension');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.StartSchemaExtension',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
DirectoryId: '',
CreateSnapshotBeforeSchemaExtension: '',
LdifContent: '',
Description: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.StartSchemaExtension';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","CreateSnapshotBeforeSchemaExtension":"","LdifContent":"","Description":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.StartSchemaExtension',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "CreateSnapshotBeforeSchemaExtension": "",\n "LdifContent": "",\n "Description": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"CreateSnapshotBeforeSchemaExtension\": \"\",\n \"LdifContent\": \"\",\n \"Description\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.StartSchemaExtension")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
DirectoryId: '',
CreateSnapshotBeforeSchemaExtension: '',
LdifContent: '',
Description: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.StartSchemaExtension',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
DirectoryId: '',
CreateSnapshotBeforeSchemaExtension: '',
LdifContent: '',
Description: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.StartSchemaExtension');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
CreateSnapshotBeforeSchemaExtension: '',
LdifContent: '',
Description: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.StartSchemaExtension',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
DirectoryId: '',
CreateSnapshotBeforeSchemaExtension: '',
LdifContent: '',
Description: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.StartSchemaExtension';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","CreateSnapshotBeforeSchemaExtension":"","LdifContent":"","Description":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"CreateSnapshotBeforeSchemaExtension": @"",
@"LdifContent": @"",
@"Description": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.StartSchemaExtension"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.StartSchemaExtension" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"CreateSnapshotBeforeSchemaExtension\": \"\",\n \"LdifContent\": \"\",\n \"Description\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.StartSchemaExtension",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'CreateSnapshotBeforeSchemaExtension' => '',
'LdifContent' => '',
'Description' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.StartSchemaExtension', [
'body' => '{
"DirectoryId": "",
"CreateSnapshotBeforeSchemaExtension": "",
"LdifContent": "",
"Description": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.StartSchemaExtension');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'CreateSnapshotBeforeSchemaExtension' => '',
'LdifContent' => '',
'Description' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'CreateSnapshotBeforeSchemaExtension' => '',
'LdifContent' => '',
'Description' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.StartSchemaExtension');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.StartSchemaExtension' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"CreateSnapshotBeforeSchemaExtension": "",
"LdifContent": "",
"Description": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.StartSchemaExtension' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"CreateSnapshotBeforeSchemaExtension": "",
"LdifContent": "",
"Description": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"CreateSnapshotBeforeSchemaExtension\": \"\",\n \"LdifContent\": \"\",\n \"Description\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.StartSchemaExtension"
payload = {
"DirectoryId": "",
"CreateSnapshotBeforeSchemaExtension": "",
"LdifContent": "",
"Description": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.StartSchemaExtension"
payload <- "{\n \"DirectoryId\": \"\",\n \"CreateSnapshotBeforeSchemaExtension\": \"\",\n \"LdifContent\": \"\",\n \"Description\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.StartSchemaExtension")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"CreateSnapshotBeforeSchemaExtension\": \"\",\n \"LdifContent\": \"\",\n \"Description\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"CreateSnapshotBeforeSchemaExtension\": \"\",\n \"LdifContent\": \"\",\n \"Description\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.StartSchemaExtension";
let payload = json!({
"DirectoryId": "",
"CreateSnapshotBeforeSchemaExtension": "",
"LdifContent": "",
"Description": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.StartSchemaExtension' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"CreateSnapshotBeforeSchemaExtension": "",
"LdifContent": "",
"Description": ""
}'
echo '{
"DirectoryId": "",
"CreateSnapshotBeforeSchemaExtension": "",
"LdifContent": "",
"Description": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.StartSchemaExtension' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "CreateSnapshotBeforeSchemaExtension": "",\n "LdifContent": "",\n "Description": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.StartSchemaExtension'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"CreateSnapshotBeforeSchemaExtension": "",
"LdifContent": "",
"Description": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.StartSchemaExtension")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UnshareDirectory");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"UnshareTarget\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UnshareDirectory" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:UnshareTarget ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UnshareDirectory"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"UnshareTarget\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UnshareDirectory"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"UnshareTarget\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UnshareDirectory");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"UnshareTarget\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UnshareDirectory"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"UnshareTarget\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 46
{
"DirectoryId": "",
"UnshareTarget": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UnshareDirectory")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"UnshareTarget\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UnshareDirectory"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"UnshareTarget\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"UnshareTarget\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UnshareDirectory")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UnshareDirectory")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"UnshareTarget\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
UnshareTarget: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UnshareDirectory');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UnshareDirectory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', UnshareTarget: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UnshareDirectory';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","UnshareTarget":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UnshareDirectory',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "UnshareTarget": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"UnshareTarget\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UnshareDirectory")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', UnshareTarget: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UnshareDirectory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', UnshareTarget: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UnshareDirectory');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
UnshareTarget: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UnshareDirectory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', UnshareTarget: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UnshareDirectory';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","UnshareTarget":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"UnshareTarget": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UnshareDirectory"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UnshareDirectory" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"UnshareTarget\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UnshareDirectory",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'UnshareTarget' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UnshareDirectory', [
'body' => '{
"DirectoryId": "",
"UnshareTarget": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UnshareDirectory');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'UnshareTarget' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'UnshareTarget' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UnshareDirectory');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UnshareDirectory' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"UnshareTarget": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UnshareDirectory' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"UnshareTarget": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"UnshareTarget\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UnshareDirectory"
payload = {
"DirectoryId": "",
"UnshareTarget": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UnshareDirectory"
payload <- "{\n \"DirectoryId\": \"\",\n \"UnshareTarget\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UnshareDirectory")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"UnshareTarget\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"UnshareTarget\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UnshareDirectory";
let payload = json!({
"DirectoryId": "",
"UnshareTarget": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UnshareDirectory' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"UnshareTarget": ""
}'
echo '{
"DirectoryId": "",
"UnshareTarget": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UnshareDirectory' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "UnshareTarget": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UnshareDirectory'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"UnshareTarget": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UnshareDirectory")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
UpdateConditionalForwarder
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateConditionalForwarder
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"RemoteDomainName": "",
"DnsIpAddrs": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateConditionalForwarder");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"DnsIpAddrs\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateConditionalForwarder" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:RemoteDomainName ""
:DnsIpAddrs ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateConditionalForwarder"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"DnsIpAddrs\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateConditionalForwarder"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"DnsIpAddrs\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateConditionalForwarder");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"DnsIpAddrs\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateConditionalForwarder"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"DnsIpAddrs\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 69
{
"DirectoryId": "",
"RemoteDomainName": "",
"DnsIpAddrs": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateConditionalForwarder")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"DnsIpAddrs\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateConditionalForwarder"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"DnsIpAddrs\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"DnsIpAddrs\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateConditionalForwarder")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateConditionalForwarder")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"DnsIpAddrs\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
RemoteDomainName: '',
DnsIpAddrs: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateConditionalForwarder');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateConditionalForwarder',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', RemoteDomainName: '', DnsIpAddrs: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateConditionalForwarder';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","RemoteDomainName":"","DnsIpAddrs":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateConditionalForwarder',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "RemoteDomainName": "",\n "DnsIpAddrs": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"DnsIpAddrs\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateConditionalForwarder")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', RemoteDomainName: '', DnsIpAddrs: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateConditionalForwarder',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', RemoteDomainName: '', DnsIpAddrs: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateConditionalForwarder');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
RemoteDomainName: '',
DnsIpAddrs: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateConditionalForwarder',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', RemoteDomainName: '', DnsIpAddrs: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateConditionalForwarder';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","RemoteDomainName":"","DnsIpAddrs":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"RemoteDomainName": @"",
@"DnsIpAddrs": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateConditionalForwarder"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateConditionalForwarder" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"DnsIpAddrs\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateConditionalForwarder",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'RemoteDomainName' => '',
'DnsIpAddrs' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateConditionalForwarder', [
'body' => '{
"DirectoryId": "",
"RemoteDomainName": "",
"DnsIpAddrs": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateConditionalForwarder');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'RemoteDomainName' => '',
'DnsIpAddrs' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'RemoteDomainName' => '',
'DnsIpAddrs' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateConditionalForwarder');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateConditionalForwarder' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"RemoteDomainName": "",
"DnsIpAddrs": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateConditionalForwarder' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"RemoteDomainName": "",
"DnsIpAddrs": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"DnsIpAddrs\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateConditionalForwarder"
payload = {
"DirectoryId": "",
"RemoteDomainName": "",
"DnsIpAddrs": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateConditionalForwarder"
payload <- "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"DnsIpAddrs\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateConditionalForwarder")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"DnsIpAddrs\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"RemoteDomainName\": \"\",\n \"DnsIpAddrs\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateConditionalForwarder";
let payload = json!({
"DirectoryId": "",
"RemoteDomainName": "",
"DnsIpAddrs": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateConditionalForwarder' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"RemoteDomainName": "",
"DnsIpAddrs": ""
}'
echo '{
"DirectoryId": "",
"RemoteDomainName": "",
"DnsIpAddrs": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateConditionalForwarder' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "RemoteDomainName": "",\n "DnsIpAddrs": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateConditionalForwarder'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"RemoteDomainName": "",
"DnsIpAddrs": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateConditionalForwarder")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
UpdateDirectorySetup
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateDirectorySetup
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"UpdateType": "",
"OSUpdateSettings": "",
"CreateSnapshotBeforeUpdate": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateDirectorySetup");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"UpdateType\": \"\",\n \"OSUpdateSettings\": \"\",\n \"CreateSnapshotBeforeUpdate\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateDirectorySetup" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:UpdateType ""
:OSUpdateSettings ""
:CreateSnapshotBeforeUpdate ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateDirectorySetup"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"UpdateType\": \"\",\n \"OSUpdateSettings\": \"\",\n \"CreateSnapshotBeforeUpdate\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateDirectorySetup"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"UpdateType\": \"\",\n \"OSUpdateSettings\": \"\",\n \"CreateSnapshotBeforeUpdate\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateDirectorySetup");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"UpdateType\": \"\",\n \"OSUpdateSettings\": \"\",\n \"CreateSnapshotBeforeUpdate\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateDirectorySetup"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"UpdateType\": \"\",\n \"OSUpdateSettings\": \"\",\n \"CreateSnapshotBeforeUpdate\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 105
{
"DirectoryId": "",
"UpdateType": "",
"OSUpdateSettings": "",
"CreateSnapshotBeforeUpdate": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateDirectorySetup")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"UpdateType\": \"\",\n \"OSUpdateSettings\": \"\",\n \"CreateSnapshotBeforeUpdate\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateDirectorySetup"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"UpdateType\": \"\",\n \"OSUpdateSettings\": \"\",\n \"CreateSnapshotBeforeUpdate\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"UpdateType\": \"\",\n \"OSUpdateSettings\": \"\",\n \"CreateSnapshotBeforeUpdate\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateDirectorySetup")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateDirectorySetup")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"UpdateType\": \"\",\n \"OSUpdateSettings\": \"\",\n \"CreateSnapshotBeforeUpdate\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
UpdateType: '',
OSUpdateSettings: '',
CreateSnapshotBeforeUpdate: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateDirectorySetup');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateDirectorySetup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
DirectoryId: '',
UpdateType: '',
OSUpdateSettings: '',
CreateSnapshotBeforeUpdate: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateDirectorySetup';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","UpdateType":"","OSUpdateSettings":"","CreateSnapshotBeforeUpdate":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateDirectorySetup',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "UpdateType": "",\n "OSUpdateSettings": "",\n "CreateSnapshotBeforeUpdate": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"UpdateType\": \"\",\n \"OSUpdateSettings\": \"\",\n \"CreateSnapshotBeforeUpdate\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateDirectorySetup")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
DirectoryId: '',
UpdateType: '',
OSUpdateSettings: '',
CreateSnapshotBeforeUpdate: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateDirectorySetup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
DirectoryId: '',
UpdateType: '',
OSUpdateSettings: '',
CreateSnapshotBeforeUpdate: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateDirectorySetup');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
UpdateType: '',
OSUpdateSettings: '',
CreateSnapshotBeforeUpdate: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateDirectorySetup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
DirectoryId: '',
UpdateType: '',
OSUpdateSettings: '',
CreateSnapshotBeforeUpdate: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateDirectorySetup';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","UpdateType":"","OSUpdateSettings":"","CreateSnapshotBeforeUpdate":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"UpdateType": @"",
@"OSUpdateSettings": @"",
@"CreateSnapshotBeforeUpdate": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateDirectorySetup"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateDirectorySetup" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"UpdateType\": \"\",\n \"OSUpdateSettings\": \"\",\n \"CreateSnapshotBeforeUpdate\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateDirectorySetup",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'UpdateType' => '',
'OSUpdateSettings' => '',
'CreateSnapshotBeforeUpdate' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateDirectorySetup', [
'body' => '{
"DirectoryId": "",
"UpdateType": "",
"OSUpdateSettings": "",
"CreateSnapshotBeforeUpdate": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateDirectorySetup');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'UpdateType' => '',
'OSUpdateSettings' => '',
'CreateSnapshotBeforeUpdate' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'UpdateType' => '',
'OSUpdateSettings' => '',
'CreateSnapshotBeforeUpdate' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateDirectorySetup');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateDirectorySetup' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"UpdateType": "",
"OSUpdateSettings": "",
"CreateSnapshotBeforeUpdate": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateDirectorySetup' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"UpdateType": "",
"OSUpdateSettings": "",
"CreateSnapshotBeforeUpdate": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"UpdateType\": \"\",\n \"OSUpdateSettings\": \"\",\n \"CreateSnapshotBeforeUpdate\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateDirectorySetup"
payload = {
"DirectoryId": "",
"UpdateType": "",
"OSUpdateSettings": "",
"CreateSnapshotBeforeUpdate": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateDirectorySetup"
payload <- "{\n \"DirectoryId\": \"\",\n \"UpdateType\": \"\",\n \"OSUpdateSettings\": \"\",\n \"CreateSnapshotBeforeUpdate\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateDirectorySetup")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"UpdateType\": \"\",\n \"OSUpdateSettings\": \"\",\n \"CreateSnapshotBeforeUpdate\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"UpdateType\": \"\",\n \"OSUpdateSettings\": \"\",\n \"CreateSnapshotBeforeUpdate\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateDirectorySetup";
let payload = json!({
"DirectoryId": "",
"UpdateType": "",
"OSUpdateSettings": "",
"CreateSnapshotBeforeUpdate": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateDirectorySetup' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"UpdateType": "",
"OSUpdateSettings": "",
"CreateSnapshotBeforeUpdate": ""
}'
echo '{
"DirectoryId": "",
"UpdateType": "",
"OSUpdateSettings": "",
"CreateSnapshotBeforeUpdate": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateDirectorySetup' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "UpdateType": "",\n "OSUpdateSettings": "",\n "CreateSnapshotBeforeUpdate": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateDirectorySetup'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"UpdateType": "",
"OSUpdateSettings": "",
"CreateSnapshotBeforeUpdate": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateDirectorySetup")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
UpdateNumberOfDomainControllers
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateNumberOfDomainControllers
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"DesiredNumber": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateNumberOfDomainControllers");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"DesiredNumber\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateNumberOfDomainControllers" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:DesiredNumber ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateNumberOfDomainControllers"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"DesiredNumber\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateNumberOfDomainControllers"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"DesiredNumber\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateNumberOfDomainControllers");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"DesiredNumber\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateNumberOfDomainControllers"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"DesiredNumber\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 46
{
"DirectoryId": "",
"DesiredNumber": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateNumberOfDomainControllers")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"DesiredNumber\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateNumberOfDomainControllers"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"DesiredNumber\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"DesiredNumber\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateNumberOfDomainControllers")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateNumberOfDomainControllers")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"DesiredNumber\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
DesiredNumber: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateNumberOfDomainControllers');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateNumberOfDomainControllers',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', DesiredNumber: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateNumberOfDomainControllers';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","DesiredNumber":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateNumberOfDomainControllers',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "DesiredNumber": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"DesiredNumber\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateNumberOfDomainControllers")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', DesiredNumber: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateNumberOfDomainControllers',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', DesiredNumber: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateNumberOfDomainControllers');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
DesiredNumber: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateNumberOfDomainControllers',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', DesiredNumber: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateNumberOfDomainControllers';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","DesiredNumber":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"DesiredNumber": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateNumberOfDomainControllers"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateNumberOfDomainControllers" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"DesiredNumber\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateNumberOfDomainControllers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'DesiredNumber' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateNumberOfDomainControllers', [
'body' => '{
"DirectoryId": "",
"DesiredNumber": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateNumberOfDomainControllers');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'DesiredNumber' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'DesiredNumber' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateNumberOfDomainControllers');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateNumberOfDomainControllers' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"DesiredNumber": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateNumberOfDomainControllers' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"DesiredNumber": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"DesiredNumber\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateNumberOfDomainControllers"
payload = {
"DirectoryId": "",
"DesiredNumber": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateNumberOfDomainControllers"
payload <- "{\n \"DirectoryId\": \"\",\n \"DesiredNumber\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateNumberOfDomainControllers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"DesiredNumber\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"DesiredNumber\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateNumberOfDomainControllers";
let payload = json!({
"DirectoryId": "",
"DesiredNumber": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateNumberOfDomainControllers' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"DesiredNumber": ""
}'
echo '{
"DirectoryId": "",
"DesiredNumber": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateNumberOfDomainControllers' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "DesiredNumber": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateNumberOfDomainControllers'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"DesiredNumber": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateNumberOfDomainControllers")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
UpdateRadius
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateRadius
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"RadiusSettings": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateRadius");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"RadiusSettings\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateRadius" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:RadiusSettings ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateRadius"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"RadiusSettings\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateRadius"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"RadiusSettings\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateRadius");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"RadiusSettings\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateRadius"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"RadiusSettings\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 47
{
"DirectoryId": "",
"RadiusSettings": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateRadius")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"RadiusSettings\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateRadius"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"RadiusSettings\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"RadiusSettings\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateRadius")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateRadius")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"RadiusSettings\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
RadiusSettings: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateRadius');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateRadius',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', RadiusSettings: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateRadius';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","RadiusSettings":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateRadius',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "RadiusSettings": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"RadiusSettings\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateRadius")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', RadiusSettings: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateRadius',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', RadiusSettings: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateRadius');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
RadiusSettings: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateRadius',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', RadiusSettings: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateRadius';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","RadiusSettings":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"RadiusSettings": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateRadius"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateRadius" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"RadiusSettings\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateRadius",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'RadiusSettings' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateRadius', [
'body' => '{
"DirectoryId": "",
"RadiusSettings": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateRadius');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'RadiusSettings' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'RadiusSettings' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateRadius');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateRadius' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"RadiusSettings": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateRadius' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"RadiusSettings": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"RadiusSettings\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateRadius"
payload = {
"DirectoryId": "",
"RadiusSettings": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateRadius"
payload <- "{\n \"DirectoryId\": \"\",\n \"RadiusSettings\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateRadius")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"RadiusSettings\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"RadiusSettings\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateRadius";
let payload = json!({
"DirectoryId": "",
"RadiusSettings": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateRadius' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"RadiusSettings": ""
}'
echo '{
"DirectoryId": "",
"RadiusSettings": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateRadius' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "RadiusSettings": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateRadius'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"RadiusSettings": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateRadius")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
UpdateSettings
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateSettings
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"Settings": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateSettings");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DirectoryId\": \"\",\n \"Settings\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateSettings" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:Settings ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateSettings"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"Settings\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateSettings"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"Settings\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateSettings");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"Settings\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateSettings"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"Settings\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 41
{
"DirectoryId": "",
"Settings": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateSettings")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"Settings\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateSettings"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"Settings\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"Settings\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateSettings")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateSettings")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"Settings\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
Settings: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateSettings');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateSettings',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', Settings: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateSettings';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","Settings":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateSettings',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "Settings": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"Settings\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateSettings")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DirectoryId: '', Settings: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateSettings',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DirectoryId: '', Settings: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateSettings');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
Settings: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateSettings',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DirectoryId: '', Settings: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateSettings';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","Settings":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DirectoryId": @"",
@"Settings": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateSettings"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateSettings" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"Settings\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateSettings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DirectoryId' => '',
'Settings' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateSettings', [
'body' => '{
"DirectoryId": "",
"Settings": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateSettings');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'Settings' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'Settings' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateSettings');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateSettings' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"Settings": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateSettings' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"Settings": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"Settings\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateSettings"
payload = {
"DirectoryId": "",
"Settings": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateSettings"
payload <- "{\n \"DirectoryId\": \"\",\n \"Settings\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateSettings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DirectoryId\": \"\",\n \"Settings\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DirectoryId\": \"\",\n \"Settings\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateSettings";
let payload = json!({
"DirectoryId": "",
"Settings": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateSettings' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"Settings": ""
}'
echo '{
"DirectoryId": "",
"Settings": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateSettings' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "Settings": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateSettings'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"Settings": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateSettings")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
UpdateTrust
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateTrust
HEADERS
X-Amz-Target
BODY json
{
"TrustId": "",
"SelectiveAuth": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateTrust");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"TrustId\": \"\",\n \"SelectiveAuth\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateTrust" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:TrustId ""
:SelectiveAuth ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateTrust"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"TrustId\": \"\",\n \"SelectiveAuth\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateTrust"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"TrustId\": \"\",\n \"SelectiveAuth\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateTrust");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"TrustId\": \"\",\n \"SelectiveAuth\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateTrust"
payload := strings.NewReader("{\n \"TrustId\": \"\",\n \"SelectiveAuth\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 42
{
"TrustId": "",
"SelectiveAuth": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateTrust")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"TrustId\": \"\",\n \"SelectiveAuth\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateTrust"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"TrustId\": \"\",\n \"SelectiveAuth\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"TrustId\": \"\",\n \"SelectiveAuth\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateTrust")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateTrust")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"TrustId\": \"\",\n \"SelectiveAuth\": \"\"\n}")
.asString();
const data = JSON.stringify({
TrustId: '',
SelectiveAuth: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateTrust');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateTrust',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {TrustId: '', SelectiveAuth: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateTrust';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"TrustId":"","SelectiveAuth":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateTrust',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "TrustId": "",\n "SelectiveAuth": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"TrustId\": \"\",\n \"SelectiveAuth\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateTrust")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({TrustId: '', SelectiveAuth: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateTrust',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {TrustId: '', SelectiveAuth: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateTrust');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
TrustId: '',
SelectiveAuth: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateTrust',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {TrustId: '', SelectiveAuth: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateTrust';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"TrustId":"","SelectiveAuth":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"TrustId": @"",
@"SelectiveAuth": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateTrust"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateTrust" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"TrustId\": \"\",\n \"SelectiveAuth\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateTrust",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'TrustId' => '',
'SelectiveAuth' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateTrust', [
'body' => '{
"TrustId": "",
"SelectiveAuth": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateTrust');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'TrustId' => '',
'SelectiveAuth' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'TrustId' => '',
'SelectiveAuth' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateTrust');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateTrust' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"TrustId": "",
"SelectiveAuth": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateTrust' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"TrustId": "",
"SelectiveAuth": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"TrustId\": \"\",\n \"SelectiveAuth\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateTrust"
payload = {
"TrustId": "",
"SelectiveAuth": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateTrust"
payload <- "{\n \"TrustId\": \"\",\n \"SelectiveAuth\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateTrust")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"TrustId\": \"\",\n \"SelectiveAuth\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"TrustId\": \"\",\n \"SelectiveAuth\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateTrust";
let payload = json!({
"TrustId": "",
"SelectiveAuth": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateTrust' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"TrustId": "",
"SelectiveAuth": ""
}'
echo '{
"TrustId": "",
"SelectiveAuth": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateTrust' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "TrustId": "",\n "SelectiveAuth": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateTrust'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"TrustId": "",
"SelectiveAuth": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.UpdateTrust")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
VerifyTrust
{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.VerifyTrust
HEADERS
X-Amz-Target
BODY json
{
"TrustId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.VerifyTrust");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"TrustId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.VerifyTrust" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:TrustId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.VerifyTrust"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"TrustId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.VerifyTrust"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"TrustId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.VerifyTrust");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"TrustId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.VerifyTrust"
payload := strings.NewReader("{\n \"TrustId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 19
{
"TrustId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.VerifyTrust")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"TrustId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.VerifyTrust"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"TrustId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"TrustId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.VerifyTrust")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.VerifyTrust")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"TrustId\": \"\"\n}")
.asString();
const data = JSON.stringify({
TrustId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.VerifyTrust');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.VerifyTrust',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {TrustId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.VerifyTrust';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"TrustId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.VerifyTrust',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "TrustId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"TrustId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.VerifyTrust")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({TrustId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.VerifyTrust',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {TrustId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.VerifyTrust');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
TrustId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.VerifyTrust',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {TrustId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.VerifyTrust';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"TrustId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"TrustId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.VerifyTrust"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.VerifyTrust" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"TrustId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.VerifyTrust",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'TrustId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.VerifyTrust', [
'body' => '{
"TrustId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.VerifyTrust');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'TrustId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'TrustId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.VerifyTrust');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.VerifyTrust' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"TrustId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.VerifyTrust' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"TrustId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"TrustId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.VerifyTrust"
payload = { "TrustId": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.VerifyTrust"
payload <- "{\n \"TrustId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.VerifyTrust")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"TrustId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"TrustId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.VerifyTrust";
let payload = json!({"TrustId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.VerifyTrust' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"TrustId": ""
}'
echo '{
"TrustId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.VerifyTrust' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "TrustId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.VerifyTrust'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["TrustId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DirectoryService_20150416.VerifyTrust")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()