Amazon Simple Systems Manager (SSM)
POST
AddTagsToResource
{{baseUrl}}/#X-Amz-Target=AmazonSSM.AddTagsToResource
HEADERS
X-Amz-Target
BODY json
{
"ResourceType": "",
"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=AmazonSSM.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 \"ResourceType\": \"\",\n \"ResourceId\": \"\",\n \"Tags\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.AddTagsToResource" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ResourceType ""
:ResourceId ""
:Tags ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.AddTagsToResource"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ResourceType\": \"\",\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=AmazonSSM.AddTagsToResource"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ResourceType\": \"\",\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=AmazonSSM.AddTagsToResource");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ResourceType\": \"\",\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=AmazonSSM.AddTagsToResource"
payload := strings.NewReader("{\n \"ResourceType\": \"\",\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: 58
{
"ResourceType": "",
"ResourceId": "",
"Tags": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.AddTagsToResource")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ResourceType\": \"\",\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=AmazonSSM.AddTagsToResource"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ResourceType\": \"\",\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 \"ResourceType\": \"\",\n \"ResourceId\": \"\",\n \"Tags\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.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=AmazonSSM.AddTagsToResource")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ResourceType\": \"\",\n \"ResourceId\": \"\",\n \"Tags\": \"\"\n}")
.asString();
const data = JSON.stringify({
ResourceType: '',
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=AmazonSSM.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=AmazonSSM.AddTagsToResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ResourceType: '', ResourceId: '', Tags: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.AddTagsToResource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ResourceType":"","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=AmazonSSM.AddTagsToResource',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ResourceType": "",\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 \"ResourceType\": \"\",\n \"ResourceId\": \"\",\n \"Tags\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.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({ResourceType: '', ResourceId: '', Tags: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.AddTagsToResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {ResourceType: '', 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=AmazonSSM.AddTagsToResource');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ResourceType: '',
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=AmazonSSM.AddTagsToResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ResourceType: '', 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=AmazonSSM.AddTagsToResource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ResourceType":"","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 = @{ @"ResourceType": @"",
@"ResourceId": @"",
@"Tags": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.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=AmazonSSM.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 \"ResourceType\": \"\",\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=AmazonSSM.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([
'ResourceType' => '',
'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=AmazonSSM.AddTagsToResource', [
'body' => '{
"ResourceType": "",
"ResourceId": "",
"Tags": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.AddTagsToResource');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ResourceType' => '',
'ResourceId' => '',
'Tags' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ResourceType' => '',
'ResourceId' => '',
'Tags' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.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=AmazonSSM.AddTagsToResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ResourceType": "",
"ResourceId": "",
"Tags": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.AddTagsToResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ResourceType": "",
"ResourceId": "",
"Tags": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ResourceType\": \"\",\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=AmazonSSM.AddTagsToResource"
payload = {
"ResourceType": "",
"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=AmazonSSM.AddTagsToResource"
payload <- "{\n \"ResourceType\": \"\",\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=AmazonSSM.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 \"ResourceType\": \"\",\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 \"ResourceType\": \"\",\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=AmazonSSM.AddTagsToResource";
let payload = json!({
"ResourceType": "",
"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=AmazonSSM.AddTagsToResource' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ResourceType": "",
"ResourceId": "",
"Tags": ""
}'
echo '{
"ResourceType": "",
"ResourceId": "",
"Tags": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.AddTagsToResource' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ResourceType": "",\n "ResourceId": "",\n "Tags": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.AddTagsToResource'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"ResourceType": "",
"ResourceId": "",
"Tags": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.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()
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.AssociateOpsItemRelatedItem");
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 \"OpsItemId\": \"\",\n \"AssociationType\": \"\",\n \"ResourceType\": \"\",\n \"ResourceUri\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.AssociateOpsItemRelatedItem" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OpsItemId ""
:AssociationType ""
:ResourceType ""
:ResourceUri ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.AssociateOpsItemRelatedItem"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OpsItemId\": \"\",\n \"AssociationType\": \"\",\n \"ResourceType\": \"\",\n \"ResourceUri\": \"\"\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=AmazonSSM.AssociateOpsItemRelatedItem"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OpsItemId\": \"\",\n \"AssociationType\": \"\",\n \"ResourceType\": \"\",\n \"ResourceUri\": \"\"\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=AmazonSSM.AssociateOpsItemRelatedItem");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OpsItemId\": \"\",\n \"AssociationType\": \"\",\n \"ResourceType\": \"\",\n \"ResourceUri\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.AssociateOpsItemRelatedItem"
payload := strings.NewReader("{\n \"OpsItemId\": \"\",\n \"AssociationType\": \"\",\n \"ResourceType\": \"\",\n \"ResourceUri\": \"\"\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: 89
{
"OpsItemId": "",
"AssociationType": "",
"ResourceType": "",
"ResourceUri": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.AssociateOpsItemRelatedItem")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OpsItemId\": \"\",\n \"AssociationType\": \"\",\n \"ResourceType\": \"\",\n \"ResourceUri\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.AssociateOpsItemRelatedItem"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OpsItemId\": \"\",\n \"AssociationType\": \"\",\n \"ResourceType\": \"\",\n \"ResourceUri\": \"\"\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 \"OpsItemId\": \"\",\n \"AssociationType\": \"\",\n \"ResourceType\": \"\",\n \"ResourceUri\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.AssociateOpsItemRelatedItem")
.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=AmazonSSM.AssociateOpsItemRelatedItem")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OpsItemId\": \"\",\n \"AssociationType\": \"\",\n \"ResourceType\": \"\",\n \"ResourceUri\": \"\"\n}")
.asString();
const data = JSON.stringify({
OpsItemId: '',
AssociationType: '',
ResourceType: '',
ResourceUri: ''
});
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=AmazonSSM.AssociateOpsItemRelatedItem');
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=AmazonSSM.AssociateOpsItemRelatedItem',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OpsItemId: '', AssociationType: '', ResourceType: '', ResourceUri: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.AssociateOpsItemRelatedItem';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OpsItemId":"","AssociationType":"","ResourceType":"","ResourceUri":""}'
};
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=AmazonSSM.AssociateOpsItemRelatedItem',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OpsItemId": "",\n "AssociationType": "",\n "ResourceType": "",\n "ResourceUri": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OpsItemId\": \"\",\n \"AssociationType\": \"\",\n \"ResourceType\": \"\",\n \"ResourceUri\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.AssociateOpsItemRelatedItem")
.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({OpsItemId: '', AssociationType: '', ResourceType: '', ResourceUri: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.AssociateOpsItemRelatedItem',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OpsItemId: '', AssociationType: '', ResourceType: '', ResourceUri: ''},
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=AmazonSSM.AssociateOpsItemRelatedItem');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OpsItemId: '',
AssociationType: '',
ResourceType: '',
ResourceUri: ''
});
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=AmazonSSM.AssociateOpsItemRelatedItem',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OpsItemId: '', AssociationType: '', ResourceType: '', ResourceUri: ''}
};
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=AmazonSSM.AssociateOpsItemRelatedItem';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OpsItemId":"","AssociationType":"","ResourceType":"","ResourceUri":""}'
};
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 = @{ @"OpsItemId": @"",
@"AssociationType": @"",
@"ResourceType": @"",
@"ResourceUri": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.AssociateOpsItemRelatedItem"]
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=AmazonSSM.AssociateOpsItemRelatedItem" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OpsItemId\": \"\",\n \"AssociationType\": \"\",\n \"ResourceType\": \"\",\n \"ResourceUri\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.AssociateOpsItemRelatedItem",
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([
'OpsItemId' => '',
'AssociationType' => '',
'ResourceType' => '',
'ResourceUri' => ''
]),
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=AmazonSSM.AssociateOpsItemRelatedItem', [
'body' => '{
"OpsItemId": "",
"AssociationType": "",
"ResourceType": "",
"ResourceUri": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.AssociateOpsItemRelatedItem');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OpsItemId' => '',
'AssociationType' => '',
'ResourceType' => '',
'ResourceUri' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OpsItemId' => '',
'AssociationType' => '',
'ResourceType' => '',
'ResourceUri' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.AssociateOpsItemRelatedItem');
$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=AmazonSSM.AssociateOpsItemRelatedItem' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OpsItemId": "",
"AssociationType": "",
"ResourceType": "",
"ResourceUri": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.AssociateOpsItemRelatedItem' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OpsItemId": "",
"AssociationType": "",
"ResourceType": "",
"ResourceUri": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OpsItemId\": \"\",\n \"AssociationType\": \"\",\n \"ResourceType\": \"\",\n \"ResourceUri\": \"\"\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=AmazonSSM.AssociateOpsItemRelatedItem"
payload = {
"OpsItemId": "",
"AssociationType": "",
"ResourceType": "",
"ResourceUri": ""
}
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=AmazonSSM.AssociateOpsItemRelatedItem"
payload <- "{\n \"OpsItemId\": \"\",\n \"AssociationType\": \"\",\n \"ResourceType\": \"\",\n \"ResourceUri\": \"\"\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=AmazonSSM.AssociateOpsItemRelatedItem")
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 \"OpsItemId\": \"\",\n \"AssociationType\": \"\",\n \"ResourceType\": \"\",\n \"ResourceUri\": \"\"\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 \"OpsItemId\": \"\",\n \"AssociationType\": \"\",\n \"ResourceType\": \"\",\n \"ResourceUri\": \"\"\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=AmazonSSM.AssociateOpsItemRelatedItem";
let payload = json!({
"OpsItemId": "",
"AssociationType": "",
"ResourceType": "",
"ResourceUri": ""
});
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=AmazonSSM.AssociateOpsItemRelatedItem' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OpsItemId": "",
"AssociationType": "",
"ResourceType": "",
"ResourceUri": ""
}'
echo '{
"OpsItemId": "",
"AssociationType": "",
"ResourceType": "",
"ResourceUri": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.AssociateOpsItemRelatedItem' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OpsItemId": "",\n "AssociationType": "",\n "ResourceType": "",\n "ResourceUri": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.AssociateOpsItemRelatedItem'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OpsItemId": "",
"AssociationType": "",
"ResourceType": "",
"ResourceUri": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.AssociateOpsItemRelatedItem")! 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
CancelCommand
{{baseUrl}}/#X-Amz-Target=AmazonSSM.CancelCommand
HEADERS
X-Amz-Target
BODY json
{
"CommandId": "",
"InstanceIds": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CancelCommand");
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 \"CommandId\": \"\",\n \"InstanceIds\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CancelCommand" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:CommandId ""
:InstanceIds ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CancelCommand"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"CommandId\": \"\",\n \"InstanceIds\": \"\"\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=AmazonSSM.CancelCommand"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"CommandId\": \"\",\n \"InstanceIds\": \"\"\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=AmazonSSM.CancelCommand");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"CommandId\": \"\",\n \"InstanceIds\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CancelCommand"
payload := strings.NewReader("{\n \"CommandId\": \"\",\n \"InstanceIds\": \"\"\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
{
"CommandId": "",
"InstanceIds": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CancelCommand")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"CommandId\": \"\",\n \"InstanceIds\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.CancelCommand"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"CommandId\": \"\",\n \"InstanceIds\": \"\"\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 \"CommandId\": \"\",\n \"InstanceIds\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.CancelCommand")
.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=AmazonSSM.CancelCommand")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"CommandId\": \"\",\n \"InstanceIds\": \"\"\n}")
.asString();
const data = JSON.stringify({
CommandId: '',
InstanceIds: ''
});
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=AmazonSSM.CancelCommand');
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=AmazonSSM.CancelCommand',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {CommandId: '', InstanceIds: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CancelCommand';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"CommandId":"","InstanceIds":""}'
};
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=AmazonSSM.CancelCommand',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "CommandId": "",\n "InstanceIds": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"CommandId\": \"\",\n \"InstanceIds\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.CancelCommand")
.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({CommandId: '', InstanceIds: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CancelCommand',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {CommandId: '', InstanceIds: ''},
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=AmazonSSM.CancelCommand');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
CommandId: '',
InstanceIds: ''
});
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=AmazonSSM.CancelCommand',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {CommandId: '', InstanceIds: ''}
};
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=AmazonSSM.CancelCommand';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"CommandId":"","InstanceIds":""}'
};
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 = @{ @"CommandId": @"",
@"InstanceIds": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.CancelCommand"]
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=AmazonSSM.CancelCommand" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"CommandId\": \"\",\n \"InstanceIds\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.CancelCommand",
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([
'CommandId' => '',
'InstanceIds' => ''
]),
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=AmazonSSM.CancelCommand', [
'body' => '{
"CommandId": "",
"InstanceIds": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.CancelCommand');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'CommandId' => '',
'InstanceIds' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'CommandId' => '',
'InstanceIds' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.CancelCommand');
$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=AmazonSSM.CancelCommand' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"CommandId": "",
"InstanceIds": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CancelCommand' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"CommandId": "",
"InstanceIds": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"CommandId\": \"\",\n \"InstanceIds\": \"\"\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=AmazonSSM.CancelCommand"
payload = {
"CommandId": "",
"InstanceIds": ""
}
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=AmazonSSM.CancelCommand"
payload <- "{\n \"CommandId\": \"\",\n \"InstanceIds\": \"\"\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=AmazonSSM.CancelCommand")
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 \"CommandId\": \"\",\n \"InstanceIds\": \"\"\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 \"CommandId\": \"\",\n \"InstanceIds\": \"\"\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=AmazonSSM.CancelCommand";
let payload = json!({
"CommandId": "",
"InstanceIds": ""
});
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=AmazonSSM.CancelCommand' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"CommandId": "",
"InstanceIds": ""
}'
echo '{
"CommandId": "",
"InstanceIds": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CancelCommand' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "CommandId": "",\n "InstanceIds": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CancelCommand'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"CommandId": "",
"InstanceIds": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CancelCommand")! 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
CancelMaintenanceWindowExecution
{{baseUrl}}/#X-Amz-Target=AmazonSSM.CancelMaintenanceWindowExecution
HEADERS
X-Amz-Target
BODY json
{
"WindowExecutionId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CancelMaintenanceWindowExecution");
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 \"WindowExecutionId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CancelMaintenanceWindowExecution" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:WindowExecutionId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CancelMaintenanceWindowExecution"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"WindowExecutionId\": \"\"\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=AmazonSSM.CancelMaintenanceWindowExecution"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"WindowExecutionId\": \"\"\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=AmazonSSM.CancelMaintenanceWindowExecution");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"WindowExecutionId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CancelMaintenanceWindowExecution"
payload := strings.NewReader("{\n \"WindowExecutionId\": \"\"\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
{
"WindowExecutionId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CancelMaintenanceWindowExecution")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"WindowExecutionId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.CancelMaintenanceWindowExecution"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"WindowExecutionId\": \"\"\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 \"WindowExecutionId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.CancelMaintenanceWindowExecution")
.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=AmazonSSM.CancelMaintenanceWindowExecution")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"WindowExecutionId\": \"\"\n}")
.asString();
const data = JSON.stringify({
WindowExecutionId: ''
});
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=AmazonSSM.CancelMaintenanceWindowExecution');
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=AmazonSSM.CancelMaintenanceWindowExecution',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {WindowExecutionId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CancelMaintenanceWindowExecution';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowExecutionId":""}'
};
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=AmazonSSM.CancelMaintenanceWindowExecution',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "WindowExecutionId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"WindowExecutionId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.CancelMaintenanceWindowExecution")
.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({WindowExecutionId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CancelMaintenanceWindowExecution',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {WindowExecutionId: ''},
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=AmazonSSM.CancelMaintenanceWindowExecution');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
WindowExecutionId: ''
});
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=AmazonSSM.CancelMaintenanceWindowExecution',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {WindowExecutionId: ''}
};
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=AmazonSSM.CancelMaintenanceWindowExecution';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowExecutionId":""}'
};
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 = @{ @"WindowExecutionId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.CancelMaintenanceWindowExecution"]
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=AmazonSSM.CancelMaintenanceWindowExecution" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"WindowExecutionId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.CancelMaintenanceWindowExecution",
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([
'WindowExecutionId' => ''
]),
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=AmazonSSM.CancelMaintenanceWindowExecution', [
'body' => '{
"WindowExecutionId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.CancelMaintenanceWindowExecution');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'WindowExecutionId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'WindowExecutionId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.CancelMaintenanceWindowExecution');
$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=AmazonSSM.CancelMaintenanceWindowExecution' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowExecutionId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CancelMaintenanceWindowExecution' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowExecutionId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"WindowExecutionId\": \"\"\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=AmazonSSM.CancelMaintenanceWindowExecution"
payload = { "WindowExecutionId": "" }
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=AmazonSSM.CancelMaintenanceWindowExecution"
payload <- "{\n \"WindowExecutionId\": \"\"\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=AmazonSSM.CancelMaintenanceWindowExecution")
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 \"WindowExecutionId\": \"\"\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 \"WindowExecutionId\": \"\"\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=AmazonSSM.CancelMaintenanceWindowExecution";
let payload = json!({"WindowExecutionId": ""});
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=AmazonSSM.CancelMaintenanceWindowExecution' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"WindowExecutionId": ""
}'
echo '{
"WindowExecutionId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CancelMaintenanceWindowExecution' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "WindowExecutionId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CancelMaintenanceWindowExecution'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["WindowExecutionId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CancelMaintenanceWindowExecution")! 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
CreateActivation
{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateActivation
HEADERS
X-Amz-Target
BODY json
{
"Description": "",
"DefaultInstanceName": "",
"IamRole": "",
"RegistrationLimit": "",
"ExpirationDate": "",
"Tags": "",
"RegistrationMetadata": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateActivation");
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 \"Description\": \"\",\n \"DefaultInstanceName\": \"\",\n \"IamRole\": \"\",\n \"RegistrationLimit\": \"\",\n \"ExpirationDate\": \"\",\n \"Tags\": \"\",\n \"RegistrationMetadata\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateActivation" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Description ""
:DefaultInstanceName ""
:IamRole ""
:RegistrationLimit ""
:ExpirationDate ""
:Tags ""
:RegistrationMetadata ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateActivation"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Description\": \"\",\n \"DefaultInstanceName\": \"\",\n \"IamRole\": \"\",\n \"RegistrationLimit\": \"\",\n \"ExpirationDate\": \"\",\n \"Tags\": \"\",\n \"RegistrationMetadata\": \"\"\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=AmazonSSM.CreateActivation"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Description\": \"\",\n \"DefaultInstanceName\": \"\",\n \"IamRole\": \"\",\n \"RegistrationLimit\": \"\",\n \"ExpirationDate\": \"\",\n \"Tags\": \"\",\n \"RegistrationMetadata\": \"\"\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=AmazonSSM.CreateActivation");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Description\": \"\",\n \"DefaultInstanceName\": \"\",\n \"IamRole\": \"\",\n \"RegistrationLimit\": \"\",\n \"ExpirationDate\": \"\",\n \"Tags\": \"\",\n \"RegistrationMetadata\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateActivation"
payload := strings.NewReader("{\n \"Description\": \"\",\n \"DefaultInstanceName\": \"\",\n \"IamRole\": \"\",\n \"RegistrationLimit\": \"\",\n \"ExpirationDate\": \"\",\n \"Tags\": \"\",\n \"RegistrationMetadata\": \"\"\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: 164
{
"Description": "",
"DefaultInstanceName": "",
"IamRole": "",
"RegistrationLimit": "",
"ExpirationDate": "",
"Tags": "",
"RegistrationMetadata": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateActivation")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Description\": \"\",\n \"DefaultInstanceName\": \"\",\n \"IamRole\": \"\",\n \"RegistrationLimit\": \"\",\n \"ExpirationDate\": \"\",\n \"Tags\": \"\",\n \"RegistrationMetadata\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateActivation"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Description\": \"\",\n \"DefaultInstanceName\": \"\",\n \"IamRole\": \"\",\n \"RegistrationLimit\": \"\",\n \"ExpirationDate\": \"\",\n \"Tags\": \"\",\n \"RegistrationMetadata\": \"\"\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 \"Description\": \"\",\n \"DefaultInstanceName\": \"\",\n \"IamRole\": \"\",\n \"RegistrationLimit\": \"\",\n \"ExpirationDate\": \"\",\n \"Tags\": \"\",\n \"RegistrationMetadata\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateActivation")
.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=AmazonSSM.CreateActivation")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Description\": \"\",\n \"DefaultInstanceName\": \"\",\n \"IamRole\": \"\",\n \"RegistrationLimit\": \"\",\n \"ExpirationDate\": \"\",\n \"Tags\": \"\",\n \"RegistrationMetadata\": \"\"\n}")
.asString();
const data = JSON.stringify({
Description: '',
DefaultInstanceName: '',
IamRole: '',
RegistrationLimit: '',
ExpirationDate: '',
Tags: '',
RegistrationMetadata: ''
});
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=AmazonSSM.CreateActivation');
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=AmazonSSM.CreateActivation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Description: '',
DefaultInstanceName: '',
IamRole: '',
RegistrationLimit: '',
ExpirationDate: '',
Tags: '',
RegistrationMetadata: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateActivation';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Description":"","DefaultInstanceName":"","IamRole":"","RegistrationLimit":"","ExpirationDate":"","Tags":"","RegistrationMetadata":""}'
};
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=AmazonSSM.CreateActivation',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Description": "",\n "DefaultInstanceName": "",\n "IamRole": "",\n "RegistrationLimit": "",\n "ExpirationDate": "",\n "Tags": "",\n "RegistrationMetadata": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Description\": \"\",\n \"DefaultInstanceName\": \"\",\n \"IamRole\": \"\",\n \"RegistrationLimit\": \"\",\n \"ExpirationDate\": \"\",\n \"Tags\": \"\",\n \"RegistrationMetadata\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateActivation")
.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({
Description: '',
DefaultInstanceName: '',
IamRole: '',
RegistrationLimit: '',
ExpirationDate: '',
Tags: '',
RegistrationMetadata: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateActivation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
Description: '',
DefaultInstanceName: '',
IamRole: '',
RegistrationLimit: '',
ExpirationDate: '',
Tags: '',
RegistrationMetadata: ''
},
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=AmazonSSM.CreateActivation');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Description: '',
DefaultInstanceName: '',
IamRole: '',
RegistrationLimit: '',
ExpirationDate: '',
Tags: '',
RegistrationMetadata: ''
});
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=AmazonSSM.CreateActivation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Description: '',
DefaultInstanceName: '',
IamRole: '',
RegistrationLimit: '',
ExpirationDate: '',
Tags: '',
RegistrationMetadata: ''
}
};
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=AmazonSSM.CreateActivation';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Description":"","DefaultInstanceName":"","IamRole":"","RegistrationLimit":"","ExpirationDate":"","Tags":"","RegistrationMetadata":""}'
};
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 = @{ @"Description": @"",
@"DefaultInstanceName": @"",
@"IamRole": @"",
@"RegistrationLimit": @"",
@"ExpirationDate": @"",
@"Tags": @"",
@"RegistrationMetadata": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateActivation"]
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=AmazonSSM.CreateActivation" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Description\": \"\",\n \"DefaultInstanceName\": \"\",\n \"IamRole\": \"\",\n \"RegistrationLimit\": \"\",\n \"ExpirationDate\": \"\",\n \"Tags\": \"\",\n \"RegistrationMetadata\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateActivation",
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([
'Description' => '',
'DefaultInstanceName' => '',
'IamRole' => '',
'RegistrationLimit' => '',
'ExpirationDate' => '',
'Tags' => '',
'RegistrationMetadata' => ''
]),
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=AmazonSSM.CreateActivation', [
'body' => '{
"Description": "",
"DefaultInstanceName": "",
"IamRole": "",
"RegistrationLimit": "",
"ExpirationDate": "",
"Tags": "",
"RegistrationMetadata": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateActivation');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Description' => '',
'DefaultInstanceName' => '',
'IamRole' => '',
'RegistrationLimit' => '',
'ExpirationDate' => '',
'Tags' => '',
'RegistrationMetadata' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Description' => '',
'DefaultInstanceName' => '',
'IamRole' => '',
'RegistrationLimit' => '',
'ExpirationDate' => '',
'Tags' => '',
'RegistrationMetadata' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateActivation');
$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=AmazonSSM.CreateActivation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Description": "",
"DefaultInstanceName": "",
"IamRole": "",
"RegistrationLimit": "",
"ExpirationDate": "",
"Tags": "",
"RegistrationMetadata": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateActivation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Description": "",
"DefaultInstanceName": "",
"IamRole": "",
"RegistrationLimit": "",
"ExpirationDate": "",
"Tags": "",
"RegistrationMetadata": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Description\": \"\",\n \"DefaultInstanceName\": \"\",\n \"IamRole\": \"\",\n \"RegistrationLimit\": \"\",\n \"ExpirationDate\": \"\",\n \"Tags\": \"\",\n \"RegistrationMetadata\": \"\"\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=AmazonSSM.CreateActivation"
payload = {
"Description": "",
"DefaultInstanceName": "",
"IamRole": "",
"RegistrationLimit": "",
"ExpirationDate": "",
"Tags": "",
"RegistrationMetadata": ""
}
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=AmazonSSM.CreateActivation"
payload <- "{\n \"Description\": \"\",\n \"DefaultInstanceName\": \"\",\n \"IamRole\": \"\",\n \"RegistrationLimit\": \"\",\n \"ExpirationDate\": \"\",\n \"Tags\": \"\",\n \"RegistrationMetadata\": \"\"\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=AmazonSSM.CreateActivation")
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 \"Description\": \"\",\n \"DefaultInstanceName\": \"\",\n \"IamRole\": \"\",\n \"RegistrationLimit\": \"\",\n \"ExpirationDate\": \"\",\n \"Tags\": \"\",\n \"RegistrationMetadata\": \"\"\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 \"Description\": \"\",\n \"DefaultInstanceName\": \"\",\n \"IamRole\": \"\",\n \"RegistrationLimit\": \"\",\n \"ExpirationDate\": \"\",\n \"Tags\": \"\",\n \"RegistrationMetadata\": \"\"\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=AmazonSSM.CreateActivation";
let payload = json!({
"Description": "",
"DefaultInstanceName": "",
"IamRole": "",
"RegistrationLimit": "",
"ExpirationDate": "",
"Tags": "",
"RegistrationMetadata": ""
});
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=AmazonSSM.CreateActivation' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Description": "",
"DefaultInstanceName": "",
"IamRole": "",
"RegistrationLimit": "",
"ExpirationDate": "",
"Tags": "",
"RegistrationMetadata": ""
}'
echo '{
"Description": "",
"DefaultInstanceName": "",
"IamRole": "",
"RegistrationLimit": "",
"ExpirationDate": "",
"Tags": "",
"RegistrationMetadata": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateActivation' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Description": "",\n "DefaultInstanceName": "",\n "IamRole": "",\n "RegistrationLimit": "",\n "ExpirationDate": "",\n "Tags": "",\n "RegistrationMetadata": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateActivation'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Description": "",
"DefaultInstanceName": "",
"IamRole": "",
"RegistrationLimit": "",
"ExpirationDate": "",
"Tags": "",
"RegistrationMetadata": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateActivation")! 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
CreateAssociation
{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateAssociation
HEADERS
X-Amz-Target
BODY json
{
"Name": "",
"DocumentVersion": "",
"InstanceId": "",
"Parameters": "",
"Targets": "",
"ScheduleExpression": "",
"OutputLocation": "",
"AssociationName": "",
"AutomationTargetParameterName": "",
"MaxErrors": "",
"MaxConcurrency": "",
"ComplianceSeverity": "",
"SyncCompliance": "",
"ApplyOnlyAtCronInterval": "",
"CalendarNames": "",
"TargetLocations": "",
"ScheduleOffset": "",
"TargetMaps": "",
"Tags": "",
"AlarmConfiguration": {
"IgnorePollAlarmFailure": "",
"Alarms": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateAssociation");
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 \"DocumentVersion\": \"\",\n \"InstanceId\": \"\",\n \"Parameters\": \"\",\n \"Targets\": \"\",\n \"ScheduleExpression\": \"\",\n \"OutputLocation\": \"\",\n \"AssociationName\": \"\",\n \"AutomationTargetParameterName\": \"\",\n \"MaxErrors\": \"\",\n \"MaxConcurrency\": \"\",\n \"ComplianceSeverity\": \"\",\n \"SyncCompliance\": \"\",\n \"ApplyOnlyAtCronInterval\": \"\",\n \"CalendarNames\": \"\",\n \"TargetLocations\": \"\",\n \"ScheduleOffset\": \"\",\n \"TargetMaps\": \"\",\n \"Tags\": \"\",\n \"AlarmConfiguration\": {\n \"IgnorePollAlarmFailure\": \"\",\n \"Alarms\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateAssociation" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Name ""
:DocumentVersion ""
:InstanceId ""
:Parameters ""
:Targets ""
:ScheduleExpression ""
:OutputLocation ""
:AssociationName ""
:AutomationTargetParameterName ""
:MaxErrors ""
:MaxConcurrency ""
:ComplianceSeverity ""
:SyncCompliance ""
:ApplyOnlyAtCronInterval ""
:CalendarNames ""
:TargetLocations ""
:ScheduleOffset ""
:TargetMaps ""
:Tags ""
:AlarmConfiguration {:IgnorePollAlarmFailure ""
:Alarms ""}}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateAssociation"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"InstanceId\": \"\",\n \"Parameters\": \"\",\n \"Targets\": \"\",\n \"ScheduleExpression\": \"\",\n \"OutputLocation\": \"\",\n \"AssociationName\": \"\",\n \"AutomationTargetParameterName\": \"\",\n \"MaxErrors\": \"\",\n \"MaxConcurrency\": \"\",\n \"ComplianceSeverity\": \"\",\n \"SyncCompliance\": \"\",\n \"ApplyOnlyAtCronInterval\": \"\",\n \"CalendarNames\": \"\",\n \"TargetLocations\": \"\",\n \"ScheduleOffset\": \"\",\n \"TargetMaps\": \"\",\n \"Tags\": \"\",\n \"AlarmConfiguration\": {\n \"IgnorePollAlarmFailure\": \"\",\n \"Alarms\": \"\"\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=AmazonSSM.CreateAssociation"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"InstanceId\": \"\",\n \"Parameters\": \"\",\n \"Targets\": \"\",\n \"ScheduleExpression\": \"\",\n \"OutputLocation\": \"\",\n \"AssociationName\": \"\",\n \"AutomationTargetParameterName\": \"\",\n \"MaxErrors\": \"\",\n \"MaxConcurrency\": \"\",\n \"ComplianceSeverity\": \"\",\n \"SyncCompliance\": \"\",\n \"ApplyOnlyAtCronInterval\": \"\",\n \"CalendarNames\": \"\",\n \"TargetLocations\": \"\",\n \"ScheduleOffset\": \"\",\n \"TargetMaps\": \"\",\n \"Tags\": \"\",\n \"AlarmConfiguration\": {\n \"IgnorePollAlarmFailure\": \"\",\n \"Alarms\": \"\"\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=AmazonSSM.CreateAssociation");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"InstanceId\": \"\",\n \"Parameters\": \"\",\n \"Targets\": \"\",\n \"ScheduleExpression\": \"\",\n \"OutputLocation\": \"\",\n \"AssociationName\": \"\",\n \"AutomationTargetParameterName\": \"\",\n \"MaxErrors\": \"\",\n \"MaxConcurrency\": \"\",\n \"ComplianceSeverity\": \"\",\n \"SyncCompliance\": \"\",\n \"ApplyOnlyAtCronInterval\": \"\",\n \"CalendarNames\": \"\",\n \"TargetLocations\": \"\",\n \"ScheduleOffset\": \"\",\n \"TargetMaps\": \"\",\n \"Tags\": \"\",\n \"AlarmConfiguration\": {\n \"IgnorePollAlarmFailure\": \"\",\n \"Alarms\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateAssociation"
payload := strings.NewReader("{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"InstanceId\": \"\",\n \"Parameters\": \"\",\n \"Targets\": \"\",\n \"ScheduleExpression\": \"\",\n \"OutputLocation\": \"\",\n \"AssociationName\": \"\",\n \"AutomationTargetParameterName\": \"\",\n \"MaxErrors\": \"\",\n \"MaxConcurrency\": \"\",\n \"ComplianceSeverity\": \"\",\n \"SyncCompliance\": \"\",\n \"ApplyOnlyAtCronInterval\": \"\",\n \"CalendarNames\": \"\",\n \"TargetLocations\": \"\",\n \"ScheduleOffset\": \"\",\n \"TargetMaps\": \"\",\n \"Tags\": \"\",\n \"AlarmConfiguration\": {\n \"IgnorePollAlarmFailure\": \"\",\n \"Alarms\": \"\"\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: 530
{
"Name": "",
"DocumentVersion": "",
"InstanceId": "",
"Parameters": "",
"Targets": "",
"ScheduleExpression": "",
"OutputLocation": "",
"AssociationName": "",
"AutomationTargetParameterName": "",
"MaxErrors": "",
"MaxConcurrency": "",
"ComplianceSeverity": "",
"SyncCompliance": "",
"ApplyOnlyAtCronInterval": "",
"CalendarNames": "",
"TargetLocations": "",
"ScheduleOffset": "",
"TargetMaps": "",
"Tags": "",
"AlarmConfiguration": {
"IgnorePollAlarmFailure": "",
"Alarms": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateAssociation")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"InstanceId\": \"\",\n \"Parameters\": \"\",\n \"Targets\": \"\",\n \"ScheduleExpression\": \"\",\n \"OutputLocation\": \"\",\n \"AssociationName\": \"\",\n \"AutomationTargetParameterName\": \"\",\n \"MaxErrors\": \"\",\n \"MaxConcurrency\": \"\",\n \"ComplianceSeverity\": \"\",\n \"SyncCompliance\": \"\",\n \"ApplyOnlyAtCronInterval\": \"\",\n \"CalendarNames\": \"\",\n \"TargetLocations\": \"\",\n \"ScheduleOffset\": \"\",\n \"TargetMaps\": \"\",\n \"Tags\": \"\",\n \"AlarmConfiguration\": {\n \"IgnorePollAlarmFailure\": \"\",\n \"Alarms\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateAssociation"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"InstanceId\": \"\",\n \"Parameters\": \"\",\n \"Targets\": \"\",\n \"ScheduleExpression\": \"\",\n \"OutputLocation\": \"\",\n \"AssociationName\": \"\",\n \"AutomationTargetParameterName\": \"\",\n \"MaxErrors\": \"\",\n \"MaxConcurrency\": \"\",\n \"ComplianceSeverity\": \"\",\n \"SyncCompliance\": \"\",\n \"ApplyOnlyAtCronInterval\": \"\",\n \"CalendarNames\": \"\",\n \"TargetLocations\": \"\",\n \"ScheduleOffset\": \"\",\n \"TargetMaps\": \"\",\n \"Tags\": \"\",\n \"AlarmConfiguration\": {\n \"IgnorePollAlarmFailure\": \"\",\n \"Alarms\": \"\"\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 \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"InstanceId\": \"\",\n \"Parameters\": \"\",\n \"Targets\": \"\",\n \"ScheduleExpression\": \"\",\n \"OutputLocation\": \"\",\n \"AssociationName\": \"\",\n \"AutomationTargetParameterName\": \"\",\n \"MaxErrors\": \"\",\n \"MaxConcurrency\": \"\",\n \"ComplianceSeverity\": \"\",\n \"SyncCompliance\": \"\",\n \"ApplyOnlyAtCronInterval\": \"\",\n \"CalendarNames\": \"\",\n \"TargetLocations\": \"\",\n \"ScheduleOffset\": \"\",\n \"TargetMaps\": \"\",\n \"Tags\": \"\",\n \"AlarmConfiguration\": {\n \"IgnorePollAlarmFailure\": \"\",\n \"Alarms\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateAssociation")
.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=AmazonSSM.CreateAssociation")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"InstanceId\": \"\",\n \"Parameters\": \"\",\n \"Targets\": \"\",\n \"ScheduleExpression\": \"\",\n \"OutputLocation\": \"\",\n \"AssociationName\": \"\",\n \"AutomationTargetParameterName\": \"\",\n \"MaxErrors\": \"\",\n \"MaxConcurrency\": \"\",\n \"ComplianceSeverity\": \"\",\n \"SyncCompliance\": \"\",\n \"ApplyOnlyAtCronInterval\": \"\",\n \"CalendarNames\": \"\",\n \"TargetLocations\": \"\",\n \"ScheduleOffset\": \"\",\n \"TargetMaps\": \"\",\n \"Tags\": \"\",\n \"AlarmConfiguration\": {\n \"IgnorePollAlarmFailure\": \"\",\n \"Alarms\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
Name: '',
DocumentVersion: '',
InstanceId: '',
Parameters: '',
Targets: '',
ScheduleExpression: '',
OutputLocation: '',
AssociationName: '',
AutomationTargetParameterName: '',
MaxErrors: '',
MaxConcurrency: '',
ComplianceSeverity: '',
SyncCompliance: '',
ApplyOnlyAtCronInterval: '',
CalendarNames: '',
TargetLocations: '',
ScheduleOffset: '',
TargetMaps: '',
Tags: '',
AlarmConfiguration: {
IgnorePollAlarmFailure: '',
Alarms: ''
}
});
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=AmazonSSM.CreateAssociation');
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=AmazonSSM.CreateAssociation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Name: '',
DocumentVersion: '',
InstanceId: '',
Parameters: '',
Targets: '',
ScheduleExpression: '',
OutputLocation: '',
AssociationName: '',
AutomationTargetParameterName: '',
MaxErrors: '',
MaxConcurrency: '',
ComplianceSeverity: '',
SyncCompliance: '',
ApplyOnlyAtCronInterval: '',
CalendarNames: '',
TargetLocations: '',
ScheduleOffset: '',
TargetMaps: '',
Tags: '',
AlarmConfiguration: {IgnorePollAlarmFailure: '', Alarms: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateAssociation';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","DocumentVersion":"","InstanceId":"","Parameters":"","Targets":"","ScheduleExpression":"","OutputLocation":"","AssociationName":"","AutomationTargetParameterName":"","MaxErrors":"","MaxConcurrency":"","ComplianceSeverity":"","SyncCompliance":"","ApplyOnlyAtCronInterval":"","CalendarNames":"","TargetLocations":"","ScheduleOffset":"","TargetMaps":"","Tags":"","AlarmConfiguration":{"IgnorePollAlarmFailure":"","Alarms":""}}'
};
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=AmazonSSM.CreateAssociation',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Name": "",\n "DocumentVersion": "",\n "InstanceId": "",\n "Parameters": "",\n "Targets": "",\n "ScheduleExpression": "",\n "OutputLocation": "",\n "AssociationName": "",\n "AutomationTargetParameterName": "",\n "MaxErrors": "",\n "MaxConcurrency": "",\n "ComplianceSeverity": "",\n "SyncCompliance": "",\n "ApplyOnlyAtCronInterval": "",\n "CalendarNames": "",\n "TargetLocations": "",\n "ScheduleOffset": "",\n "TargetMaps": "",\n "Tags": "",\n "AlarmConfiguration": {\n "IgnorePollAlarmFailure": "",\n "Alarms": ""\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 \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"InstanceId\": \"\",\n \"Parameters\": \"\",\n \"Targets\": \"\",\n \"ScheduleExpression\": \"\",\n \"OutputLocation\": \"\",\n \"AssociationName\": \"\",\n \"AutomationTargetParameterName\": \"\",\n \"MaxErrors\": \"\",\n \"MaxConcurrency\": \"\",\n \"ComplianceSeverity\": \"\",\n \"SyncCompliance\": \"\",\n \"ApplyOnlyAtCronInterval\": \"\",\n \"CalendarNames\": \"\",\n \"TargetLocations\": \"\",\n \"ScheduleOffset\": \"\",\n \"TargetMaps\": \"\",\n \"Tags\": \"\",\n \"AlarmConfiguration\": {\n \"IgnorePollAlarmFailure\": \"\",\n \"Alarms\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateAssociation")
.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: '',
DocumentVersion: '',
InstanceId: '',
Parameters: '',
Targets: '',
ScheduleExpression: '',
OutputLocation: '',
AssociationName: '',
AutomationTargetParameterName: '',
MaxErrors: '',
MaxConcurrency: '',
ComplianceSeverity: '',
SyncCompliance: '',
ApplyOnlyAtCronInterval: '',
CalendarNames: '',
TargetLocations: '',
ScheduleOffset: '',
TargetMaps: '',
Tags: '',
AlarmConfiguration: {IgnorePollAlarmFailure: '', Alarms: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateAssociation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
Name: '',
DocumentVersion: '',
InstanceId: '',
Parameters: '',
Targets: '',
ScheduleExpression: '',
OutputLocation: '',
AssociationName: '',
AutomationTargetParameterName: '',
MaxErrors: '',
MaxConcurrency: '',
ComplianceSeverity: '',
SyncCompliance: '',
ApplyOnlyAtCronInterval: '',
CalendarNames: '',
TargetLocations: '',
ScheduleOffset: '',
TargetMaps: '',
Tags: '',
AlarmConfiguration: {IgnorePollAlarmFailure: '', Alarms: ''}
},
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=AmazonSSM.CreateAssociation');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Name: '',
DocumentVersion: '',
InstanceId: '',
Parameters: '',
Targets: '',
ScheduleExpression: '',
OutputLocation: '',
AssociationName: '',
AutomationTargetParameterName: '',
MaxErrors: '',
MaxConcurrency: '',
ComplianceSeverity: '',
SyncCompliance: '',
ApplyOnlyAtCronInterval: '',
CalendarNames: '',
TargetLocations: '',
ScheduleOffset: '',
TargetMaps: '',
Tags: '',
AlarmConfiguration: {
IgnorePollAlarmFailure: '',
Alarms: ''
}
});
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=AmazonSSM.CreateAssociation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Name: '',
DocumentVersion: '',
InstanceId: '',
Parameters: '',
Targets: '',
ScheduleExpression: '',
OutputLocation: '',
AssociationName: '',
AutomationTargetParameterName: '',
MaxErrors: '',
MaxConcurrency: '',
ComplianceSeverity: '',
SyncCompliance: '',
ApplyOnlyAtCronInterval: '',
CalendarNames: '',
TargetLocations: '',
ScheduleOffset: '',
TargetMaps: '',
Tags: '',
AlarmConfiguration: {IgnorePollAlarmFailure: '', Alarms: ''}
}
};
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=AmazonSSM.CreateAssociation';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","DocumentVersion":"","InstanceId":"","Parameters":"","Targets":"","ScheduleExpression":"","OutputLocation":"","AssociationName":"","AutomationTargetParameterName":"","MaxErrors":"","MaxConcurrency":"","ComplianceSeverity":"","SyncCompliance":"","ApplyOnlyAtCronInterval":"","CalendarNames":"","TargetLocations":"","ScheduleOffset":"","TargetMaps":"","Tags":"","AlarmConfiguration":{"IgnorePollAlarmFailure":"","Alarms":""}}'
};
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": @"",
@"DocumentVersion": @"",
@"InstanceId": @"",
@"Parameters": @"",
@"Targets": @"",
@"ScheduleExpression": @"",
@"OutputLocation": @"",
@"AssociationName": @"",
@"AutomationTargetParameterName": @"",
@"MaxErrors": @"",
@"MaxConcurrency": @"",
@"ComplianceSeverity": @"",
@"SyncCompliance": @"",
@"ApplyOnlyAtCronInterval": @"",
@"CalendarNames": @"",
@"TargetLocations": @"",
@"ScheduleOffset": @"",
@"TargetMaps": @"",
@"Tags": @"",
@"AlarmConfiguration": @{ @"IgnorePollAlarmFailure": @"", @"Alarms": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateAssociation"]
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=AmazonSSM.CreateAssociation" 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 \"DocumentVersion\": \"\",\n \"InstanceId\": \"\",\n \"Parameters\": \"\",\n \"Targets\": \"\",\n \"ScheduleExpression\": \"\",\n \"OutputLocation\": \"\",\n \"AssociationName\": \"\",\n \"AutomationTargetParameterName\": \"\",\n \"MaxErrors\": \"\",\n \"MaxConcurrency\": \"\",\n \"ComplianceSeverity\": \"\",\n \"SyncCompliance\": \"\",\n \"ApplyOnlyAtCronInterval\": \"\",\n \"CalendarNames\": \"\",\n \"TargetLocations\": \"\",\n \"ScheduleOffset\": \"\",\n \"TargetMaps\": \"\",\n \"Tags\": \"\",\n \"AlarmConfiguration\": {\n \"IgnorePollAlarmFailure\": \"\",\n \"Alarms\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateAssociation",
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' => '',
'DocumentVersion' => '',
'InstanceId' => '',
'Parameters' => '',
'Targets' => '',
'ScheduleExpression' => '',
'OutputLocation' => '',
'AssociationName' => '',
'AutomationTargetParameterName' => '',
'MaxErrors' => '',
'MaxConcurrency' => '',
'ComplianceSeverity' => '',
'SyncCompliance' => '',
'ApplyOnlyAtCronInterval' => '',
'CalendarNames' => '',
'TargetLocations' => '',
'ScheduleOffset' => '',
'TargetMaps' => '',
'Tags' => '',
'AlarmConfiguration' => [
'IgnorePollAlarmFailure' => '',
'Alarms' => ''
]
]),
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=AmazonSSM.CreateAssociation', [
'body' => '{
"Name": "",
"DocumentVersion": "",
"InstanceId": "",
"Parameters": "",
"Targets": "",
"ScheduleExpression": "",
"OutputLocation": "",
"AssociationName": "",
"AutomationTargetParameterName": "",
"MaxErrors": "",
"MaxConcurrency": "",
"ComplianceSeverity": "",
"SyncCompliance": "",
"ApplyOnlyAtCronInterval": "",
"CalendarNames": "",
"TargetLocations": "",
"ScheduleOffset": "",
"TargetMaps": "",
"Tags": "",
"AlarmConfiguration": {
"IgnorePollAlarmFailure": "",
"Alarms": ""
}
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateAssociation');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Name' => '',
'DocumentVersion' => '',
'InstanceId' => '',
'Parameters' => '',
'Targets' => '',
'ScheduleExpression' => '',
'OutputLocation' => '',
'AssociationName' => '',
'AutomationTargetParameterName' => '',
'MaxErrors' => '',
'MaxConcurrency' => '',
'ComplianceSeverity' => '',
'SyncCompliance' => '',
'ApplyOnlyAtCronInterval' => '',
'CalendarNames' => '',
'TargetLocations' => '',
'ScheduleOffset' => '',
'TargetMaps' => '',
'Tags' => '',
'AlarmConfiguration' => [
'IgnorePollAlarmFailure' => '',
'Alarms' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Name' => '',
'DocumentVersion' => '',
'InstanceId' => '',
'Parameters' => '',
'Targets' => '',
'ScheduleExpression' => '',
'OutputLocation' => '',
'AssociationName' => '',
'AutomationTargetParameterName' => '',
'MaxErrors' => '',
'MaxConcurrency' => '',
'ComplianceSeverity' => '',
'SyncCompliance' => '',
'ApplyOnlyAtCronInterval' => '',
'CalendarNames' => '',
'TargetLocations' => '',
'ScheduleOffset' => '',
'TargetMaps' => '',
'Tags' => '',
'AlarmConfiguration' => [
'IgnorePollAlarmFailure' => '',
'Alarms' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateAssociation');
$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=AmazonSSM.CreateAssociation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"DocumentVersion": "",
"InstanceId": "",
"Parameters": "",
"Targets": "",
"ScheduleExpression": "",
"OutputLocation": "",
"AssociationName": "",
"AutomationTargetParameterName": "",
"MaxErrors": "",
"MaxConcurrency": "",
"ComplianceSeverity": "",
"SyncCompliance": "",
"ApplyOnlyAtCronInterval": "",
"CalendarNames": "",
"TargetLocations": "",
"ScheduleOffset": "",
"TargetMaps": "",
"Tags": "",
"AlarmConfiguration": {
"IgnorePollAlarmFailure": "",
"Alarms": ""
}
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateAssociation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"DocumentVersion": "",
"InstanceId": "",
"Parameters": "",
"Targets": "",
"ScheduleExpression": "",
"OutputLocation": "",
"AssociationName": "",
"AutomationTargetParameterName": "",
"MaxErrors": "",
"MaxConcurrency": "",
"ComplianceSeverity": "",
"SyncCompliance": "",
"ApplyOnlyAtCronInterval": "",
"CalendarNames": "",
"TargetLocations": "",
"ScheduleOffset": "",
"TargetMaps": "",
"Tags": "",
"AlarmConfiguration": {
"IgnorePollAlarmFailure": "",
"Alarms": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"InstanceId\": \"\",\n \"Parameters\": \"\",\n \"Targets\": \"\",\n \"ScheduleExpression\": \"\",\n \"OutputLocation\": \"\",\n \"AssociationName\": \"\",\n \"AutomationTargetParameterName\": \"\",\n \"MaxErrors\": \"\",\n \"MaxConcurrency\": \"\",\n \"ComplianceSeverity\": \"\",\n \"SyncCompliance\": \"\",\n \"ApplyOnlyAtCronInterval\": \"\",\n \"CalendarNames\": \"\",\n \"TargetLocations\": \"\",\n \"ScheduleOffset\": \"\",\n \"TargetMaps\": \"\",\n \"Tags\": \"\",\n \"AlarmConfiguration\": {\n \"IgnorePollAlarmFailure\": \"\",\n \"Alarms\": \"\"\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=AmazonSSM.CreateAssociation"
payload = {
"Name": "",
"DocumentVersion": "",
"InstanceId": "",
"Parameters": "",
"Targets": "",
"ScheduleExpression": "",
"OutputLocation": "",
"AssociationName": "",
"AutomationTargetParameterName": "",
"MaxErrors": "",
"MaxConcurrency": "",
"ComplianceSeverity": "",
"SyncCompliance": "",
"ApplyOnlyAtCronInterval": "",
"CalendarNames": "",
"TargetLocations": "",
"ScheduleOffset": "",
"TargetMaps": "",
"Tags": "",
"AlarmConfiguration": {
"IgnorePollAlarmFailure": "",
"Alarms": ""
}
}
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=AmazonSSM.CreateAssociation"
payload <- "{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"InstanceId\": \"\",\n \"Parameters\": \"\",\n \"Targets\": \"\",\n \"ScheduleExpression\": \"\",\n \"OutputLocation\": \"\",\n \"AssociationName\": \"\",\n \"AutomationTargetParameterName\": \"\",\n \"MaxErrors\": \"\",\n \"MaxConcurrency\": \"\",\n \"ComplianceSeverity\": \"\",\n \"SyncCompliance\": \"\",\n \"ApplyOnlyAtCronInterval\": \"\",\n \"CalendarNames\": \"\",\n \"TargetLocations\": \"\",\n \"ScheduleOffset\": \"\",\n \"TargetMaps\": \"\",\n \"Tags\": \"\",\n \"AlarmConfiguration\": {\n \"IgnorePollAlarmFailure\": \"\",\n \"Alarms\": \"\"\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=AmazonSSM.CreateAssociation")
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 \"DocumentVersion\": \"\",\n \"InstanceId\": \"\",\n \"Parameters\": \"\",\n \"Targets\": \"\",\n \"ScheduleExpression\": \"\",\n \"OutputLocation\": \"\",\n \"AssociationName\": \"\",\n \"AutomationTargetParameterName\": \"\",\n \"MaxErrors\": \"\",\n \"MaxConcurrency\": \"\",\n \"ComplianceSeverity\": \"\",\n \"SyncCompliance\": \"\",\n \"ApplyOnlyAtCronInterval\": \"\",\n \"CalendarNames\": \"\",\n \"TargetLocations\": \"\",\n \"ScheduleOffset\": \"\",\n \"TargetMaps\": \"\",\n \"Tags\": \"\",\n \"AlarmConfiguration\": {\n \"IgnorePollAlarmFailure\": \"\",\n \"Alarms\": \"\"\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 \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"InstanceId\": \"\",\n \"Parameters\": \"\",\n \"Targets\": \"\",\n \"ScheduleExpression\": \"\",\n \"OutputLocation\": \"\",\n \"AssociationName\": \"\",\n \"AutomationTargetParameterName\": \"\",\n \"MaxErrors\": \"\",\n \"MaxConcurrency\": \"\",\n \"ComplianceSeverity\": \"\",\n \"SyncCompliance\": \"\",\n \"ApplyOnlyAtCronInterval\": \"\",\n \"CalendarNames\": \"\",\n \"TargetLocations\": \"\",\n \"ScheduleOffset\": \"\",\n \"TargetMaps\": \"\",\n \"Tags\": \"\",\n \"AlarmConfiguration\": {\n \"IgnorePollAlarmFailure\": \"\",\n \"Alarms\": \"\"\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=AmazonSSM.CreateAssociation";
let payload = json!({
"Name": "",
"DocumentVersion": "",
"InstanceId": "",
"Parameters": "",
"Targets": "",
"ScheduleExpression": "",
"OutputLocation": "",
"AssociationName": "",
"AutomationTargetParameterName": "",
"MaxErrors": "",
"MaxConcurrency": "",
"ComplianceSeverity": "",
"SyncCompliance": "",
"ApplyOnlyAtCronInterval": "",
"CalendarNames": "",
"TargetLocations": "",
"ScheduleOffset": "",
"TargetMaps": "",
"Tags": "",
"AlarmConfiguration": json!({
"IgnorePollAlarmFailure": "",
"Alarms": ""
})
});
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=AmazonSSM.CreateAssociation' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Name": "",
"DocumentVersion": "",
"InstanceId": "",
"Parameters": "",
"Targets": "",
"ScheduleExpression": "",
"OutputLocation": "",
"AssociationName": "",
"AutomationTargetParameterName": "",
"MaxErrors": "",
"MaxConcurrency": "",
"ComplianceSeverity": "",
"SyncCompliance": "",
"ApplyOnlyAtCronInterval": "",
"CalendarNames": "",
"TargetLocations": "",
"ScheduleOffset": "",
"TargetMaps": "",
"Tags": "",
"AlarmConfiguration": {
"IgnorePollAlarmFailure": "",
"Alarms": ""
}
}'
echo '{
"Name": "",
"DocumentVersion": "",
"InstanceId": "",
"Parameters": "",
"Targets": "",
"ScheduleExpression": "",
"OutputLocation": "",
"AssociationName": "",
"AutomationTargetParameterName": "",
"MaxErrors": "",
"MaxConcurrency": "",
"ComplianceSeverity": "",
"SyncCompliance": "",
"ApplyOnlyAtCronInterval": "",
"CalendarNames": "",
"TargetLocations": "",
"ScheduleOffset": "",
"TargetMaps": "",
"Tags": "",
"AlarmConfiguration": {
"IgnorePollAlarmFailure": "",
"Alarms": ""
}
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateAssociation' \
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 "DocumentVersion": "",\n "InstanceId": "",\n "Parameters": "",\n "Targets": "",\n "ScheduleExpression": "",\n "OutputLocation": "",\n "AssociationName": "",\n "AutomationTargetParameterName": "",\n "MaxErrors": "",\n "MaxConcurrency": "",\n "ComplianceSeverity": "",\n "SyncCompliance": "",\n "ApplyOnlyAtCronInterval": "",\n "CalendarNames": "",\n "TargetLocations": "",\n "ScheduleOffset": "",\n "TargetMaps": "",\n "Tags": "",\n "AlarmConfiguration": {\n "IgnorePollAlarmFailure": "",\n "Alarms": ""\n }\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateAssociation'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Name": "",
"DocumentVersion": "",
"InstanceId": "",
"Parameters": "",
"Targets": "",
"ScheduleExpression": "",
"OutputLocation": "",
"AssociationName": "",
"AutomationTargetParameterName": "",
"MaxErrors": "",
"MaxConcurrency": "",
"ComplianceSeverity": "",
"SyncCompliance": "",
"ApplyOnlyAtCronInterval": "",
"CalendarNames": "",
"TargetLocations": "",
"ScheduleOffset": "",
"TargetMaps": "",
"Tags": "",
"AlarmConfiguration": [
"IgnorePollAlarmFailure": "",
"Alarms": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateAssociation")! 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
CreateAssociationBatch
{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateAssociationBatch
HEADERS
X-Amz-Target
BODY json
{
"Entries": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateAssociationBatch");
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 \"Entries\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateAssociationBatch" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Entries ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateAssociationBatch"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Entries\": \"\"\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=AmazonSSM.CreateAssociationBatch"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Entries\": \"\"\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=AmazonSSM.CreateAssociationBatch");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Entries\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateAssociationBatch"
payload := strings.NewReader("{\n \"Entries\": \"\"\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
{
"Entries": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateAssociationBatch")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Entries\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateAssociationBatch"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Entries\": \"\"\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 \"Entries\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateAssociationBatch")
.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=AmazonSSM.CreateAssociationBatch")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Entries\": \"\"\n}")
.asString();
const data = JSON.stringify({
Entries: ''
});
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=AmazonSSM.CreateAssociationBatch');
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=AmazonSSM.CreateAssociationBatch',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Entries: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateAssociationBatch';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Entries":""}'
};
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=AmazonSSM.CreateAssociationBatch',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Entries": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Entries\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateAssociationBatch")
.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({Entries: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateAssociationBatch',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Entries: ''},
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=AmazonSSM.CreateAssociationBatch');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Entries: ''
});
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=AmazonSSM.CreateAssociationBatch',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Entries: ''}
};
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=AmazonSSM.CreateAssociationBatch';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Entries":""}'
};
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 = @{ @"Entries": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateAssociationBatch"]
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=AmazonSSM.CreateAssociationBatch" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Entries\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateAssociationBatch",
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([
'Entries' => ''
]),
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=AmazonSSM.CreateAssociationBatch', [
'body' => '{
"Entries": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateAssociationBatch');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Entries' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Entries' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateAssociationBatch');
$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=AmazonSSM.CreateAssociationBatch' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Entries": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateAssociationBatch' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Entries": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Entries\": \"\"\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=AmazonSSM.CreateAssociationBatch"
payload = { "Entries": "" }
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=AmazonSSM.CreateAssociationBatch"
payload <- "{\n \"Entries\": \"\"\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=AmazonSSM.CreateAssociationBatch")
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 \"Entries\": \"\"\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 \"Entries\": \"\"\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=AmazonSSM.CreateAssociationBatch";
let payload = json!({"Entries": ""});
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=AmazonSSM.CreateAssociationBatch' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Entries": ""
}'
echo '{
"Entries": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateAssociationBatch' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Entries": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateAssociationBatch'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["Entries": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateAssociationBatch")! 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
CreateDocument
{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateDocument
HEADERS
X-Amz-Target
BODY json
{
"Content": "",
"Requires": "",
"Attachments": "",
"Name": "",
"DisplayName": "",
"VersionName": "",
"DocumentType": "",
"DocumentFormat": "",
"TargetType": "",
"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=AmazonSSM.CreateDocument");
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 \"Content\": \"\",\n \"Requires\": \"\",\n \"Attachments\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"VersionName\": \"\",\n \"DocumentType\": \"\",\n \"DocumentFormat\": \"\",\n \"TargetType\": \"\",\n \"Tags\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateDocument" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Content ""
:Requires ""
:Attachments ""
:Name ""
:DisplayName ""
:VersionName ""
:DocumentType ""
:DocumentFormat ""
:TargetType ""
:Tags ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateDocument"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Content\": \"\",\n \"Requires\": \"\",\n \"Attachments\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"VersionName\": \"\",\n \"DocumentType\": \"\",\n \"DocumentFormat\": \"\",\n \"TargetType\": \"\",\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=AmazonSSM.CreateDocument"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Content\": \"\",\n \"Requires\": \"\",\n \"Attachments\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"VersionName\": \"\",\n \"DocumentType\": \"\",\n \"DocumentFormat\": \"\",\n \"TargetType\": \"\",\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=AmazonSSM.CreateDocument");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Content\": \"\",\n \"Requires\": \"\",\n \"Attachments\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"VersionName\": \"\",\n \"DocumentType\": \"\",\n \"DocumentFormat\": \"\",\n \"TargetType\": \"\",\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=AmazonSSM.CreateDocument"
payload := strings.NewReader("{\n \"Content\": \"\",\n \"Requires\": \"\",\n \"Attachments\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"VersionName\": \"\",\n \"DocumentType\": \"\",\n \"DocumentFormat\": \"\",\n \"TargetType\": \"\",\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: 194
{
"Content": "",
"Requires": "",
"Attachments": "",
"Name": "",
"DisplayName": "",
"VersionName": "",
"DocumentType": "",
"DocumentFormat": "",
"TargetType": "",
"Tags": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateDocument")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Content\": \"\",\n \"Requires\": \"\",\n \"Attachments\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"VersionName\": \"\",\n \"DocumentType\": \"\",\n \"DocumentFormat\": \"\",\n \"TargetType\": \"\",\n \"Tags\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateDocument"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Content\": \"\",\n \"Requires\": \"\",\n \"Attachments\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"VersionName\": \"\",\n \"DocumentType\": \"\",\n \"DocumentFormat\": \"\",\n \"TargetType\": \"\",\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 \"Content\": \"\",\n \"Requires\": \"\",\n \"Attachments\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"VersionName\": \"\",\n \"DocumentType\": \"\",\n \"DocumentFormat\": \"\",\n \"TargetType\": \"\",\n \"Tags\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateDocument")
.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=AmazonSSM.CreateDocument")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Content\": \"\",\n \"Requires\": \"\",\n \"Attachments\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"VersionName\": \"\",\n \"DocumentType\": \"\",\n \"DocumentFormat\": \"\",\n \"TargetType\": \"\",\n \"Tags\": \"\"\n}")
.asString();
const data = JSON.stringify({
Content: '',
Requires: '',
Attachments: '',
Name: '',
DisplayName: '',
VersionName: '',
DocumentType: '',
DocumentFormat: '',
TargetType: '',
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=AmazonSSM.CreateDocument');
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=AmazonSSM.CreateDocument',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Content: '',
Requires: '',
Attachments: '',
Name: '',
DisplayName: '',
VersionName: '',
DocumentType: '',
DocumentFormat: '',
TargetType: '',
Tags: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateDocument';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Content":"","Requires":"","Attachments":"","Name":"","DisplayName":"","VersionName":"","DocumentType":"","DocumentFormat":"","TargetType":"","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=AmazonSSM.CreateDocument',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Content": "",\n "Requires": "",\n "Attachments": "",\n "Name": "",\n "DisplayName": "",\n "VersionName": "",\n "DocumentType": "",\n "DocumentFormat": "",\n "TargetType": "",\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 \"Content\": \"\",\n \"Requires\": \"\",\n \"Attachments\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"VersionName\": \"\",\n \"DocumentType\": \"\",\n \"DocumentFormat\": \"\",\n \"TargetType\": \"\",\n \"Tags\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateDocument")
.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({
Content: '',
Requires: '',
Attachments: '',
Name: '',
DisplayName: '',
VersionName: '',
DocumentType: '',
DocumentFormat: '',
TargetType: '',
Tags: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateDocument',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
Content: '',
Requires: '',
Attachments: '',
Name: '',
DisplayName: '',
VersionName: '',
DocumentType: '',
DocumentFormat: '',
TargetType: '',
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=AmazonSSM.CreateDocument');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Content: '',
Requires: '',
Attachments: '',
Name: '',
DisplayName: '',
VersionName: '',
DocumentType: '',
DocumentFormat: '',
TargetType: '',
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=AmazonSSM.CreateDocument',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Content: '',
Requires: '',
Attachments: '',
Name: '',
DisplayName: '',
VersionName: '',
DocumentType: '',
DocumentFormat: '',
TargetType: '',
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=AmazonSSM.CreateDocument';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Content":"","Requires":"","Attachments":"","Name":"","DisplayName":"","VersionName":"","DocumentType":"","DocumentFormat":"","TargetType":"","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 = @{ @"Content": @"",
@"Requires": @"",
@"Attachments": @"",
@"Name": @"",
@"DisplayName": @"",
@"VersionName": @"",
@"DocumentType": @"",
@"DocumentFormat": @"",
@"TargetType": @"",
@"Tags": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateDocument"]
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=AmazonSSM.CreateDocument" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Content\": \"\",\n \"Requires\": \"\",\n \"Attachments\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"VersionName\": \"\",\n \"DocumentType\": \"\",\n \"DocumentFormat\": \"\",\n \"TargetType\": \"\",\n \"Tags\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateDocument",
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([
'Content' => '',
'Requires' => '',
'Attachments' => '',
'Name' => '',
'DisplayName' => '',
'VersionName' => '',
'DocumentType' => '',
'DocumentFormat' => '',
'TargetType' => '',
'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=AmazonSSM.CreateDocument', [
'body' => '{
"Content": "",
"Requires": "",
"Attachments": "",
"Name": "",
"DisplayName": "",
"VersionName": "",
"DocumentType": "",
"DocumentFormat": "",
"TargetType": "",
"Tags": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateDocument');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Content' => '',
'Requires' => '',
'Attachments' => '',
'Name' => '',
'DisplayName' => '',
'VersionName' => '',
'DocumentType' => '',
'DocumentFormat' => '',
'TargetType' => '',
'Tags' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Content' => '',
'Requires' => '',
'Attachments' => '',
'Name' => '',
'DisplayName' => '',
'VersionName' => '',
'DocumentType' => '',
'DocumentFormat' => '',
'TargetType' => '',
'Tags' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateDocument');
$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=AmazonSSM.CreateDocument' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Content": "",
"Requires": "",
"Attachments": "",
"Name": "",
"DisplayName": "",
"VersionName": "",
"DocumentType": "",
"DocumentFormat": "",
"TargetType": "",
"Tags": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateDocument' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Content": "",
"Requires": "",
"Attachments": "",
"Name": "",
"DisplayName": "",
"VersionName": "",
"DocumentType": "",
"DocumentFormat": "",
"TargetType": "",
"Tags": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Content\": \"\",\n \"Requires\": \"\",\n \"Attachments\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"VersionName\": \"\",\n \"DocumentType\": \"\",\n \"DocumentFormat\": \"\",\n \"TargetType\": \"\",\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=AmazonSSM.CreateDocument"
payload = {
"Content": "",
"Requires": "",
"Attachments": "",
"Name": "",
"DisplayName": "",
"VersionName": "",
"DocumentType": "",
"DocumentFormat": "",
"TargetType": "",
"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=AmazonSSM.CreateDocument"
payload <- "{\n \"Content\": \"\",\n \"Requires\": \"\",\n \"Attachments\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"VersionName\": \"\",\n \"DocumentType\": \"\",\n \"DocumentFormat\": \"\",\n \"TargetType\": \"\",\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=AmazonSSM.CreateDocument")
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 \"Content\": \"\",\n \"Requires\": \"\",\n \"Attachments\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"VersionName\": \"\",\n \"DocumentType\": \"\",\n \"DocumentFormat\": \"\",\n \"TargetType\": \"\",\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 \"Content\": \"\",\n \"Requires\": \"\",\n \"Attachments\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"VersionName\": \"\",\n \"DocumentType\": \"\",\n \"DocumentFormat\": \"\",\n \"TargetType\": \"\",\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=AmazonSSM.CreateDocument";
let payload = json!({
"Content": "",
"Requires": "",
"Attachments": "",
"Name": "",
"DisplayName": "",
"VersionName": "",
"DocumentType": "",
"DocumentFormat": "",
"TargetType": "",
"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=AmazonSSM.CreateDocument' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Content": "",
"Requires": "",
"Attachments": "",
"Name": "",
"DisplayName": "",
"VersionName": "",
"DocumentType": "",
"DocumentFormat": "",
"TargetType": "",
"Tags": ""
}'
echo '{
"Content": "",
"Requires": "",
"Attachments": "",
"Name": "",
"DisplayName": "",
"VersionName": "",
"DocumentType": "",
"DocumentFormat": "",
"TargetType": "",
"Tags": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateDocument' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Content": "",\n "Requires": "",\n "Attachments": "",\n "Name": "",\n "DisplayName": "",\n "VersionName": "",\n "DocumentType": "",\n "DocumentFormat": "",\n "TargetType": "",\n "Tags": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateDocument'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Content": "",
"Requires": "",
"Attachments": "",
"Name": "",
"DisplayName": "",
"VersionName": "",
"DocumentType": "",
"DocumentFormat": "",
"TargetType": "",
"Tags": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateDocument")! 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
CreateMaintenanceWindow
{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateMaintenanceWindow
HEADERS
X-Amz-Target
BODY json
{
"Name": "",
"Description": "",
"StartDate": "",
"EndDate": "",
"Schedule": "",
"ScheduleTimezone": "",
"ScheduleOffset": "",
"Duration": "",
"Cutoff": "",
"AllowUnassociatedTargets": "",
"ClientToken": "",
"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=AmazonSSM.CreateMaintenanceWindow");
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 \"Description\": \"\",\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"Schedule\": \"\",\n \"ScheduleTimezone\": \"\",\n \"ScheduleOffset\": \"\",\n \"Duration\": \"\",\n \"Cutoff\": \"\",\n \"AllowUnassociatedTargets\": \"\",\n \"ClientToken\": \"\",\n \"Tags\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateMaintenanceWindow" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Name ""
:Description ""
:StartDate ""
:EndDate ""
:Schedule ""
:ScheduleTimezone ""
:ScheduleOffset ""
:Duration ""
:Cutoff ""
:AllowUnassociatedTargets ""
:ClientToken ""
:Tags ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateMaintenanceWindow"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Name\": \"\",\n \"Description\": \"\",\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"Schedule\": \"\",\n \"ScheduleTimezone\": \"\",\n \"ScheduleOffset\": \"\",\n \"Duration\": \"\",\n \"Cutoff\": \"\",\n \"AllowUnassociatedTargets\": \"\",\n \"ClientToken\": \"\",\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=AmazonSSM.CreateMaintenanceWindow"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Name\": \"\",\n \"Description\": \"\",\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"Schedule\": \"\",\n \"ScheduleTimezone\": \"\",\n \"ScheduleOffset\": \"\",\n \"Duration\": \"\",\n \"Cutoff\": \"\",\n \"AllowUnassociatedTargets\": \"\",\n \"ClientToken\": \"\",\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=AmazonSSM.CreateMaintenanceWindow");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Name\": \"\",\n \"Description\": \"\",\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"Schedule\": \"\",\n \"ScheduleTimezone\": \"\",\n \"ScheduleOffset\": \"\",\n \"Duration\": \"\",\n \"Cutoff\": \"\",\n \"AllowUnassociatedTargets\": \"\",\n \"ClientToken\": \"\",\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=AmazonSSM.CreateMaintenanceWindow"
payload := strings.NewReader("{\n \"Name\": \"\",\n \"Description\": \"\",\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"Schedule\": \"\",\n \"ScheduleTimezone\": \"\",\n \"ScheduleOffset\": \"\",\n \"Duration\": \"\",\n \"Cutoff\": \"\",\n \"AllowUnassociatedTargets\": \"\",\n \"ClientToken\": \"\",\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: 244
{
"Name": "",
"Description": "",
"StartDate": "",
"EndDate": "",
"Schedule": "",
"ScheduleTimezone": "",
"ScheduleOffset": "",
"Duration": "",
"Cutoff": "",
"AllowUnassociatedTargets": "",
"ClientToken": "",
"Tags": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateMaintenanceWindow")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Name\": \"\",\n \"Description\": \"\",\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"Schedule\": \"\",\n \"ScheduleTimezone\": \"\",\n \"ScheduleOffset\": \"\",\n \"Duration\": \"\",\n \"Cutoff\": \"\",\n \"AllowUnassociatedTargets\": \"\",\n \"ClientToken\": \"\",\n \"Tags\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateMaintenanceWindow"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Name\": \"\",\n \"Description\": \"\",\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"Schedule\": \"\",\n \"ScheduleTimezone\": \"\",\n \"ScheduleOffset\": \"\",\n \"Duration\": \"\",\n \"Cutoff\": \"\",\n \"AllowUnassociatedTargets\": \"\",\n \"ClientToken\": \"\",\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 \"Description\": \"\",\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"Schedule\": \"\",\n \"ScheduleTimezone\": \"\",\n \"ScheduleOffset\": \"\",\n \"Duration\": \"\",\n \"Cutoff\": \"\",\n \"AllowUnassociatedTargets\": \"\",\n \"ClientToken\": \"\",\n \"Tags\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateMaintenanceWindow")
.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=AmazonSSM.CreateMaintenanceWindow")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Name\": \"\",\n \"Description\": \"\",\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"Schedule\": \"\",\n \"ScheduleTimezone\": \"\",\n \"ScheduleOffset\": \"\",\n \"Duration\": \"\",\n \"Cutoff\": \"\",\n \"AllowUnassociatedTargets\": \"\",\n \"ClientToken\": \"\",\n \"Tags\": \"\"\n}")
.asString();
const data = JSON.stringify({
Name: '',
Description: '',
StartDate: '',
EndDate: '',
Schedule: '',
ScheduleTimezone: '',
ScheduleOffset: '',
Duration: '',
Cutoff: '',
AllowUnassociatedTargets: '',
ClientToken: '',
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=AmazonSSM.CreateMaintenanceWindow');
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=AmazonSSM.CreateMaintenanceWindow',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Name: '',
Description: '',
StartDate: '',
EndDate: '',
Schedule: '',
ScheduleTimezone: '',
ScheduleOffset: '',
Duration: '',
Cutoff: '',
AllowUnassociatedTargets: '',
ClientToken: '',
Tags: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateMaintenanceWindow';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","Description":"","StartDate":"","EndDate":"","Schedule":"","ScheduleTimezone":"","ScheduleOffset":"","Duration":"","Cutoff":"","AllowUnassociatedTargets":"","ClientToken":"","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=AmazonSSM.CreateMaintenanceWindow',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Name": "",\n "Description": "",\n "StartDate": "",\n "EndDate": "",\n "Schedule": "",\n "ScheduleTimezone": "",\n "ScheduleOffset": "",\n "Duration": "",\n "Cutoff": "",\n "AllowUnassociatedTargets": "",\n "ClientToken": "",\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 \"Description\": \"\",\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"Schedule\": \"\",\n \"ScheduleTimezone\": \"\",\n \"ScheduleOffset\": \"\",\n \"Duration\": \"\",\n \"Cutoff\": \"\",\n \"AllowUnassociatedTargets\": \"\",\n \"ClientToken\": \"\",\n \"Tags\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateMaintenanceWindow")
.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: '',
Description: '',
StartDate: '',
EndDate: '',
Schedule: '',
ScheduleTimezone: '',
ScheduleOffset: '',
Duration: '',
Cutoff: '',
AllowUnassociatedTargets: '',
ClientToken: '',
Tags: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateMaintenanceWindow',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
Name: '',
Description: '',
StartDate: '',
EndDate: '',
Schedule: '',
ScheduleTimezone: '',
ScheduleOffset: '',
Duration: '',
Cutoff: '',
AllowUnassociatedTargets: '',
ClientToken: '',
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=AmazonSSM.CreateMaintenanceWindow');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Name: '',
Description: '',
StartDate: '',
EndDate: '',
Schedule: '',
ScheduleTimezone: '',
ScheduleOffset: '',
Duration: '',
Cutoff: '',
AllowUnassociatedTargets: '',
ClientToken: '',
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=AmazonSSM.CreateMaintenanceWindow',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Name: '',
Description: '',
StartDate: '',
EndDate: '',
Schedule: '',
ScheduleTimezone: '',
ScheduleOffset: '',
Duration: '',
Cutoff: '',
AllowUnassociatedTargets: '',
ClientToken: '',
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=AmazonSSM.CreateMaintenanceWindow';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","Description":"","StartDate":"","EndDate":"","Schedule":"","ScheduleTimezone":"","ScheduleOffset":"","Duration":"","Cutoff":"","AllowUnassociatedTargets":"","ClientToken":"","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": @"",
@"Description": @"",
@"StartDate": @"",
@"EndDate": @"",
@"Schedule": @"",
@"ScheduleTimezone": @"",
@"ScheduleOffset": @"",
@"Duration": @"",
@"Cutoff": @"",
@"AllowUnassociatedTargets": @"",
@"ClientToken": @"",
@"Tags": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateMaintenanceWindow"]
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=AmazonSSM.CreateMaintenanceWindow" 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 \"Description\": \"\",\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"Schedule\": \"\",\n \"ScheduleTimezone\": \"\",\n \"ScheduleOffset\": \"\",\n \"Duration\": \"\",\n \"Cutoff\": \"\",\n \"AllowUnassociatedTargets\": \"\",\n \"ClientToken\": \"\",\n \"Tags\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateMaintenanceWindow",
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' => '',
'Description' => '',
'StartDate' => '',
'EndDate' => '',
'Schedule' => '',
'ScheduleTimezone' => '',
'ScheduleOffset' => '',
'Duration' => '',
'Cutoff' => '',
'AllowUnassociatedTargets' => '',
'ClientToken' => '',
'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=AmazonSSM.CreateMaintenanceWindow', [
'body' => '{
"Name": "",
"Description": "",
"StartDate": "",
"EndDate": "",
"Schedule": "",
"ScheduleTimezone": "",
"ScheduleOffset": "",
"Duration": "",
"Cutoff": "",
"AllowUnassociatedTargets": "",
"ClientToken": "",
"Tags": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateMaintenanceWindow');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Name' => '',
'Description' => '',
'StartDate' => '',
'EndDate' => '',
'Schedule' => '',
'ScheduleTimezone' => '',
'ScheduleOffset' => '',
'Duration' => '',
'Cutoff' => '',
'AllowUnassociatedTargets' => '',
'ClientToken' => '',
'Tags' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Name' => '',
'Description' => '',
'StartDate' => '',
'EndDate' => '',
'Schedule' => '',
'ScheduleTimezone' => '',
'ScheduleOffset' => '',
'Duration' => '',
'Cutoff' => '',
'AllowUnassociatedTargets' => '',
'ClientToken' => '',
'Tags' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateMaintenanceWindow');
$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=AmazonSSM.CreateMaintenanceWindow' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"Description": "",
"StartDate": "",
"EndDate": "",
"Schedule": "",
"ScheduleTimezone": "",
"ScheduleOffset": "",
"Duration": "",
"Cutoff": "",
"AllowUnassociatedTargets": "",
"ClientToken": "",
"Tags": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateMaintenanceWindow' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"Description": "",
"StartDate": "",
"EndDate": "",
"Schedule": "",
"ScheduleTimezone": "",
"ScheduleOffset": "",
"Duration": "",
"Cutoff": "",
"AllowUnassociatedTargets": "",
"ClientToken": "",
"Tags": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Name\": \"\",\n \"Description\": \"\",\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"Schedule\": \"\",\n \"ScheduleTimezone\": \"\",\n \"ScheduleOffset\": \"\",\n \"Duration\": \"\",\n \"Cutoff\": \"\",\n \"AllowUnassociatedTargets\": \"\",\n \"ClientToken\": \"\",\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=AmazonSSM.CreateMaintenanceWindow"
payload = {
"Name": "",
"Description": "",
"StartDate": "",
"EndDate": "",
"Schedule": "",
"ScheduleTimezone": "",
"ScheduleOffset": "",
"Duration": "",
"Cutoff": "",
"AllowUnassociatedTargets": "",
"ClientToken": "",
"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=AmazonSSM.CreateMaintenanceWindow"
payload <- "{\n \"Name\": \"\",\n \"Description\": \"\",\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"Schedule\": \"\",\n \"ScheduleTimezone\": \"\",\n \"ScheduleOffset\": \"\",\n \"Duration\": \"\",\n \"Cutoff\": \"\",\n \"AllowUnassociatedTargets\": \"\",\n \"ClientToken\": \"\",\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=AmazonSSM.CreateMaintenanceWindow")
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 \"Description\": \"\",\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"Schedule\": \"\",\n \"ScheduleTimezone\": \"\",\n \"ScheduleOffset\": \"\",\n \"Duration\": \"\",\n \"Cutoff\": \"\",\n \"AllowUnassociatedTargets\": \"\",\n \"ClientToken\": \"\",\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 \"Description\": \"\",\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"Schedule\": \"\",\n \"ScheduleTimezone\": \"\",\n \"ScheduleOffset\": \"\",\n \"Duration\": \"\",\n \"Cutoff\": \"\",\n \"AllowUnassociatedTargets\": \"\",\n \"ClientToken\": \"\",\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=AmazonSSM.CreateMaintenanceWindow";
let payload = json!({
"Name": "",
"Description": "",
"StartDate": "",
"EndDate": "",
"Schedule": "",
"ScheduleTimezone": "",
"ScheduleOffset": "",
"Duration": "",
"Cutoff": "",
"AllowUnassociatedTargets": "",
"ClientToken": "",
"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=AmazonSSM.CreateMaintenanceWindow' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Name": "",
"Description": "",
"StartDate": "",
"EndDate": "",
"Schedule": "",
"ScheduleTimezone": "",
"ScheduleOffset": "",
"Duration": "",
"Cutoff": "",
"AllowUnassociatedTargets": "",
"ClientToken": "",
"Tags": ""
}'
echo '{
"Name": "",
"Description": "",
"StartDate": "",
"EndDate": "",
"Schedule": "",
"ScheduleTimezone": "",
"ScheduleOffset": "",
"Duration": "",
"Cutoff": "",
"AllowUnassociatedTargets": "",
"ClientToken": "",
"Tags": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateMaintenanceWindow' \
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 "Description": "",\n "StartDate": "",\n "EndDate": "",\n "Schedule": "",\n "ScheduleTimezone": "",\n "ScheduleOffset": "",\n "Duration": "",\n "Cutoff": "",\n "AllowUnassociatedTargets": "",\n "ClientToken": "",\n "Tags": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateMaintenanceWindow'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Name": "",
"Description": "",
"StartDate": "",
"EndDate": "",
"Schedule": "",
"ScheduleTimezone": "",
"ScheduleOffset": "",
"Duration": "",
"Cutoff": "",
"AllowUnassociatedTargets": "",
"ClientToken": "",
"Tags": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateMaintenanceWindow")! 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
CreateOpsItem
{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateOpsItem
HEADERS
X-Amz-Target
BODY json
{
"Description": "",
"OpsItemType": "",
"OperationalData": "",
"Notifications": "",
"Priority": "",
"RelatedOpsItems": "",
"Source": "",
"Title": "",
"Tags": "",
"Category": "",
"Severity": "",
"ActualStartTime": "",
"ActualEndTime": "",
"PlannedStartTime": "",
"PlannedEndTime": "",
"AccountId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateOpsItem");
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 \"Description\": \"\",\n \"OpsItemType\": \"\",\n \"OperationalData\": \"\",\n \"Notifications\": \"\",\n \"Priority\": \"\",\n \"RelatedOpsItems\": \"\",\n \"Source\": \"\",\n \"Title\": \"\",\n \"Tags\": \"\",\n \"Category\": \"\",\n \"Severity\": \"\",\n \"ActualStartTime\": \"\",\n \"ActualEndTime\": \"\",\n \"PlannedStartTime\": \"\",\n \"PlannedEndTime\": \"\",\n \"AccountId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateOpsItem" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Description ""
:OpsItemType ""
:OperationalData ""
:Notifications ""
:Priority ""
:RelatedOpsItems ""
:Source ""
:Title ""
:Tags ""
:Category ""
:Severity ""
:ActualStartTime ""
:ActualEndTime ""
:PlannedStartTime ""
:PlannedEndTime ""
:AccountId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateOpsItem"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Description\": \"\",\n \"OpsItemType\": \"\",\n \"OperationalData\": \"\",\n \"Notifications\": \"\",\n \"Priority\": \"\",\n \"RelatedOpsItems\": \"\",\n \"Source\": \"\",\n \"Title\": \"\",\n \"Tags\": \"\",\n \"Category\": \"\",\n \"Severity\": \"\",\n \"ActualStartTime\": \"\",\n \"ActualEndTime\": \"\",\n \"PlannedStartTime\": \"\",\n \"PlannedEndTime\": \"\",\n \"AccountId\": \"\"\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=AmazonSSM.CreateOpsItem"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Description\": \"\",\n \"OpsItemType\": \"\",\n \"OperationalData\": \"\",\n \"Notifications\": \"\",\n \"Priority\": \"\",\n \"RelatedOpsItems\": \"\",\n \"Source\": \"\",\n \"Title\": \"\",\n \"Tags\": \"\",\n \"Category\": \"\",\n \"Severity\": \"\",\n \"ActualStartTime\": \"\",\n \"ActualEndTime\": \"\",\n \"PlannedStartTime\": \"\",\n \"PlannedEndTime\": \"\",\n \"AccountId\": \"\"\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=AmazonSSM.CreateOpsItem");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Description\": \"\",\n \"OpsItemType\": \"\",\n \"OperationalData\": \"\",\n \"Notifications\": \"\",\n \"Priority\": \"\",\n \"RelatedOpsItems\": \"\",\n \"Source\": \"\",\n \"Title\": \"\",\n \"Tags\": \"\",\n \"Category\": \"\",\n \"Severity\": \"\",\n \"ActualStartTime\": \"\",\n \"ActualEndTime\": \"\",\n \"PlannedStartTime\": \"\",\n \"PlannedEndTime\": \"\",\n \"AccountId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateOpsItem"
payload := strings.NewReader("{\n \"Description\": \"\",\n \"OpsItemType\": \"\",\n \"OperationalData\": \"\",\n \"Notifications\": \"\",\n \"Priority\": \"\",\n \"RelatedOpsItems\": \"\",\n \"Source\": \"\",\n \"Title\": \"\",\n \"Tags\": \"\",\n \"Category\": \"\",\n \"Severity\": \"\",\n \"ActualStartTime\": \"\",\n \"ActualEndTime\": \"\",\n \"PlannedStartTime\": \"\",\n \"PlannedEndTime\": \"\",\n \"AccountId\": \"\"\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: 333
{
"Description": "",
"OpsItemType": "",
"OperationalData": "",
"Notifications": "",
"Priority": "",
"RelatedOpsItems": "",
"Source": "",
"Title": "",
"Tags": "",
"Category": "",
"Severity": "",
"ActualStartTime": "",
"ActualEndTime": "",
"PlannedStartTime": "",
"PlannedEndTime": "",
"AccountId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateOpsItem")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Description\": \"\",\n \"OpsItemType\": \"\",\n \"OperationalData\": \"\",\n \"Notifications\": \"\",\n \"Priority\": \"\",\n \"RelatedOpsItems\": \"\",\n \"Source\": \"\",\n \"Title\": \"\",\n \"Tags\": \"\",\n \"Category\": \"\",\n \"Severity\": \"\",\n \"ActualStartTime\": \"\",\n \"ActualEndTime\": \"\",\n \"PlannedStartTime\": \"\",\n \"PlannedEndTime\": \"\",\n \"AccountId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateOpsItem"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Description\": \"\",\n \"OpsItemType\": \"\",\n \"OperationalData\": \"\",\n \"Notifications\": \"\",\n \"Priority\": \"\",\n \"RelatedOpsItems\": \"\",\n \"Source\": \"\",\n \"Title\": \"\",\n \"Tags\": \"\",\n \"Category\": \"\",\n \"Severity\": \"\",\n \"ActualStartTime\": \"\",\n \"ActualEndTime\": \"\",\n \"PlannedStartTime\": \"\",\n \"PlannedEndTime\": \"\",\n \"AccountId\": \"\"\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 \"Description\": \"\",\n \"OpsItemType\": \"\",\n \"OperationalData\": \"\",\n \"Notifications\": \"\",\n \"Priority\": \"\",\n \"RelatedOpsItems\": \"\",\n \"Source\": \"\",\n \"Title\": \"\",\n \"Tags\": \"\",\n \"Category\": \"\",\n \"Severity\": \"\",\n \"ActualStartTime\": \"\",\n \"ActualEndTime\": \"\",\n \"PlannedStartTime\": \"\",\n \"PlannedEndTime\": \"\",\n \"AccountId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateOpsItem")
.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=AmazonSSM.CreateOpsItem")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Description\": \"\",\n \"OpsItemType\": \"\",\n \"OperationalData\": \"\",\n \"Notifications\": \"\",\n \"Priority\": \"\",\n \"RelatedOpsItems\": \"\",\n \"Source\": \"\",\n \"Title\": \"\",\n \"Tags\": \"\",\n \"Category\": \"\",\n \"Severity\": \"\",\n \"ActualStartTime\": \"\",\n \"ActualEndTime\": \"\",\n \"PlannedStartTime\": \"\",\n \"PlannedEndTime\": \"\",\n \"AccountId\": \"\"\n}")
.asString();
const data = JSON.stringify({
Description: '',
OpsItemType: '',
OperationalData: '',
Notifications: '',
Priority: '',
RelatedOpsItems: '',
Source: '',
Title: '',
Tags: '',
Category: '',
Severity: '',
ActualStartTime: '',
ActualEndTime: '',
PlannedStartTime: '',
PlannedEndTime: '',
AccountId: ''
});
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=AmazonSSM.CreateOpsItem');
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=AmazonSSM.CreateOpsItem',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Description: '',
OpsItemType: '',
OperationalData: '',
Notifications: '',
Priority: '',
RelatedOpsItems: '',
Source: '',
Title: '',
Tags: '',
Category: '',
Severity: '',
ActualStartTime: '',
ActualEndTime: '',
PlannedStartTime: '',
PlannedEndTime: '',
AccountId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateOpsItem';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Description":"","OpsItemType":"","OperationalData":"","Notifications":"","Priority":"","RelatedOpsItems":"","Source":"","Title":"","Tags":"","Category":"","Severity":"","ActualStartTime":"","ActualEndTime":"","PlannedStartTime":"","PlannedEndTime":"","AccountId":""}'
};
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=AmazonSSM.CreateOpsItem',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Description": "",\n "OpsItemType": "",\n "OperationalData": "",\n "Notifications": "",\n "Priority": "",\n "RelatedOpsItems": "",\n "Source": "",\n "Title": "",\n "Tags": "",\n "Category": "",\n "Severity": "",\n "ActualStartTime": "",\n "ActualEndTime": "",\n "PlannedStartTime": "",\n "PlannedEndTime": "",\n "AccountId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Description\": \"\",\n \"OpsItemType\": \"\",\n \"OperationalData\": \"\",\n \"Notifications\": \"\",\n \"Priority\": \"\",\n \"RelatedOpsItems\": \"\",\n \"Source\": \"\",\n \"Title\": \"\",\n \"Tags\": \"\",\n \"Category\": \"\",\n \"Severity\": \"\",\n \"ActualStartTime\": \"\",\n \"ActualEndTime\": \"\",\n \"PlannedStartTime\": \"\",\n \"PlannedEndTime\": \"\",\n \"AccountId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateOpsItem")
.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({
Description: '',
OpsItemType: '',
OperationalData: '',
Notifications: '',
Priority: '',
RelatedOpsItems: '',
Source: '',
Title: '',
Tags: '',
Category: '',
Severity: '',
ActualStartTime: '',
ActualEndTime: '',
PlannedStartTime: '',
PlannedEndTime: '',
AccountId: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateOpsItem',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
Description: '',
OpsItemType: '',
OperationalData: '',
Notifications: '',
Priority: '',
RelatedOpsItems: '',
Source: '',
Title: '',
Tags: '',
Category: '',
Severity: '',
ActualStartTime: '',
ActualEndTime: '',
PlannedStartTime: '',
PlannedEndTime: '',
AccountId: ''
},
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=AmazonSSM.CreateOpsItem');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Description: '',
OpsItemType: '',
OperationalData: '',
Notifications: '',
Priority: '',
RelatedOpsItems: '',
Source: '',
Title: '',
Tags: '',
Category: '',
Severity: '',
ActualStartTime: '',
ActualEndTime: '',
PlannedStartTime: '',
PlannedEndTime: '',
AccountId: ''
});
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=AmazonSSM.CreateOpsItem',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Description: '',
OpsItemType: '',
OperationalData: '',
Notifications: '',
Priority: '',
RelatedOpsItems: '',
Source: '',
Title: '',
Tags: '',
Category: '',
Severity: '',
ActualStartTime: '',
ActualEndTime: '',
PlannedStartTime: '',
PlannedEndTime: '',
AccountId: ''
}
};
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=AmazonSSM.CreateOpsItem';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Description":"","OpsItemType":"","OperationalData":"","Notifications":"","Priority":"","RelatedOpsItems":"","Source":"","Title":"","Tags":"","Category":"","Severity":"","ActualStartTime":"","ActualEndTime":"","PlannedStartTime":"","PlannedEndTime":"","AccountId":""}'
};
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 = @{ @"Description": @"",
@"OpsItemType": @"",
@"OperationalData": @"",
@"Notifications": @"",
@"Priority": @"",
@"RelatedOpsItems": @"",
@"Source": @"",
@"Title": @"",
@"Tags": @"",
@"Category": @"",
@"Severity": @"",
@"ActualStartTime": @"",
@"ActualEndTime": @"",
@"PlannedStartTime": @"",
@"PlannedEndTime": @"",
@"AccountId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateOpsItem"]
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=AmazonSSM.CreateOpsItem" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Description\": \"\",\n \"OpsItemType\": \"\",\n \"OperationalData\": \"\",\n \"Notifications\": \"\",\n \"Priority\": \"\",\n \"RelatedOpsItems\": \"\",\n \"Source\": \"\",\n \"Title\": \"\",\n \"Tags\": \"\",\n \"Category\": \"\",\n \"Severity\": \"\",\n \"ActualStartTime\": \"\",\n \"ActualEndTime\": \"\",\n \"PlannedStartTime\": \"\",\n \"PlannedEndTime\": \"\",\n \"AccountId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateOpsItem",
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([
'Description' => '',
'OpsItemType' => '',
'OperationalData' => '',
'Notifications' => '',
'Priority' => '',
'RelatedOpsItems' => '',
'Source' => '',
'Title' => '',
'Tags' => '',
'Category' => '',
'Severity' => '',
'ActualStartTime' => '',
'ActualEndTime' => '',
'PlannedStartTime' => '',
'PlannedEndTime' => '',
'AccountId' => ''
]),
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=AmazonSSM.CreateOpsItem', [
'body' => '{
"Description": "",
"OpsItemType": "",
"OperationalData": "",
"Notifications": "",
"Priority": "",
"RelatedOpsItems": "",
"Source": "",
"Title": "",
"Tags": "",
"Category": "",
"Severity": "",
"ActualStartTime": "",
"ActualEndTime": "",
"PlannedStartTime": "",
"PlannedEndTime": "",
"AccountId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateOpsItem');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Description' => '',
'OpsItemType' => '',
'OperationalData' => '',
'Notifications' => '',
'Priority' => '',
'RelatedOpsItems' => '',
'Source' => '',
'Title' => '',
'Tags' => '',
'Category' => '',
'Severity' => '',
'ActualStartTime' => '',
'ActualEndTime' => '',
'PlannedStartTime' => '',
'PlannedEndTime' => '',
'AccountId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Description' => '',
'OpsItemType' => '',
'OperationalData' => '',
'Notifications' => '',
'Priority' => '',
'RelatedOpsItems' => '',
'Source' => '',
'Title' => '',
'Tags' => '',
'Category' => '',
'Severity' => '',
'ActualStartTime' => '',
'ActualEndTime' => '',
'PlannedStartTime' => '',
'PlannedEndTime' => '',
'AccountId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateOpsItem');
$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=AmazonSSM.CreateOpsItem' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Description": "",
"OpsItemType": "",
"OperationalData": "",
"Notifications": "",
"Priority": "",
"RelatedOpsItems": "",
"Source": "",
"Title": "",
"Tags": "",
"Category": "",
"Severity": "",
"ActualStartTime": "",
"ActualEndTime": "",
"PlannedStartTime": "",
"PlannedEndTime": "",
"AccountId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateOpsItem' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Description": "",
"OpsItemType": "",
"OperationalData": "",
"Notifications": "",
"Priority": "",
"RelatedOpsItems": "",
"Source": "",
"Title": "",
"Tags": "",
"Category": "",
"Severity": "",
"ActualStartTime": "",
"ActualEndTime": "",
"PlannedStartTime": "",
"PlannedEndTime": "",
"AccountId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Description\": \"\",\n \"OpsItemType\": \"\",\n \"OperationalData\": \"\",\n \"Notifications\": \"\",\n \"Priority\": \"\",\n \"RelatedOpsItems\": \"\",\n \"Source\": \"\",\n \"Title\": \"\",\n \"Tags\": \"\",\n \"Category\": \"\",\n \"Severity\": \"\",\n \"ActualStartTime\": \"\",\n \"ActualEndTime\": \"\",\n \"PlannedStartTime\": \"\",\n \"PlannedEndTime\": \"\",\n \"AccountId\": \"\"\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=AmazonSSM.CreateOpsItem"
payload = {
"Description": "",
"OpsItemType": "",
"OperationalData": "",
"Notifications": "",
"Priority": "",
"RelatedOpsItems": "",
"Source": "",
"Title": "",
"Tags": "",
"Category": "",
"Severity": "",
"ActualStartTime": "",
"ActualEndTime": "",
"PlannedStartTime": "",
"PlannedEndTime": "",
"AccountId": ""
}
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=AmazonSSM.CreateOpsItem"
payload <- "{\n \"Description\": \"\",\n \"OpsItemType\": \"\",\n \"OperationalData\": \"\",\n \"Notifications\": \"\",\n \"Priority\": \"\",\n \"RelatedOpsItems\": \"\",\n \"Source\": \"\",\n \"Title\": \"\",\n \"Tags\": \"\",\n \"Category\": \"\",\n \"Severity\": \"\",\n \"ActualStartTime\": \"\",\n \"ActualEndTime\": \"\",\n \"PlannedStartTime\": \"\",\n \"PlannedEndTime\": \"\",\n \"AccountId\": \"\"\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=AmazonSSM.CreateOpsItem")
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 \"Description\": \"\",\n \"OpsItemType\": \"\",\n \"OperationalData\": \"\",\n \"Notifications\": \"\",\n \"Priority\": \"\",\n \"RelatedOpsItems\": \"\",\n \"Source\": \"\",\n \"Title\": \"\",\n \"Tags\": \"\",\n \"Category\": \"\",\n \"Severity\": \"\",\n \"ActualStartTime\": \"\",\n \"ActualEndTime\": \"\",\n \"PlannedStartTime\": \"\",\n \"PlannedEndTime\": \"\",\n \"AccountId\": \"\"\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 \"Description\": \"\",\n \"OpsItemType\": \"\",\n \"OperationalData\": \"\",\n \"Notifications\": \"\",\n \"Priority\": \"\",\n \"RelatedOpsItems\": \"\",\n \"Source\": \"\",\n \"Title\": \"\",\n \"Tags\": \"\",\n \"Category\": \"\",\n \"Severity\": \"\",\n \"ActualStartTime\": \"\",\n \"ActualEndTime\": \"\",\n \"PlannedStartTime\": \"\",\n \"PlannedEndTime\": \"\",\n \"AccountId\": \"\"\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=AmazonSSM.CreateOpsItem";
let payload = json!({
"Description": "",
"OpsItemType": "",
"OperationalData": "",
"Notifications": "",
"Priority": "",
"RelatedOpsItems": "",
"Source": "",
"Title": "",
"Tags": "",
"Category": "",
"Severity": "",
"ActualStartTime": "",
"ActualEndTime": "",
"PlannedStartTime": "",
"PlannedEndTime": "",
"AccountId": ""
});
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=AmazonSSM.CreateOpsItem' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Description": "",
"OpsItemType": "",
"OperationalData": "",
"Notifications": "",
"Priority": "",
"RelatedOpsItems": "",
"Source": "",
"Title": "",
"Tags": "",
"Category": "",
"Severity": "",
"ActualStartTime": "",
"ActualEndTime": "",
"PlannedStartTime": "",
"PlannedEndTime": "",
"AccountId": ""
}'
echo '{
"Description": "",
"OpsItemType": "",
"OperationalData": "",
"Notifications": "",
"Priority": "",
"RelatedOpsItems": "",
"Source": "",
"Title": "",
"Tags": "",
"Category": "",
"Severity": "",
"ActualStartTime": "",
"ActualEndTime": "",
"PlannedStartTime": "",
"PlannedEndTime": "",
"AccountId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateOpsItem' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Description": "",\n "OpsItemType": "",\n "OperationalData": "",\n "Notifications": "",\n "Priority": "",\n "RelatedOpsItems": "",\n "Source": "",\n "Title": "",\n "Tags": "",\n "Category": "",\n "Severity": "",\n "ActualStartTime": "",\n "ActualEndTime": "",\n "PlannedStartTime": "",\n "PlannedEndTime": "",\n "AccountId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateOpsItem'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Description": "",
"OpsItemType": "",
"OperationalData": "",
"Notifications": "",
"Priority": "",
"RelatedOpsItems": "",
"Source": "",
"Title": "",
"Tags": "",
"Category": "",
"Severity": "",
"ActualStartTime": "",
"ActualEndTime": "",
"PlannedStartTime": "",
"PlannedEndTime": "",
"AccountId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateOpsItem")! 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
CreateOpsMetadata
{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateOpsMetadata
HEADERS
X-Amz-Target
BODY json
{
"ResourceId": "",
"Metadata": "",
"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=AmazonSSM.CreateOpsMetadata");
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 \"Metadata\": \"\",\n \"Tags\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateOpsMetadata" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ResourceId ""
:Metadata ""
:Tags ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateOpsMetadata"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ResourceId\": \"\",\n \"Metadata\": \"\",\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=AmazonSSM.CreateOpsMetadata"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ResourceId\": \"\",\n \"Metadata\": \"\",\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=AmazonSSM.CreateOpsMetadata");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ResourceId\": \"\",\n \"Metadata\": \"\",\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=AmazonSSM.CreateOpsMetadata"
payload := strings.NewReader("{\n \"ResourceId\": \"\",\n \"Metadata\": \"\",\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: 54
{
"ResourceId": "",
"Metadata": "",
"Tags": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateOpsMetadata")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ResourceId\": \"\",\n \"Metadata\": \"\",\n \"Tags\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateOpsMetadata"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ResourceId\": \"\",\n \"Metadata\": \"\",\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 \"Metadata\": \"\",\n \"Tags\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateOpsMetadata")
.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=AmazonSSM.CreateOpsMetadata")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ResourceId\": \"\",\n \"Metadata\": \"\",\n \"Tags\": \"\"\n}")
.asString();
const data = JSON.stringify({
ResourceId: '',
Metadata: '',
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=AmazonSSM.CreateOpsMetadata');
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=AmazonSSM.CreateOpsMetadata',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ResourceId: '', Metadata: '', Tags: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateOpsMetadata';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ResourceId":"","Metadata":"","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=AmazonSSM.CreateOpsMetadata',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ResourceId": "",\n "Metadata": "",\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 \"Metadata\": \"\",\n \"Tags\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateOpsMetadata")
.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: '', Metadata: '', Tags: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateOpsMetadata',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {ResourceId: '', Metadata: '', 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=AmazonSSM.CreateOpsMetadata');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ResourceId: '',
Metadata: '',
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=AmazonSSM.CreateOpsMetadata',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ResourceId: '', Metadata: '', 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=AmazonSSM.CreateOpsMetadata';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ResourceId":"","Metadata":"","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": @"",
@"Metadata": @"",
@"Tags": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateOpsMetadata"]
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=AmazonSSM.CreateOpsMetadata" 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 \"Metadata\": \"\",\n \"Tags\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateOpsMetadata",
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' => '',
'Metadata' => '',
'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=AmazonSSM.CreateOpsMetadata', [
'body' => '{
"ResourceId": "",
"Metadata": "",
"Tags": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateOpsMetadata');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ResourceId' => '',
'Metadata' => '',
'Tags' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ResourceId' => '',
'Metadata' => '',
'Tags' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateOpsMetadata');
$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=AmazonSSM.CreateOpsMetadata' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ResourceId": "",
"Metadata": "",
"Tags": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateOpsMetadata' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ResourceId": "",
"Metadata": "",
"Tags": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ResourceId\": \"\",\n \"Metadata\": \"\",\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=AmazonSSM.CreateOpsMetadata"
payload = {
"ResourceId": "",
"Metadata": "",
"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=AmazonSSM.CreateOpsMetadata"
payload <- "{\n \"ResourceId\": \"\",\n \"Metadata\": \"\",\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=AmazonSSM.CreateOpsMetadata")
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 \"Metadata\": \"\",\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 \"Metadata\": \"\",\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=AmazonSSM.CreateOpsMetadata";
let payload = json!({
"ResourceId": "",
"Metadata": "",
"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=AmazonSSM.CreateOpsMetadata' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ResourceId": "",
"Metadata": "",
"Tags": ""
}'
echo '{
"ResourceId": "",
"Metadata": "",
"Tags": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateOpsMetadata' \
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 "Metadata": "",\n "Tags": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateOpsMetadata'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"ResourceId": "",
"Metadata": "",
"Tags": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateOpsMetadata")! 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
CreatePatchBaseline
{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreatePatchBaseline
HEADERS
X-Amz-Target
BODY json
{
"OperatingSystem": "",
"Name": "",
"GlobalFilters": "",
"ApprovalRules": "",
"ApprovedPatches": "",
"ApprovedPatchesComplianceLevel": "",
"ApprovedPatchesEnableNonSecurity": "",
"RejectedPatches": "",
"RejectedPatchesAction": "",
"Description": "",
"Sources": "",
"ClientToken": "",
"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=AmazonSSM.CreatePatchBaseline");
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 \"OperatingSystem\": \"\",\n \"Name\": \"\",\n \"GlobalFilters\": \"\",\n \"ApprovalRules\": \"\",\n \"ApprovedPatches\": \"\",\n \"ApprovedPatchesComplianceLevel\": \"\",\n \"ApprovedPatchesEnableNonSecurity\": \"\",\n \"RejectedPatches\": \"\",\n \"RejectedPatchesAction\": \"\",\n \"Description\": \"\",\n \"Sources\": \"\",\n \"ClientToken\": \"\",\n \"Tags\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreatePatchBaseline" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OperatingSystem ""
:Name ""
:GlobalFilters ""
:ApprovalRules ""
:ApprovedPatches ""
:ApprovedPatchesComplianceLevel ""
:ApprovedPatchesEnableNonSecurity ""
:RejectedPatches ""
:RejectedPatchesAction ""
:Description ""
:Sources ""
:ClientToken ""
:Tags ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreatePatchBaseline"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OperatingSystem\": \"\",\n \"Name\": \"\",\n \"GlobalFilters\": \"\",\n \"ApprovalRules\": \"\",\n \"ApprovedPatches\": \"\",\n \"ApprovedPatchesComplianceLevel\": \"\",\n \"ApprovedPatchesEnableNonSecurity\": \"\",\n \"RejectedPatches\": \"\",\n \"RejectedPatchesAction\": \"\",\n \"Description\": \"\",\n \"Sources\": \"\",\n \"ClientToken\": \"\",\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=AmazonSSM.CreatePatchBaseline"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OperatingSystem\": \"\",\n \"Name\": \"\",\n \"GlobalFilters\": \"\",\n \"ApprovalRules\": \"\",\n \"ApprovedPatches\": \"\",\n \"ApprovedPatchesComplianceLevel\": \"\",\n \"ApprovedPatchesEnableNonSecurity\": \"\",\n \"RejectedPatches\": \"\",\n \"RejectedPatchesAction\": \"\",\n \"Description\": \"\",\n \"Sources\": \"\",\n \"ClientToken\": \"\",\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=AmazonSSM.CreatePatchBaseline");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OperatingSystem\": \"\",\n \"Name\": \"\",\n \"GlobalFilters\": \"\",\n \"ApprovalRules\": \"\",\n \"ApprovedPatches\": \"\",\n \"ApprovedPatchesComplianceLevel\": \"\",\n \"ApprovedPatchesEnableNonSecurity\": \"\",\n \"RejectedPatches\": \"\",\n \"RejectedPatchesAction\": \"\",\n \"Description\": \"\",\n \"Sources\": \"\",\n \"ClientToken\": \"\",\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=AmazonSSM.CreatePatchBaseline"
payload := strings.NewReader("{\n \"OperatingSystem\": \"\",\n \"Name\": \"\",\n \"GlobalFilters\": \"\",\n \"ApprovalRules\": \"\",\n \"ApprovedPatches\": \"\",\n \"ApprovedPatchesComplianceLevel\": \"\",\n \"ApprovedPatchesEnableNonSecurity\": \"\",\n \"RejectedPatches\": \"\",\n \"RejectedPatchesAction\": \"\",\n \"Description\": \"\",\n \"Sources\": \"\",\n \"ClientToken\": \"\",\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: 323
{
"OperatingSystem": "",
"Name": "",
"GlobalFilters": "",
"ApprovalRules": "",
"ApprovedPatches": "",
"ApprovedPatchesComplianceLevel": "",
"ApprovedPatchesEnableNonSecurity": "",
"RejectedPatches": "",
"RejectedPatchesAction": "",
"Description": "",
"Sources": "",
"ClientToken": "",
"Tags": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreatePatchBaseline")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OperatingSystem\": \"\",\n \"Name\": \"\",\n \"GlobalFilters\": \"\",\n \"ApprovalRules\": \"\",\n \"ApprovedPatches\": \"\",\n \"ApprovedPatchesComplianceLevel\": \"\",\n \"ApprovedPatchesEnableNonSecurity\": \"\",\n \"RejectedPatches\": \"\",\n \"RejectedPatchesAction\": \"\",\n \"Description\": \"\",\n \"Sources\": \"\",\n \"ClientToken\": \"\",\n \"Tags\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreatePatchBaseline"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OperatingSystem\": \"\",\n \"Name\": \"\",\n \"GlobalFilters\": \"\",\n \"ApprovalRules\": \"\",\n \"ApprovedPatches\": \"\",\n \"ApprovedPatchesComplianceLevel\": \"\",\n \"ApprovedPatchesEnableNonSecurity\": \"\",\n \"RejectedPatches\": \"\",\n \"RejectedPatchesAction\": \"\",\n \"Description\": \"\",\n \"Sources\": \"\",\n \"ClientToken\": \"\",\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 \"OperatingSystem\": \"\",\n \"Name\": \"\",\n \"GlobalFilters\": \"\",\n \"ApprovalRules\": \"\",\n \"ApprovedPatches\": \"\",\n \"ApprovedPatchesComplianceLevel\": \"\",\n \"ApprovedPatchesEnableNonSecurity\": \"\",\n \"RejectedPatches\": \"\",\n \"RejectedPatchesAction\": \"\",\n \"Description\": \"\",\n \"Sources\": \"\",\n \"ClientToken\": \"\",\n \"Tags\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreatePatchBaseline")
.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=AmazonSSM.CreatePatchBaseline")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OperatingSystem\": \"\",\n \"Name\": \"\",\n \"GlobalFilters\": \"\",\n \"ApprovalRules\": \"\",\n \"ApprovedPatches\": \"\",\n \"ApprovedPatchesComplianceLevel\": \"\",\n \"ApprovedPatchesEnableNonSecurity\": \"\",\n \"RejectedPatches\": \"\",\n \"RejectedPatchesAction\": \"\",\n \"Description\": \"\",\n \"Sources\": \"\",\n \"ClientToken\": \"\",\n \"Tags\": \"\"\n}")
.asString();
const data = JSON.stringify({
OperatingSystem: '',
Name: '',
GlobalFilters: '',
ApprovalRules: '',
ApprovedPatches: '',
ApprovedPatchesComplianceLevel: '',
ApprovedPatchesEnableNonSecurity: '',
RejectedPatches: '',
RejectedPatchesAction: '',
Description: '',
Sources: '',
ClientToken: '',
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=AmazonSSM.CreatePatchBaseline');
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=AmazonSSM.CreatePatchBaseline',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
OperatingSystem: '',
Name: '',
GlobalFilters: '',
ApprovalRules: '',
ApprovedPatches: '',
ApprovedPatchesComplianceLevel: '',
ApprovedPatchesEnableNonSecurity: '',
RejectedPatches: '',
RejectedPatchesAction: '',
Description: '',
Sources: '',
ClientToken: '',
Tags: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreatePatchBaseline';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OperatingSystem":"","Name":"","GlobalFilters":"","ApprovalRules":"","ApprovedPatches":"","ApprovedPatchesComplianceLevel":"","ApprovedPatchesEnableNonSecurity":"","RejectedPatches":"","RejectedPatchesAction":"","Description":"","Sources":"","ClientToken":"","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=AmazonSSM.CreatePatchBaseline',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OperatingSystem": "",\n "Name": "",\n "GlobalFilters": "",\n "ApprovalRules": "",\n "ApprovedPatches": "",\n "ApprovedPatchesComplianceLevel": "",\n "ApprovedPatchesEnableNonSecurity": "",\n "RejectedPatches": "",\n "RejectedPatchesAction": "",\n "Description": "",\n "Sources": "",\n "ClientToken": "",\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 \"OperatingSystem\": \"\",\n \"Name\": \"\",\n \"GlobalFilters\": \"\",\n \"ApprovalRules\": \"\",\n \"ApprovedPatches\": \"\",\n \"ApprovedPatchesComplianceLevel\": \"\",\n \"ApprovedPatchesEnableNonSecurity\": \"\",\n \"RejectedPatches\": \"\",\n \"RejectedPatchesAction\": \"\",\n \"Description\": \"\",\n \"Sources\": \"\",\n \"ClientToken\": \"\",\n \"Tags\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreatePatchBaseline")
.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({
OperatingSystem: '',
Name: '',
GlobalFilters: '',
ApprovalRules: '',
ApprovedPatches: '',
ApprovedPatchesComplianceLevel: '',
ApprovedPatchesEnableNonSecurity: '',
RejectedPatches: '',
RejectedPatchesAction: '',
Description: '',
Sources: '',
ClientToken: '',
Tags: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreatePatchBaseline',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
OperatingSystem: '',
Name: '',
GlobalFilters: '',
ApprovalRules: '',
ApprovedPatches: '',
ApprovedPatchesComplianceLevel: '',
ApprovedPatchesEnableNonSecurity: '',
RejectedPatches: '',
RejectedPatchesAction: '',
Description: '',
Sources: '',
ClientToken: '',
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=AmazonSSM.CreatePatchBaseline');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OperatingSystem: '',
Name: '',
GlobalFilters: '',
ApprovalRules: '',
ApprovedPatches: '',
ApprovedPatchesComplianceLevel: '',
ApprovedPatchesEnableNonSecurity: '',
RejectedPatches: '',
RejectedPatchesAction: '',
Description: '',
Sources: '',
ClientToken: '',
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=AmazonSSM.CreatePatchBaseline',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
OperatingSystem: '',
Name: '',
GlobalFilters: '',
ApprovalRules: '',
ApprovedPatches: '',
ApprovedPatchesComplianceLevel: '',
ApprovedPatchesEnableNonSecurity: '',
RejectedPatches: '',
RejectedPatchesAction: '',
Description: '',
Sources: '',
ClientToken: '',
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=AmazonSSM.CreatePatchBaseline';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OperatingSystem":"","Name":"","GlobalFilters":"","ApprovalRules":"","ApprovedPatches":"","ApprovedPatchesComplianceLevel":"","ApprovedPatchesEnableNonSecurity":"","RejectedPatches":"","RejectedPatchesAction":"","Description":"","Sources":"","ClientToken":"","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 = @{ @"OperatingSystem": @"",
@"Name": @"",
@"GlobalFilters": @"",
@"ApprovalRules": @"",
@"ApprovedPatches": @"",
@"ApprovedPatchesComplianceLevel": @"",
@"ApprovedPatchesEnableNonSecurity": @"",
@"RejectedPatches": @"",
@"RejectedPatchesAction": @"",
@"Description": @"",
@"Sources": @"",
@"ClientToken": @"",
@"Tags": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreatePatchBaseline"]
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=AmazonSSM.CreatePatchBaseline" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OperatingSystem\": \"\",\n \"Name\": \"\",\n \"GlobalFilters\": \"\",\n \"ApprovalRules\": \"\",\n \"ApprovedPatches\": \"\",\n \"ApprovedPatchesComplianceLevel\": \"\",\n \"ApprovedPatchesEnableNonSecurity\": \"\",\n \"RejectedPatches\": \"\",\n \"RejectedPatchesAction\": \"\",\n \"Description\": \"\",\n \"Sources\": \"\",\n \"ClientToken\": \"\",\n \"Tags\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreatePatchBaseline",
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([
'OperatingSystem' => '',
'Name' => '',
'GlobalFilters' => '',
'ApprovalRules' => '',
'ApprovedPatches' => '',
'ApprovedPatchesComplianceLevel' => '',
'ApprovedPatchesEnableNonSecurity' => '',
'RejectedPatches' => '',
'RejectedPatchesAction' => '',
'Description' => '',
'Sources' => '',
'ClientToken' => '',
'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=AmazonSSM.CreatePatchBaseline', [
'body' => '{
"OperatingSystem": "",
"Name": "",
"GlobalFilters": "",
"ApprovalRules": "",
"ApprovedPatches": "",
"ApprovedPatchesComplianceLevel": "",
"ApprovedPatchesEnableNonSecurity": "",
"RejectedPatches": "",
"RejectedPatchesAction": "",
"Description": "",
"Sources": "",
"ClientToken": "",
"Tags": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreatePatchBaseline');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OperatingSystem' => '',
'Name' => '',
'GlobalFilters' => '',
'ApprovalRules' => '',
'ApprovedPatches' => '',
'ApprovedPatchesComplianceLevel' => '',
'ApprovedPatchesEnableNonSecurity' => '',
'RejectedPatches' => '',
'RejectedPatchesAction' => '',
'Description' => '',
'Sources' => '',
'ClientToken' => '',
'Tags' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OperatingSystem' => '',
'Name' => '',
'GlobalFilters' => '',
'ApprovalRules' => '',
'ApprovedPatches' => '',
'ApprovedPatchesComplianceLevel' => '',
'ApprovedPatchesEnableNonSecurity' => '',
'RejectedPatches' => '',
'RejectedPatchesAction' => '',
'Description' => '',
'Sources' => '',
'ClientToken' => '',
'Tags' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreatePatchBaseline');
$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=AmazonSSM.CreatePatchBaseline' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OperatingSystem": "",
"Name": "",
"GlobalFilters": "",
"ApprovalRules": "",
"ApprovedPatches": "",
"ApprovedPatchesComplianceLevel": "",
"ApprovedPatchesEnableNonSecurity": "",
"RejectedPatches": "",
"RejectedPatchesAction": "",
"Description": "",
"Sources": "",
"ClientToken": "",
"Tags": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreatePatchBaseline' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OperatingSystem": "",
"Name": "",
"GlobalFilters": "",
"ApprovalRules": "",
"ApprovedPatches": "",
"ApprovedPatchesComplianceLevel": "",
"ApprovedPatchesEnableNonSecurity": "",
"RejectedPatches": "",
"RejectedPatchesAction": "",
"Description": "",
"Sources": "",
"ClientToken": "",
"Tags": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OperatingSystem\": \"\",\n \"Name\": \"\",\n \"GlobalFilters\": \"\",\n \"ApprovalRules\": \"\",\n \"ApprovedPatches\": \"\",\n \"ApprovedPatchesComplianceLevel\": \"\",\n \"ApprovedPatchesEnableNonSecurity\": \"\",\n \"RejectedPatches\": \"\",\n \"RejectedPatchesAction\": \"\",\n \"Description\": \"\",\n \"Sources\": \"\",\n \"ClientToken\": \"\",\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=AmazonSSM.CreatePatchBaseline"
payload = {
"OperatingSystem": "",
"Name": "",
"GlobalFilters": "",
"ApprovalRules": "",
"ApprovedPatches": "",
"ApprovedPatchesComplianceLevel": "",
"ApprovedPatchesEnableNonSecurity": "",
"RejectedPatches": "",
"RejectedPatchesAction": "",
"Description": "",
"Sources": "",
"ClientToken": "",
"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=AmazonSSM.CreatePatchBaseline"
payload <- "{\n \"OperatingSystem\": \"\",\n \"Name\": \"\",\n \"GlobalFilters\": \"\",\n \"ApprovalRules\": \"\",\n \"ApprovedPatches\": \"\",\n \"ApprovedPatchesComplianceLevel\": \"\",\n \"ApprovedPatchesEnableNonSecurity\": \"\",\n \"RejectedPatches\": \"\",\n \"RejectedPatchesAction\": \"\",\n \"Description\": \"\",\n \"Sources\": \"\",\n \"ClientToken\": \"\",\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=AmazonSSM.CreatePatchBaseline")
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 \"OperatingSystem\": \"\",\n \"Name\": \"\",\n \"GlobalFilters\": \"\",\n \"ApprovalRules\": \"\",\n \"ApprovedPatches\": \"\",\n \"ApprovedPatchesComplianceLevel\": \"\",\n \"ApprovedPatchesEnableNonSecurity\": \"\",\n \"RejectedPatches\": \"\",\n \"RejectedPatchesAction\": \"\",\n \"Description\": \"\",\n \"Sources\": \"\",\n \"ClientToken\": \"\",\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 \"OperatingSystem\": \"\",\n \"Name\": \"\",\n \"GlobalFilters\": \"\",\n \"ApprovalRules\": \"\",\n \"ApprovedPatches\": \"\",\n \"ApprovedPatchesComplianceLevel\": \"\",\n \"ApprovedPatchesEnableNonSecurity\": \"\",\n \"RejectedPatches\": \"\",\n \"RejectedPatchesAction\": \"\",\n \"Description\": \"\",\n \"Sources\": \"\",\n \"ClientToken\": \"\",\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=AmazonSSM.CreatePatchBaseline";
let payload = json!({
"OperatingSystem": "",
"Name": "",
"GlobalFilters": "",
"ApprovalRules": "",
"ApprovedPatches": "",
"ApprovedPatchesComplianceLevel": "",
"ApprovedPatchesEnableNonSecurity": "",
"RejectedPatches": "",
"RejectedPatchesAction": "",
"Description": "",
"Sources": "",
"ClientToken": "",
"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=AmazonSSM.CreatePatchBaseline' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OperatingSystem": "",
"Name": "",
"GlobalFilters": "",
"ApprovalRules": "",
"ApprovedPatches": "",
"ApprovedPatchesComplianceLevel": "",
"ApprovedPatchesEnableNonSecurity": "",
"RejectedPatches": "",
"RejectedPatchesAction": "",
"Description": "",
"Sources": "",
"ClientToken": "",
"Tags": ""
}'
echo '{
"OperatingSystem": "",
"Name": "",
"GlobalFilters": "",
"ApprovalRules": "",
"ApprovedPatches": "",
"ApprovedPatchesComplianceLevel": "",
"ApprovedPatchesEnableNonSecurity": "",
"RejectedPatches": "",
"RejectedPatchesAction": "",
"Description": "",
"Sources": "",
"ClientToken": "",
"Tags": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreatePatchBaseline' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OperatingSystem": "",\n "Name": "",\n "GlobalFilters": "",\n "ApprovalRules": "",\n "ApprovedPatches": "",\n "ApprovedPatchesComplianceLevel": "",\n "ApprovedPatchesEnableNonSecurity": "",\n "RejectedPatches": "",\n "RejectedPatchesAction": "",\n "Description": "",\n "Sources": "",\n "ClientToken": "",\n "Tags": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreatePatchBaseline'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OperatingSystem": "",
"Name": "",
"GlobalFilters": "",
"ApprovalRules": "",
"ApprovedPatches": "",
"ApprovedPatchesComplianceLevel": "",
"ApprovedPatchesEnableNonSecurity": "",
"RejectedPatches": "",
"RejectedPatchesAction": "",
"Description": "",
"Sources": "",
"ClientToken": "",
"Tags": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreatePatchBaseline")! 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
CreateResourceDataSync
{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateResourceDataSync
HEADERS
X-Amz-Target
BODY json
{
"SyncName": "",
"S3Destination": "",
"SyncType": "",
"SyncSource": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateResourceDataSync");
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 \"SyncName\": \"\",\n \"S3Destination\": \"\",\n \"SyncType\": \"\",\n \"SyncSource\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateResourceDataSync" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:SyncName ""
:S3Destination ""
:SyncType ""
:SyncSource ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateResourceDataSync"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"SyncName\": \"\",\n \"S3Destination\": \"\",\n \"SyncType\": \"\",\n \"SyncSource\": \"\"\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=AmazonSSM.CreateResourceDataSync"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"SyncName\": \"\",\n \"S3Destination\": \"\",\n \"SyncType\": \"\",\n \"SyncSource\": \"\"\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=AmazonSSM.CreateResourceDataSync");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"SyncName\": \"\",\n \"S3Destination\": \"\",\n \"SyncType\": \"\",\n \"SyncSource\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateResourceDataSync"
payload := strings.NewReader("{\n \"SyncName\": \"\",\n \"S3Destination\": \"\",\n \"SyncType\": \"\",\n \"SyncSource\": \"\"\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: 81
{
"SyncName": "",
"S3Destination": "",
"SyncType": "",
"SyncSource": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateResourceDataSync")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"SyncName\": \"\",\n \"S3Destination\": \"\",\n \"SyncType\": \"\",\n \"SyncSource\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateResourceDataSync"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"SyncName\": \"\",\n \"S3Destination\": \"\",\n \"SyncType\": \"\",\n \"SyncSource\": \"\"\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 \"SyncName\": \"\",\n \"S3Destination\": \"\",\n \"SyncType\": \"\",\n \"SyncSource\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateResourceDataSync")
.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=AmazonSSM.CreateResourceDataSync")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"SyncName\": \"\",\n \"S3Destination\": \"\",\n \"SyncType\": \"\",\n \"SyncSource\": \"\"\n}")
.asString();
const data = JSON.stringify({
SyncName: '',
S3Destination: '',
SyncType: '',
SyncSource: ''
});
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=AmazonSSM.CreateResourceDataSync');
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=AmazonSSM.CreateResourceDataSync',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {SyncName: '', S3Destination: '', SyncType: '', SyncSource: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateResourceDataSync';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"SyncName":"","S3Destination":"","SyncType":"","SyncSource":""}'
};
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=AmazonSSM.CreateResourceDataSync',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "SyncName": "",\n "S3Destination": "",\n "SyncType": "",\n "SyncSource": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"SyncName\": \"\",\n \"S3Destination\": \"\",\n \"SyncType\": \"\",\n \"SyncSource\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateResourceDataSync")
.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({SyncName: '', S3Destination: '', SyncType: '', SyncSource: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateResourceDataSync',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {SyncName: '', S3Destination: '', SyncType: '', SyncSource: ''},
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=AmazonSSM.CreateResourceDataSync');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
SyncName: '',
S3Destination: '',
SyncType: '',
SyncSource: ''
});
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=AmazonSSM.CreateResourceDataSync',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {SyncName: '', S3Destination: '', SyncType: '', SyncSource: ''}
};
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=AmazonSSM.CreateResourceDataSync';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"SyncName":"","S3Destination":"","SyncType":"","SyncSource":""}'
};
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 = @{ @"SyncName": @"",
@"S3Destination": @"",
@"SyncType": @"",
@"SyncSource": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateResourceDataSync"]
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=AmazonSSM.CreateResourceDataSync" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"SyncName\": \"\",\n \"S3Destination\": \"\",\n \"SyncType\": \"\",\n \"SyncSource\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateResourceDataSync",
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([
'SyncName' => '',
'S3Destination' => '',
'SyncType' => '',
'SyncSource' => ''
]),
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=AmazonSSM.CreateResourceDataSync', [
'body' => '{
"SyncName": "",
"S3Destination": "",
"SyncType": "",
"SyncSource": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateResourceDataSync');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'SyncName' => '',
'S3Destination' => '',
'SyncType' => '',
'SyncSource' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'SyncName' => '',
'S3Destination' => '',
'SyncType' => '',
'SyncSource' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateResourceDataSync');
$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=AmazonSSM.CreateResourceDataSync' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SyncName": "",
"S3Destination": "",
"SyncType": "",
"SyncSource": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateResourceDataSync' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SyncName": "",
"S3Destination": "",
"SyncType": "",
"SyncSource": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"SyncName\": \"\",\n \"S3Destination\": \"\",\n \"SyncType\": \"\",\n \"SyncSource\": \"\"\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=AmazonSSM.CreateResourceDataSync"
payload = {
"SyncName": "",
"S3Destination": "",
"SyncType": "",
"SyncSource": ""
}
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=AmazonSSM.CreateResourceDataSync"
payload <- "{\n \"SyncName\": \"\",\n \"S3Destination\": \"\",\n \"SyncType\": \"\",\n \"SyncSource\": \"\"\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=AmazonSSM.CreateResourceDataSync")
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 \"SyncName\": \"\",\n \"S3Destination\": \"\",\n \"SyncType\": \"\",\n \"SyncSource\": \"\"\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 \"SyncName\": \"\",\n \"S3Destination\": \"\",\n \"SyncType\": \"\",\n \"SyncSource\": \"\"\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=AmazonSSM.CreateResourceDataSync";
let payload = json!({
"SyncName": "",
"S3Destination": "",
"SyncType": "",
"SyncSource": ""
});
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=AmazonSSM.CreateResourceDataSync' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"SyncName": "",
"S3Destination": "",
"SyncType": "",
"SyncSource": ""
}'
echo '{
"SyncName": "",
"S3Destination": "",
"SyncType": "",
"SyncSource": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateResourceDataSync' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "SyncName": "",\n "S3Destination": "",\n "SyncType": "",\n "SyncSource": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateResourceDataSync'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"SyncName": "",
"S3Destination": "",
"SyncType": "",
"SyncSource": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.CreateResourceDataSync")! 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
DeleteActivation
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteActivation
HEADERS
X-Amz-Target
BODY json
{
"ActivationId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteActivation");
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 \"ActivationId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteActivation" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ActivationId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteActivation"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ActivationId\": \"\"\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=AmazonSSM.DeleteActivation"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ActivationId\": \"\"\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=AmazonSSM.DeleteActivation");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ActivationId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteActivation"
payload := strings.NewReader("{\n \"ActivationId\": \"\"\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: 24
{
"ActivationId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteActivation")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ActivationId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteActivation"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ActivationId\": \"\"\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 \"ActivationId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteActivation")
.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=AmazonSSM.DeleteActivation")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ActivationId\": \"\"\n}")
.asString();
const data = JSON.stringify({
ActivationId: ''
});
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=AmazonSSM.DeleteActivation');
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=AmazonSSM.DeleteActivation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ActivationId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteActivation';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ActivationId":""}'
};
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=AmazonSSM.DeleteActivation',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ActivationId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ActivationId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteActivation")
.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({ActivationId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteActivation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {ActivationId: ''},
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=AmazonSSM.DeleteActivation');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ActivationId: ''
});
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=AmazonSSM.DeleteActivation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ActivationId: ''}
};
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=AmazonSSM.DeleteActivation';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ActivationId":""}'
};
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 = @{ @"ActivationId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteActivation"]
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=AmazonSSM.DeleteActivation" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"ActivationId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteActivation",
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([
'ActivationId' => ''
]),
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=AmazonSSM.DeleteActivation', [
'body' => '{
"ActivationId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteActivation');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ActivationId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ActivationId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteActivation');
$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=AmazonSSM.DeleteActivation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ActivationId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteActivation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ActivationId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ActivationId\": \"\"\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=AmazonSSM.DeleteActivation"
payload = { "ActivationId": "" }
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=AmazonSSM.DeleteActivation"
payload <- "{\n \"ActivationId\": \"\"\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=AmazonSSM.DeleteActivation")
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 \"ActivationId\": \"\"\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 \"ActivationId\": \"\"\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=AmazonSSM.DeleteActivation";
let payload = json!({"ActivationId": ""});
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=AmazonSSM.DeleteActivation' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ActivationId": ""
}'
echo '{
"ActivationId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteActivation' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ActivationId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteActivation'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["ActivationId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteActivation")! 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
DeleteAssociation
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteAssociation
HEADERS
X-Amz-Target
BODY json
{
"Name": "",
"InstanceId": "",
"AssociationId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteAssociation");
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 \"InstanceId\": \"\",\n \"AssociationId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteAssociation" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Name ""
:InstanceId ""
:AssociationId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteAssociation"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Name\": \"\",\n \"InstanceId\": \"\",\n \"AssociationId\": \"\"\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=AmazonSSM.DeleteAssociation"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Name\": \"\",\n \"InstanceId\": \"\",\n \"AssociationId\": \"\"\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=AmazonSSM.DeleteAssociation");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Name\": \"\",\n \"InstanceId\": \"\",\n \"AssociationId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteAssociation"
payload := strings.NewReader("{\n \"Name\": \"\",\n \"InstanceId\": \"\",\n \"AssociationId\": \"\"\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
{
"Name": "",
"InstanceId": "",
"AssociationId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteAssociation")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Name\": \"\",\n \"InstanceId\": \"\",\n \"AssociationId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteAssociation"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Name\": \"\",\n \"InstanceId\": \"\",\n \"AssociationId\": \"\"\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 \"InstanceId\": \"\",\n \"AssociationId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteAssociation")
.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=AmazonSSM.DeleteAssociation")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Name\": \"\",\n \"InstanceId\": \"\",\n \"AssociationId\": \"\"\n}")
.asString();
const data = JSON.stringify({
Name: '',
InstanceId: '',
AssociationId: ''
});
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=AmazonSSM.DeleteAssociation');
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=AmazonSSM.DeleteAssociation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Name: '', InstanceId: '', AssociationId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteAssociation';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","InstanceId":"","AssociationId":""}'
};
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=AmazonSSM.DeleteAssociation',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Name": "",\n "InstanceId": "",\n "AssociationId": ""\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 \"InstanceId\": \"\",\n \"AssociationId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteAssociation")
.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: '', InstanceId: '', AssociationId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteAssociation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Name: '', InstanceId: '', AssociationId: ''},
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=AmazonSSM.DeleteAssociation');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Name: '',
InstanceId: '',
AssociationId: ''
});
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=AmazonSSM.DeleteAssociation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Name: '', InstanceId: '', AssociationId: ''}
};
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=AmazonSSM.DeleteAssociation';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","InstanceId":"","AssociationId":""}'
};
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": @"",
@"InstanceId": @"",
@"AssociationId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteAssociation"]
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=AmazonSSM.DeleteAssociation" 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 \"InstanceId\": \"\",\n \"AssociationId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteAssociation",
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' => '',
'InstanceId' => '',
'AssociationId' => ''
]),
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=AmazonSSM.DeleteAssociation', [
'body' => '{
"Name": "",
"InstanceId": "",
"AssociationId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteAssociation');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Name' => '',
'InstanceId' => '',
'AssociationId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Name' => '',
'InstanceId' => '',
'AssociationId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteAssociation');
$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=AmazonSSM.DeleteAssociation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"InstanceId": "",
"AssociationId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteAssociation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"InstanceId": "",
"AssociationId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Name\": \"\",\n \"InstanceId\": \"\",\n \"AssociationId\": \"\"\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=AmazonSSM.DeleteAssociation"
payload = {
"Name": "",
"InstanceId": "",
"AssociationId": ""
}
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=AmazonSSM.DeleteAssociation"
payload <- "{\n \"Name\": \"\",\n \"InstanceId\": \"\",\n \"AssociationId\": \"\"\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=AmazonSSM.DeleteAssociation")
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 \"InstanceId\": \"\",\n \"AssociationId\": \"\"\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 \"InstanceId\": \"\",\n \"AssociationId\": \"\"\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=AmazonSSM.DeleteAssociation";
let payload = json!({
"Name": "",
"InstanceId": "",
"AssociationId": ""
});
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=AmazonSSM.DeleteAssociation' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Name": "",
"InstanceId": "",
"AssociationId": ""
}'
echo '{
"Name": "",
"InstanceId": "",
"AssociationId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteAssociation' \
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 "InstanceId": "",\n "AssociationId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteAssociation'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Name": "",
"InstanceId": "",
"AssociationId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteAssociation")! 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
DeleteDocument
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteDocument
HEADERS
X-Amz-Target
BODY json
{
"Name": "",
"DocumentVersion": "",
"VersionName": "",
"Force": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteDocument");
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 \"DocumentVersion\": \"\",\n \"VersionName\": \"\",\n \"Force\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteDocument" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Name ""
:DocumentVersion ""
:VersionName ""
:Force ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteDocument"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"VersionName\": \"\",\n \"Force\": \"\"\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=AmazonSSM.DeleteDocument"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"VersionName\": \"\",\n \"Force\": \"\"\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=AmazonSSM.DeleteDocument");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"VersionName\": \"\",\n \"Force\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteDocument"
payload := strings.NewReader("{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"VersionName\": \"\",\n \"Force\": \"\"\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: 77
{
"Name": "",
"DocumentVersion": "",
"VersionName": "",
"Force": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteDocument")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"VersionName\": \"\",\n \"Force\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteDocument"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"VersionName\": \"\",\n \"Force\": \"\"\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 \"DocumentVersion\": \"\",\n \"VersionName\": \"\",\n \"Force\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteDocument")
.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=AmazonSSM.DeleteDocument")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"VersionName\": \"\",\n \"Force\": \"\"\n}")
.asString();
const data = JSON.stringify({
Name: '',
DocumentVersion: '',
VersionName: '',
Force: ''
});
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=AmazonSSM.DeleteDocument');
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=AmazonSSM.DeleteDocument',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Name: '', DocumentVersion: '', VersionName: '', Force: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteDocument';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","DocumentVersion":"","VersionName":"","Force":""}'
};
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=AmazonSSM.DeleteDocument',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Name": "",\n "DocumentVersion": "",\n "VersionName": "",\n "Force": ""\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 \"DocumentVersion\": \"\",\n \"VersionName\": \"\",\n \"Force\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteDocument")
.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: '', DocumentVersion: '', VersionName: '', Force: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteDocument',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Name: '', DocumentVersion: '', VersionName: '', Force: ''},
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=AmazonSSM.DeleteDocument');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Name: '',
DocumentVersion: '',
VersionName: '',
Force: ''
});
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=AmazonSSM.DeleteDocument',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Name: '', DocumentVersion: '', VersionName: '', Force: ''}
};
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=AmazonSSM.DeleteDocument';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","DocumentVersion":"","VersionName":"","Force":""}'
};
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": @"",
@"DocumentVersion": @"",
@"VersionName": @"",
@"Force": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteDocument"]
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=AmazonSSM.DeleteDocument" 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 \"DocumentVersion\": \"\",\n \"VersionName\": \"\",\n \"Force\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteDocument",
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' => '',
'DocumentVersion' => '',
'VersionName' => '',
'Force' => ''
]),
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=AmazonSSM.DeleteDocument', [
'body' => '{
"Name": "",
"DocumentVersion": "",
"VersionName": "",
"Force": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteDocument');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Name' => '',
'DocumentVersion' => '',
'VersionName' => '',
'Force' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Name' => '',
'DocumentVersion' => '',
'VersionName' => '',
'Force' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteDocument');
$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=AmazonSSM.DeleteDocument' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"DocumentVersion": "",
"VersionName": "",
"Force": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteDocument' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"DocumentVersion": "",
"VersionName": "",
"Force": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"VersionName\": \"\",\n \"Force\": \"\"\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=AmazonSSM.DeleteDocument"
payload = {
"Name": "",
"DocumentVersion": "",
"VersionName": "",
"Force": ""
}
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=AmazonSSM.DeleteDocument"
payload <- "{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"VersionName\": \"\",\n \"Force\": \"\"\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=AmazonSSM.DeleteDocument")
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 \"DocumentVersion\": \"\",\n \"VersionName\": \"\",\n \"Force\": \"\"\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 \"DocumentVersion\": \"\",\n \"VersionName\": \"\",\n \"Force\": \"\"\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=AmazonSSM.DeleteDocument";
let payload = json!({
"Name": "",
"DocumentVersion": "",
"VersionName": "",
"Force": ""
});
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=AmazonSSM.DeleteDocument' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Name": "",
"DocumentVersion": "",
"VersionName": "",
"Force": ""
}'
echo '{
"Name": "",
"DocumentVersion": "",
"VersionName": "",
"Force": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteDocument' \
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 "DocumentVersion": "",\n "VersionName": "",\n "Force": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteDocument'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Name": "",
"DocumentVersion": "",
"VersionName": "",
"Force": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteDocument")! 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
DeleteInventory
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteInventory
HEADERS
X-Amz-Target
BODY json
{
"TypeName": "",
"SchemaDeleteOption": "",
"DryRun": "",
"ClientToken": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteInventory");
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 \"TypeName\": \"\",\n \"SchemaDeleteOption\": \"\",\n \"DryRun\": \"\",\n \"ClientToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteInventory" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:TypeName ""
:SchemaDeleteOption ""
:DryRun ""
:ClientToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteInventory"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"TypeName\": \"\",\n \"SchemaDeleteOption\": \"\",\n \"DryRun\": \"\",\n \"ClientToken\": \"\"\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=AmazonSSM.DeleteInventory"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"TypeName\": \"\",\n \"SchemaDeleteOption\": \"\",\n \"DryRun\": \"\",\n \"ClientToken\": \"\"\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=AmazonSSM.DeleteInventory");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"TypeName\": \"\",\n \"SchemaDeleteOption\": \"\",\n \"DryRun\": \"\",\n \"ClientToken\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteInventory"
payload := strings.NewReader("{\n \"TypeName\": \"\",\n \"SchemaDeleteOption\": \"\",\n \"DryRun\": \"\",\n \"ClientToken\": \"\"\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
{
"TypeName": "",
"SchemaDeleteOption": "",
"DryRun": "",
"ClientToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteInventory")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"TypeName\": \"\",\n \"SchemaDeleteOption\": \"\",\n \"DryRun\": \"\",\n \"ClientToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteInventory"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"TypeName\": \"\",\n \"SchemaDeleteOption\": \"\",\n \"DryRun\": \"\",\n \"ClientToken\": \"\"\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 \"TypeName\": \"\",\n \"SchemaDeleteOption\": \"\",\n \"DryRun\": \"\",\n \"ClientToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteInventory")
.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=AmazonSSM.DeleteInventory")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"TypeName\": \"\",\n \"SchemaDeleteOption\": \"\",\n \"DryRun\": \"\",\n \"ClientToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
TypeName: '',
SchemaDeleteOption: '',
DryRun: '',
ClientToken: ''
});
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=AmazonSSM.DeleteInventory');
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=AmazonSSM.DeleteInventory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {TypeName: '', SchemaDeleteOption: '', DryRun: '', ClientToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteInventory';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"TypeName":"","SchemaDeleteOption":"","DryRun":"","ClientToken":""}'
};
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=AmazonSSM.DeleteInventory',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "TypeName": "",\n "SchemaDeleteOption": "",\n "DryRun": "",\n "ClientToken": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"TypeName\": \"\",\n \"SchemaDeleteOption\": \"\",\n \"DryRun\": \"\",\n \"ClientToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteInventory")
.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({TypeName: '', SchemaDeleteOption: '', DryRun: '', ClientToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteInventory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {TypeName: '', SchemaDeleteOption: '', DryRun: '', ClientToken: ''},
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=AmazonSSM.DeleteInventory');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
TypeName: '',
SchemaDeleteOption: '',
DryRun: '',
ClientToken: ''
});
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=AmazonSSM.DeleteInventory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {TypeName: '', SchemaDeleteOption: '', DryRun: '', ClientToken: ''}
};
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=AmazonSSM.DeleteInventory';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"TypeName":"","SchemaDeleteOption":"","DryRun":"","ClientToken":""}'
};
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 = @{ @"TypeName": @"",
@"SchemaDeleteOption": @"",
@"DryRun": @"",
@"ClientToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteInventory"]
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=AmazonSSM.DeleteInventory" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"TypeName\": \"\",\n \"SchemaDeleteOption\": \"\",\n \"DryRun\": \"\",\n \"ClientToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteInventory",
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([
'TypeName' => '',
'SchemaDeleteOption' => '',
'DryRun' => '',
'ClientToken' => ''
]),
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=AmazonSSM.DeleteInventory', [
'body' => '{
"TypeName": "",
"SchemaDeleteOption": "",
"DryRun": "",
"ClientToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteInventory');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'TypeName' => '',
'SchemaDeleteOption' => '',
'DryRun' => '',
'ClientToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'TypeName' => '',
'SchemaDeleteOption' => '',
'DryRun' => '',
'ClientToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteInventory');
$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=AmazonSSM.DeleteInventory' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"TypeName": "",
"SchemaDeleteOption": "",
"DryRun": "",
"ClientToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteInventory' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"TypeName": "",
"SchemaDeleteOption": "",
"DryRun": "",
"ClientToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"TypeName\": \"\",\n \"SchemaDeleteOption\": \"\",\n \"DryRun\": \"\",\n \"ClientToken\": \"\"\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=AmazonSSM.DeleteInventory"
payload = {
"TypeName": "",
"SchemaDeleteOption": "",
"DryRun": "",
"ClientToken": ""
}
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=AmazonSSM.DeleteInventory"
payload <- "{\n \"TypeName\": \"\",\n \"SchemaDeleteOption\": \"\",\n \"DryRun\": \"\",\n \"ClientToken\": \"\"\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=AmazonSSM.DeleteInventory")
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 \"TypeName\": \"\",\n \"SchemaDeleteOption\": \"\",\n \"DryRun\": \"\",\n \"ClientToken\": \"\"\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 \"TypeName\": \"\",\n \"SchemaDeleteOption\": \"\",\n \"DryRun\": \"\",\n \"ClientToken\": \"\"\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=AmazonSSM.DeleteInventory";
let payload = json!({
"TypeName": "",
"SchemaDeleteOption": "",
"DryRun": "",
"ClientToken": ""
});
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=AmazonSSM.DeleteInventory' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"TypeName": "",
"SchemaDeleteOption": "",
"DryRun": "",
"ClientToken": ""
}'
echo '{
"TypeName": "",
"SchemaDeleteOption": "",
"DryRun": "",
"ClientToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteInventory' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "TypeName": "",\n "SchemaDeleteOption": "",\n "DryRun": "",\n "ClientToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteInventory'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"TypeName": "",
"SchemaDeleteOption": "",
"DryRun": "",
"ClientToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteInventory")! 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
DeleteMaintenanceWindow
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteMaintenanceWindow
HEADERS
X-Amz-Target
BODY json
{
"WindowId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteMaintenanceWindow");
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 \"WindowId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteMaintenanceWindow" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:WindowId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteMaintenanceWindow"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"WindowId\": \"\"\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=AmazonSSM.DeleteMaintenanceWindow"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"WindowId\": \"\"\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=AmazonSSM.DeleteMaintenanceWindow");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"WindowId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteMaintenanceWindow"
payload := strings.NewReader("{\n \"WindowId\": \"\"\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: 20
{
"WindowId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteMaintenanceWindow")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"WindowId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteMaintenanceWindow"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"WindowId\": \"\"\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 \"WindowId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteMaintenanceWindow")
.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=AmazonSSM.DeleteMaintenanceWindow")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"WindowId\": \"\"\n}")
.asString();
const data = JSON.stringify({
WindowId: ''
});
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=AmazonSSM.DeleteMaintenanceWindow');
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=AmazonSSM.DeleteMaintenanceWindow',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {WindowId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteMaintenanceWindow';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowId":""}'
};
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=AmazonSSM.DeleteMaintenanceWindow',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "WindowId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"WindowId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteMaintenanceWindow")
.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({WindowId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteMaintenanceWindow',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {WindowId: ''},
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=AmazonSSM.DeleteMaintenanceWindow');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
WindowId: ''
});
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=AmazonSSM.DeleteMaintenanceWindow',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {WindowId: ''}
};
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=AmazonSSM.DeleteMaintenanceWindow';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowId":""}'
};
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 = @{ @"WindowId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteMaintenanceWindow"]
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=AmazonSSM.DeleteMaintenanceWindow" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"WindowId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteMaintenanceWindow",
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([
'WindowId' => ''
]),
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=AmazonSSM.DeleteMaintenanceWindow', [
'body' => '{
"WindowId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteMaintenanceWindow');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'WindowId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'WindowId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteMaintenanceWindow');
$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=AmazonSSM.DeleteMaintenanceWindow' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteMaintenanceWindow' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"WindowId\": \"\"\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=AmazonSSM.DeleteMaintenanceWindow"
payload = { "WindowId": "" }
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=AmazonSSM.DeleteMaintenanceWindow"
payload <- "{\n \"WindowId\": \"\"\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=AmazonSSM.DeleteMaintenanceWindow")
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 \"WindowId\": \"\"\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 \"WindowId\": \"\"\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=AmazonSSM.DeleteMaintenanceWindow";
let payload = json!({"WindowId": ""});
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=AmazonSSM.DeleteMaintenanceWindow' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"WindowId": ""
}'
echo '{
"WindowId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteMaintenanceWindow' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "WindowId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteMaintenanceWindow'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["WindowId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteMaintenanceWindow")! 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
DeleteOpsMetadata
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteOpsMetadata
HEADERS
X-Amz-Target
BODY json
{
"OpsMetadataArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteOpsMetadata");
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 \"OpsMetadataArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteOpsMetadata" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OpsMetadataArn ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteOpsMetadata"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OpsMetadataArn\": \"\"\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=AmazonSSM.DeleteOpsMetadata"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OpsMetadataArn\": \"\"\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=AmazonSSM.DeleteOpsMetadata");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OpsMetadataArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteOpsMetadata"
payload := strings.NewReader("{\n \"OpsMetadataArn\": \"\"\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: 26
{
"OpsMetadataArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteOpsMetadata")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OpsMetadataArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteOpsMetadata"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OpsMetadataArn\": \"\"\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 \"OpsMetadataArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteOpsMetadata")
.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=AmazonSSM.DeleteOpsMetadata")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OpsMetadataArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
OpsMetadataArn: ''
});
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=AmazonSSM.DeleteOpsMetadata');
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=AmazonSSM.DeleteOpsMetadata',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OpsMetadataArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteOpsMetadata';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OpsMetadataArn":""}'
};
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=AmazonSSM.DeleteOpsMetadata',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OpsMetadataArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OpsMetadataArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteOpsMetadata")
.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({OpsMetadataArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteOpsMetadata',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OpsMetadataArn: ''},
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=AmazonSSM.DeleteOpsMetadata');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OpsMetadataArn: ''
});
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=AmazonSSM.DeleteOpsMetadata',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OpsMetadataArn: ''}
};
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=AmazonSSM.DeleteOpsMetadata';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OpsMetadataArn":""}'
};
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 = @{ @"OpsMetadataArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteOpsMetadata"]
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=AmazonSSM.DeleteOpsMetadata" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OpsMetadataArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteOpsMetadata",
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([
'OpsMetadataArn' => ''
]),
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=AmazonSSM.DeleteOpsMetadata', [
'body' => '{
"OpsMetadataArn": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteOpsMetadata');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OpsMetadataArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OpsMetadataArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteOpsMetadata');
$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=AmazonSSM.DeleteOpsMetadata' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OpsMetadataArn": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteOpsMetadata' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OpsMetadataArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OpsMetadataArn\": \"\"\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=AmazonSSM.DeleteOpsMetadata"
payload = { "OpsMetadataArn": "" }
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=AmazonSSM.DeleteOpsMetadata"
payload <- "{\n \"OpsMetadataArn\": \"\"\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=AmazonSSM.DeleteOpsMetadata")
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 \"OpsMetadataArn\": \"\"\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 \"OpsMetadataArn\": \"\"\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=AmazonSSM.DeleteOpsMetadata";
let payload = json!({"OpsMetadataArn": ""});
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=AmazonSSM.DeleteOpsMetadata' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OpsMetadataArn": ""
}'
echo '{
"OpsMetadataArn": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteOpsMetadata' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OpsMetadataArn": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteOpsMetadata'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["OpsMetadataArn": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteOpsMetadata")! 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
DeleteParameter
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteParameter
HEADERS
X-Amz-Target
BODY json
{
"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=AmazonSSM.DeleteParameter");
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}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteParameter" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Name ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteParameter"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\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=AmazonSSM.DeleteParameter"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\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=AmazonSSM.DeleteParameter");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\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=AmazonSSM.DeleteParameter"
payload := strings.NewReader("{\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: 16
{
"Name": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteParameter")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Name\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteParameter"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\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 \"Name\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteParameter")
.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=AmazonSSM.DeleteParameter")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Name\": \"\"\n}")
.asString();
const data = JSON.stringify({
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=AmazonSSM.DeleteParameter');
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=AmazonSSM.DeleteParameter',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteParameter';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"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=AmazonSSM.DeleteParameter',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\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 \"Name\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteParameter")
.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: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteParameter',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {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=AmazonSSM.DeleteParameter');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
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=AmazonSSM.DeleteParameter',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {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=AmazonSSM.DeleteParameter';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"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 = @{ @"Name": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteParameter"]
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=AmazonSSM.DeleteParameter" 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}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteParameter",
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' => ''
]),
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=AmazonSSM.DeleteParameter', [
'body' => '{
"Name": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteParameter');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Name' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Name' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteParameter');
$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=AmazonSSM.DeleteParameter' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteParameter' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\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=AmazonSSM.DeleteParameter"
payload = { "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=AmazonSSM.DeleteParameter"
payload <- "{\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=AmazonSSM.DeleteParameter")
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}"
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}"
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=AmazonSSM.DeleteParameter";
let payload = json!({"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=AmazonSSM.DeleteParameter' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Name": ""
}'
echo '{
"Name": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteParameter' \
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}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteParameter'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["Name": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteParameter")! 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
DeleteParameters
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteParameters
HEADERS
X-Amz-Target
BODY json
{
"Names": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteParameters");
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 \"Names\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteParameters" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Names ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteParameters"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Names\": \"\"\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=AmazonSSM.DeleteParameters"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Names\": \"\"\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=AmazonSSM.DeleteParameters");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Names\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteParameters"
payload := strings.NewReader("{\n \"Names\": \"\"\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: 17
{
"Names": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteParameters")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Names\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteParameters"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Names\": \"\"\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 \"Names\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteParameters")
.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=AmazonSSM.DeleteParameters")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Names\": \"\"\n}")
.asString();
const data = JSON.stringify({
Names: ''
});
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=AmazonSSM.DeleteParameters');
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=AmazonSSM.DeleteParameters',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Names: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteParameters';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Names":""}'
};
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=AmazonSSM.DeleteParameters',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Names": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Names\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteParameters")
.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({Names: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteParameters',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Names: ''},
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=AmazonSSM.DeleteParameters');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Names: ''
});
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=AmazonSSM.DeleteParameters',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Names: ''}
};
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=AmazonSSM.DeleteParameters';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Names":""}'
};
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 = @{ @"Names": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteParameters"]
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=AmazonSSM.DeleteParameters" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Names\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteParameters",
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([
'Names' => ''
]),
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=AmazonSSM.DeleteParameters', [
'body' => '{
"Names": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteParameters');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Names' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Names' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteParameters');
$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=AmazonSSM.DeleteParameters' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Names": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteParameters' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Names": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Names\": \"\"\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=AmazonSSM.DeleteParameters"
payload = { "Names": "" }
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=AmazonSSM.DeleteParameters"
payload <- "{\n \"Names\": \"\"\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=AmazonSSM.DeleteParameters")
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 \"Names\": \"\"\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 \"Names\": \"\"\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=AmazonSSM.DeleteParameters";
let payload = json!({"Names": ""});
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=AmazonSSM.DeleteParameters' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Names": ""
}'
echo '{
"Names": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteParameters' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Names": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteParameters'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["Names": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteParameters")! 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
DeletePatchBaseline
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeletePatchBaseline
HEADERS
X-Amz-Target
BODY json
{
"BaselineId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeletePatchBaseline");
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 \"BaselineId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeletePatchBaseline" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:BaselineId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeletePatchBaseline"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"BaselineId\": \"\"\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=AmazonSSM.DeletePatchBaseline"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"BaselineId\": \"\"\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=AmazonSSM.DeletePatchBaseline");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"BaselineId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeletePatchBaseline"
payload := strings.NewReader("{\n \"BaselineId\": \"\"\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
{
"BaselineId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeletePatchBaseline")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"BaselineId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeletePatchBaseline"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"BaselineId\": \"\"\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 \"BaselineId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeletePatchBaseline")
.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=AmazonSSM.DeletePatchBaseline")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"BaselineId\": \"\"\n}")
.asString();
const data = JSON.stringify({
BaselineId: ''
});
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=AmazonSSM.DeletePatchBaseline');
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=AmazonSSM.DeletePatchBaseline',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {BaselineId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeletePatchBaseline';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"BaselineId":""}'
};
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=AmazonSSM.DeletePatchBaseline',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "BaselineId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"BaselineId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeletePatchBaseline")
.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({BaselineId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeletePatchBaseline',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {BaselineId: ''},
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=AmazonSSM.DeletePatchBaseline');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
BaselineId: ''
});
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=AmazonSSM.DeletePatchBaseline',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {BaselineId: ''}
};
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=AmazonSSM.DeletePatchBaseline';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"BaselineId":""}'
};
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 = @{ @"BaselineId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeletePatchBaseline"]
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=AmazonSSM.DeletePatchBaseline" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"BaselineId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeletePatchBaseline",
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([
'BaselineId' => ''
]),
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=AmazonSSM.DeletePatchBaseline', [
'body' => '{
"BaselineId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeletePatchBaseline');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'BaselineId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'BaselineId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeletePatchBaseline');
$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=AmazonSSM.DeletePatchBaseline' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"BaselineId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeletePatchBaseline' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"BaselineId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"BaselineId\": \"\"\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=AmazonSSM.DeletePatchBaseline"
payload = { "BaselineId": "" }
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=AmazonSSM.DeletePatchBaseline"
payload <- "{\n \"BaselineId\": \"\"\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=AmazonSSM.DeletePatchBaseline")
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 \"BaselineId\": \"\"\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 \"BaselineId\": \"\"\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=AmazonSSM.DeletePatchBaseline";
let payload = json!({"BaselineId": ""});
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=AmazonSSM.DeletePatchBaseline' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"BaselineId": ""
}'
echo '{
"BaselineId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeletePatchBaseline' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "BaselineId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeletePatchBaseline'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["BaselineId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeletePatchBaseline")! 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
DeleteResourceDataSync
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteResourceDataSync
HEADERS
X-Amz-Target
BODY json
{
"SyncName": "",
"SyncType": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteResourceDataSync");
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 \"SyncName\": \"\",\n \"SyncType\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteResourceDataSync" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:SyncName ""
:SyncType ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteResourceDataSync"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"SyncName\": \"\",\n \"SyncType\": \"\"\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=AmazonSSM.DeleteResourceDataSync"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"SyncName\": \"\",\n \"SyncType\": \"\"\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=AmazonSSM.DeleteResourceDataSync");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"SyncName\": \"\",\n \"SyncType\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteResourceDataSync"
payload := strings.NewReader("{\n \"SyncName\": \"\",\n \"SyncType\": \"\"\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
{
"SyncName": "",
"SyncType": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteResourceDataSync")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"SyncName\": \"\",\n \"SyncType\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteResourceDataSync"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"SyncName\": \"\",\n \"SyncType\": \"\"\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 \"SyncName\": \"\",\n \"SyncType\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteResourceDataSync")
.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=AmazonSSM.DeleteResourceDataSync")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"SyncName\": \"\",\n \"SyncType\": \"\"\n}")
.asString();
const data = JSON.stringify({
SyncName: '',
SyncType: ''
});
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=AmazonSSM.DeleteResourceDataSync');
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=AmazonSSM.DeleteResourceDataSync',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {SyncName: '', SyncType: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteResourceDataSync';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"SyncName":"","SyncType":""}'
};
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=AmazonSSM.DeleteResourceDataSync',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "SyncName": "",\n "SyncType": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"SyncName\": \"\",\n \"SyncType\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteResourceDataSync")
.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({SyncName: '', SyncType: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteResourceDataSync',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {SyncName: '', SyncType: ''},
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=AmazonSSM.DeleteResourceDataSync');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
SyncName: '',
SyncType: ''
});
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=AmazonSSM.DeleteResourceDataSync',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {SyncName: '', SyncType: ''}
};
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=AmazonSSM.DeleteResourceDataSync';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"SyncName":"","SyncType":""}'
};
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 = @{ @"SyncName": @"",
@"SyncType": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteResourceDataSync"]
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=AmazonSSM.DeleteResourceDataSync" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"SyncName\": \"\",\n \"SyncType\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteResourceDataSync",
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([
'SyncName' => '',
'SyncType' => ''
]),
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=AmazonSSM.DeleteResourceDataSync', [
'body' => '{
"SyncName": "",
"SyncType": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteResourceDataSync');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'SyncName' => '',
'SyncType' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'SyncName' => '',
'SyncType' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteResourceDataSync');
$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=AmazonSSM.DeleteResourceDataSync' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SyncName": "",
"SyncType": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteResourceDataSync' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SyncName": "",
"SyncType": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"SyncName\": \"\",\n \"SyncType\": \"\"\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=AmazonSSM.DeleteResourceDataSync"
payload = {
"SyncName": "",
"SyncType": ""
}
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=AmazonSSM.DeleteResourceDataSync"
payload <- "{\n \"SyncName\": \"\",\n \"SyncType\": \"\"\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=AmazonSSM.DeleteResourceDataSync")
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 \"SyncName\": \"\",\n \"SyncType\": \"\"\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 \"SyncName\": \"\",\n \"SyncType\": \"\"\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=AmazonSSM.DeleteResourceDataSync";
let payload = json!({
"SyncName": "",
"SyncType": ""
});
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=AmazonSSM.DeleteResourceDataSync' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"SyncName": "",
"SyncType": ""
}'
echo '{
"SyncName": "",
"SyncType": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteResourceDataSync' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "SyncName": "",\n "SyncType": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteResourceDataSync'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"SyncName": "",
"SyncType": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteResourceDataSync")! 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
DeleteResourcePolicy
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteResourcePolicy
HEADERS
X-Amz-Target
BODY json
{
"ResourceArn": "",
"PolicyId": "",
"PolicyHash": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteResourcePolicy");
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 \"ResourceArn\": \"\",\n \"PolicyId\": \"\",\n \"PolicyHash\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteResourcePolicy" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ResourceArn ""
:PolicyId ""
:PolicyHash ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteResourcePolicy"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ResourceArn\": \"\",\n \"PolicyId\": \"\",\n \"PolicyHash\": \"\"\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=AmazonSSM.DeleteResourcePolicy"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ResourceArn\": \"\",\n \"PolicyId\": \"\",\n \"PolicyHash\": \"\"\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=AmazonSSM.DeleteResourcePolicy");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ResourceArn\": \"\",\n \"PolicyId\": \"\",\n \"PolicyHash\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteResourcePolicy"
payload := strings.NewReader("{\n \"ResourceArn\": \"\",\n \"PolicyId\": \"\",\n \"PolicyHash\": \"\"\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: 61
{
"ResourceArn": "",
"PolicyId": "",
"PolicyHash": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteResourcePolicy")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ResourceArn\": \"\",\n \"PolicyId\": \"\",\n \"PolicyHash\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteResourcePolicy"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ResourceArn\": \"\",\n \"PolicyId\": \"\",\n \"PolicyHash\": \"\"\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 \"ResourceArn\": \"\",\n \"PolicyId\": \"\",\n \"PolicyHash\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteResourcePolicy")
.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=AmazonSSM.DeleteResourcePolicy")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ResourceArn\": \"\",\n \"PolicyId\": \"\",\n \"PolicyHash\": \"\"\n}")
.asString();
const data = JSON.stringify({
ResourceArn: '',
PolicyId: '',
PolicyHash: ''
});
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=AmazonSSM.DeleteResourcePolicy');
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=AmazonSSM.DeleteResourcePolicy',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ResourceArn: '', PolicyId: '', PolicyHash: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteResourcePolicy';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ResourceArn":"","PolicyId":"","PolicyHash":""}'
};
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=AmazonSSM.DeleteResourcePolicy',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ResourceArn": "",\n "PolicyId": "",\n "PolicyHash": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ResourceArn\": \"\",\n \"PolicyId\": \"\",\n \"PolicyHash\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteResourcePolicy")
.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({ResourceArn: '', PolicyId: '', PolicyHash: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteResourcePolicy',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {ResourceArn: '', PolicyId: '', PolicyHash: ''},
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=AmazonSSM.DeleteResourcePolicy');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ResourceArn: '',
PolicyId: '',
PolicyHash: ''
});
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=AmazonSSM.DeleteResourcePolicy',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ResourceArn: '', PolicyId: '', PolicyHash: ''}
};
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=AmazonSSM.DeleteResourcePolicy';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ResourceArn":"","PolicyId":"","PolicyHash":""}'
};
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 = @{ @"ResourceArn": @"",
@"PolicyId": @"",
@"PolicyHash": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteResourcePolicy"]
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=AmazonSSM.DeleteResourcePolicy" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"ResourceArn\": \"\",\n \"PolicyId\": \"\",\n \"PolicyHash\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteResourcePolicy",
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([
'ResourceArn' => '',
'PolicyId' => '',
'PolicyHash' => ''
]),
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=AmazonSSM.DeleteResourcePolicy', [
'body' => '{
"ResourceArn": "",
"PolicyId": "",
"PolicyHash": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteResourcePolicy');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ResourceArn' => '',
'PolicyId' => '',
'PolicyHash' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ResourceArn' => '',
'PolicyId' => '',
'PolicyHash' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteResourcePolicy');
$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=AmazonSSM.DeleteResourcePolicy' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ResourceArn": "",
"PolicyId": "",
"PolicyHash": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteResourcePolicy' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ResourceArn": "",
"PolicyId": "",
"PolicyHash": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ResourceArn\": \"\",\n \"PolicyId\": \"\",\n \"PolicyHash\": \"\"\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=AmazonSSM.DeleteResourcePolicy"
payload = {
"ResourceArn": "",
"PolicyId": "",
"PolicyHash": ""
}
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=AmazonSSM.DeleteResourcePolicy"
payload <- "{\n \"ResourceArn\": \"\",\n \"PolicyId\": \"\",\n \"PolicyHash\": \"\"\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=AmazonSSM.DeleteResourcePolicy")
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 \"ResourceArn\": \"\",\n \"PolicyId\": \"\",\n \"PolicyHash\": \"\"\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 \"ResourceArn\": \"\",\n \"PolicyId\": \"\",\n \"PolicyHash\": \"\"\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=AmazonSSM.DeleteResourcePolicy";
let payload = json!({
"ResourceArn": "",
"PolicyId": "",
"PolicyHash": ""
});
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=AmazonSSM.DeleteResourcePolicy' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ResourceArn": "",
"PolicyId": "",
"PolicyHash": ""
}'
echo '{
"ResourceArn": "",
"PolicyId": "",
"PolicyHash": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteResourcePolicy' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ResourceArn": "",\n "PolicyId": "",\n "PolicyHash": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteResourcePolicy'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"ResourceArn": "",
"PolicyId": "",
"PolicyHash": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeleteResourcePolicy")! 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
DeregisterManagedInstance
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterManagedInstance
HEADERS
X-Amz-Target
BODY json
{
"InstanceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterManagedInstance");
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 \"InstanceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterManagedInstance" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:InstanceId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterManagedInstance"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"InstanceId\": \"\"\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=AmazonSSM.DeregisterManagedInstance"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"InstanceId\": \"\"\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=AmazonSSM.DeregisterManagedInstance");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"InstanceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterManagedInstance"
payload := strings.NewReader("{\n \"InstanceId\": \"\"\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
{
"InstanceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterManagedInstance")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"InstanceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterManagedInstance"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"InstanceId\": \"\"\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 \"InstanceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterManagedInstance")
.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=AmazonSSM.DeregisterManagedInstance")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"InstanceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
InstanceId: ''
});
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=AmazonSSM.DeregisterManagedInstance');
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=AmazonSSM.DeregisterManagedInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterManagedInstance';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":""}'
};
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=AmazonSSM.DeregisterManagedInstance',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "InstanceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"InstanceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterManagedInstance")
.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({InstanceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterManagedInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {InstanceId: ''},
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=AmazonSSM.DeregisterManagedInstance');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
InstanceId: ''
});
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=AmazonSSM.DeregisterManagedInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: ''}
};
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=AmazonSSM.DeregisterManagedInstance';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":""}'
};
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 = @{ @"InstanceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterManagedInstance"]
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=AmazonSSM.DeregisterManagedInstance" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"InstanceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterManagedInstance",
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([
'InstanceId' => ''
]),
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=AmazonSSM.DeregisterManagedInstance', [
'body' => '{
"InstanceId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterManagedInstance');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'InstanceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'InstanceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterManagedInstance');
$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=AmazonSSM.DeregisterManagedInstance' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterManagedInstance' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"InstanceId\": \"\"\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=AmazonSSM.DeregisterManagedInstance"
payload = { "InstanceId": "" }
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=AmazonSSM.DeregisterManagedInstance"
payload <- "{\n \"InstanceId\": \"\"\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=AmazonSSM.DeregisterManagedInstance")
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 \"InstanceId\": \"\"\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 \"InstanceId\": \"\"\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=AmazonSSM.DeregisterManagedInstance";
let payload = json!({"InstanceId": ""});
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=AmazonSSM.DeregisterManagedInstance' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"InstanceId": ""
}'
echo '{
"InstanceId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterManagedInstance' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "InstanceId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterManagedInstance'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["InstanceId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterManagedInstance")! 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
DeregisterPatchBaselineForPatchGroup
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterPatchBaselineForPatchGroup
HEADERS
X-Amz-Target
BODY json
{
"BaselineId": "",
"PatchGroup": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterPatchBaselineForPatchGroup");
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 \"BaselineId\": \"\",\n \"PatchGroup\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterPatchBaselineForPatchGroup" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:BaselineId ""
:PatchGroup ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterPatchBaselineForPatchGroup"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"BaselineId\": \"\",\n \"PatchGroup\": \"\"\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=AmazonSSM.DeregisterPatchBaselineForPatchGroup"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"BaselineId\": \"\",\n \"PatchGroup\": \"\"\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=AmazonSSM.DeregisterPatchBaselineForPatchGroup");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"BaselineId\": \"\",\n \"PatchGroup\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterPatchBaselineForPatchGroup"
payload := strings.NewReader("{\n \"BaselineId\": \"\",\n \"PatchGroup\": \"\"\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
{
"BaselineId": "",
"PatchGroup": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterPatchBaselineForPatchGroup")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"BaselineId\": \"\",\n \"PatchGroup\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterPatchBaselineForPatchGroup"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"BaselineId\": \"\",\n \"PatchGroup\": \"\"\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 \"BaselineId\": \"\",\n \"PatchGroup\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterPatchBaselineForPatchGroup")
.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=AmazonSSM.DeregisterPatchBaselineForPatchGroup")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"BaselineId\": \"\",\n \"PatchGroup\": \"\"\n}")
.asString();
const data = JSON.stringify({
BaselineId: '',
PatchGroup: ''
});
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=AmazonSSM.DeregisterPatchBaselineForPatchGroup');
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=AmazonSSM.DeregisterPatchBaselineForPatchGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {BaselineId: '', PatchGroup: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterPatchBaselineForPatchGroup';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"BaselineId":"","PatchGroup":""}'
};
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=AmazonSSM.DeregisterPatchBaselineForPatchGroup',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "BaselineId": "",\n "PatchGroup": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"BaselineId\": \"\",\n \"PatchGroup\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterPatchBaselineForPatchGroup")
.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({BaselineId: '', PatchGroup: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterPatchBaselineForPatchGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {BaselineId: '', PatchGroup: ''},
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=AmazonSSM.DeregisterPatchBaselineForPatchGroup');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
BaselineId: '',
PatchGroup: ''
});
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=AmazonSSM.DeregisterPatchBaselineForPatchGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {BaselineId: '', PatchGroup: ''}
};
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=AmazonSSM.DeregisterPatchBaselineForPatchGroup';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"BaselineId":"","PatchGroup":""}'
};
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 = @{ @"BaselineId": @"",
@"PatchGroup": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterPatchBaselineForPatchGroup"]
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=AmazonSSM.DeregisterPatchBaselineForPatchGroup" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"BaselineId\": \"\",\n \"PatchGroup\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterPatchBaselineForPatchGroup",
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([
'BaselineId' => '',
'PatchGroup' => ''
]),
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=AmazonSSM.DeregisterPatchBaselineForPatchGroup', [
'body' => '{
"BaselineId": "",
"PatchGroup": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterPatchBaselineForPatchGroup');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'BaselineId' => '',
'PatchGroup' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'BaselineId' => '',
'PatchGroup' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterPatchBaselineForPatchGroup');
$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=AmazonSSM.DeregisterPatchBaselineForPatchGroup' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"BaselineId": "",
"PatchGroup": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterPatchBaselineForPatchGroup' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"BaselineId": "",
"PatchGroup": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"BaselineId\": \"\",\n \"PatchGroup\": \"\"\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=AmazonSSM.DeregisterPatchBaselineForPatchGroup"
payload = {
"BaselineId": "",
"PatchGroup": ""
}
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=AmazonSSM.DeregisterPatchBaselineForPatchGroup"
payload <- "{\n \"BaselineId\": \"\",\n \"PatchGroup\": \"\"\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=AmazonSSM.DeregisterPatchBaselineForPatchGroup")
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 \"BaselineId\": \"\",\n \"PatchGroup\": \"\"\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 \"BaselineId\": \"\",\n \"PatchGroup\": \"\"\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=AmazonSSM.DeregisterPatchBaselineForPatchGroup";
let payload = json!({
"BaselineId": "",
"PatchGroup": ""
});
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=AmazonSSM.DeregisterPatchBaselineForPatchGroup' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"BaselineId": "",
"PatchGroup": ""
}'
echo '{
"BaselineId": "",
"PatchGroup": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterPatchBaselineForPatchGroup' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "BaselineId": "",\n "PatchGroup": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterPatchBaselineForPatchGroup'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"BaselineId": "",
"PatchGroup": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterPatchBaselineForPatchGroup")! 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
DeregisterTargetFromMaintenanceWindow
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterTargetFromMaintenanceWindow
HEADERS
X-Amz-Target
BODY json
{
"WindowId": "",
"WindowTargetId": "",
"Safe": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterTargetFromMaintenanceWindow");
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 \"WindowId\": \"\",\n \"WindowTargetId\": \"\",\n \"Safe\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterTargetFromMaintenanceWindow" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:WindowId ""
:WindowTargetId ""
:Safe ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterTargetFromMaintenanceWindow"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"WindowId\": \"\",\n \"WindowTargetId\": \"\",\n \"Safe\": \"\"\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=AmazonSSM.DeregisterTargetFromMaintenanceWindow"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"WindowId\": \"\",\n \"WindowTargetId\": \"\",\n \"Safe\": \"\"\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=AmazonSSM.DeregisterTargetFromMaintenanceWindow");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"WindowId\": \"\",\n \"WindowTargetId\": \"\",\n \"Safe\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterTargetFromMaintenanceWindow"
payload := strings.NewReader("{\n \"WindowId\": \"\",\n \"WindowTargetId\": \"\",\n \"Safe\": \"\"\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
{
"WindowId": "",
"WindowTargetId": "",
"Safe": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterTargetFromMaintenanceWindow")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"WindowId\": \"\",\n \"WindowTargetId\": \"\",\n \"Safe\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterTargetFromMaintenanceWindow"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"WindowId\": \"\",\n \"WindowTargetId\": \"\",\n \"Safe\": \"\"\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 \"WindowId\": \"\",\n \"WindowTargetId\": \"\",\n \"Safe\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterTargetFromMaintenanceWindow")
.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=AmazonSSM.DeregisterTargetFromMaintenanceWindow")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"WindowId\": \"\",\n \"WindowTargetId\": \"\",\n \"Safe\": \"\"\n}")
.asString();
const data = JSON.stringify({
WindowId: '',
WindowTargetId: '',
Safe: ''
});
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=AmazonSSM.DeregisterTargetFromMaintenanceWindow');
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=AmazonSSM.DeregisterTargetFromMaintenanceWindow',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {WindowId: '', WindowTargetId: '', Safe: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterTargetFromMaintenanceWindow';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowId":"","WindowTargetId":"","Safe":""}'
};
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=AmazonSSM.DeregisterTargetFromMaintenanceWindow',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "WindowId": "",\n "WindowTargetId": "",\n "Safe": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"WindowId\": \"\",\n \"WindowTargetId\": \"\",\n \"Safe\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterTargetFromMaintenanceWindow")
.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({WindowId: '', WindowTargetId: '', Safe: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterTargetFromMaintenanceWindow',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {WindowId: '', WindowTargetId: '', Safe: ''},
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=AmazonSSM.DeregisterTargetFromMaintenanceWindow');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
WindowId: '',
WindowTargetId: '',
Safe: ''
});
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=AmazonSSM.DeregisterTargetFromMaintenanceWindow',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {WindowId: '', WindowTargetId: '', Safe: ''}
};
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=AmazonSSM.DeregisterTargetFromMaintenanceWindow';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowId":"","WindowTargetId":"","Safe":""}'
};
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 = @{ @"WindowId": @"",
@"WindowTargetId": @"",
@"Safe": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterTargetFromMaintenanceWindow"]
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=AmazonSSM.DeregisterTargetFromMaintenanceWindow" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"WindowId\": \"\",\n \"WindowTargetId\": \"\",\n \"Safe\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterTargetFromMaintenanceWindow",
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([
'WindowId' => '',
'WindowTargetId' => '',
'Safe' => ''
]),
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=AmazonSSM.DeregisterTargetFromMaintenanceWindow', [
'body' => '{
"WindowId": "",
"WindowTargetId": "",
"Safe": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterTargetFromMaintenanceWindow');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'WindowId' => '',
'WindowTargetId' => '',
'Safe' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'WindowId' => '',
'WindowTargetId' => '',
'Safe' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterTargetFromMaintenanceWindow');
$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=AmazonSSM.DeregisterTargetFromMaintenanceWindow' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowId": "",
"WindowTargetId": "",
"Safe": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterTargetFromMaintenanceWindow' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowId": "",
"WindowTargetId": "",
"Safe": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"WindowId\": \"\",\n \"WindowTargetId\": \"\",\n \"Safe\": \"\"\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=AmazonSSM.DeregisterTargetFromMaintenanceWindow"
payload = {
"WindowId": "",
"WindowTargetId": "",
"Safe": ""
}
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=AmazonSSM.DeregisterTargetFromMaintenanceWindow"
payload <- "{\n \"WindowId\": \"\",\n \"WindowTargetId\": \"\",\n \"Safe\": \"\"\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=AmazonSSM.DeregisterTargetFromMaintenanceWindow")
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 \"WindowId\": \"\",\n \"WindowTargetId\": \"\",\n \"Safe\": \"\"\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 \"WindowId\": \"\",\n \"WindowTargetId\": \"\",\n \"Safe\": \"\"\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=AmazonSSM.DeregisterTargetFromMaintenanceWindow";
let payload = json!({
"WindowId": "",
"WindowTargetId": "",
"Safe": ""
});
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=AmazonSSM.DeregisterTargetFromMaintenanceWindow' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"WindowId": "",
"WindowTargetId": "",
"Safe": ""
}'
echo '{
"WindowId": "",
"WindowTargetId": "",
"Safe": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterTargetFromMaintenanceWindow' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "WindowId": "",\n "WindowTargetId": "",\n "Safe": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterTargetFromMaintenanceWindow'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"WindowId": "",
"WindowTargetId": "",
"Safe": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterTargetFromMaintenanceWindow")! 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
DeregisterTaskFromMaintenanceWindow
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterTaskFromMaintenanceWindow
HEADERS
X-Amz-Target
BODY json
{
"WindowId": "",
"WindowTaskId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterTaskFromMaintenanceWindow");
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 \"WindowId\": \"\",\n \"WindowTaskId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterTaskFromMaintenanceWindow" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:WindowId ""
:WindowTaskId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterTaskFromMaintenanceWindow"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"WindowId\": \"\",\n \"WindowTaskId\": \"\"\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=AmazonSSM.DeregisterTaskFromMaintenanceWindow"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"WindowId\": \"\",\n \"WindowTaskId\": \"\"\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=AmazonSSM.DeregisterTaskFromMaintenanceWindow");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"WindowId\": \"\",\n \"WindowTaskId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterTaskFromMaintenanceWindow"
payload := strings.NewReader("{\n \"WindowId\": \"\",\n \"WindowTaskId\": \"\"\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
{
"WindowId": "",
"WindowTaskId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterTaskFromMaintenanceWindow")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"WindowId\": \"\",\n \"WindowTaskId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterTaskFromMaintenanceWindow"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"WindowId\": \"\",\n \"WindowTaskId\": \"\"\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 \"WindowId\": \"\",\n \"WindowTaskId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterTaskFromMaintenanceWindow")
.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=AmazonSSM.DeregisterTaskFromMaintenanceWindow")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"WindowId\": \"\",\n \"WindowTaskId\": \"\"\n}")
.asString();
const data = JSON.stringify({
WindowId: '',
WindowTaskId: ''
});
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=AmazonSSM.DeregisterTaskFromMaintenanceWindow');
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=AmazonSSM.DeregisterTaskFromMaintenanceWindow',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {WindowId: '', WindowTaskId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterTaskFromMaintenanceWindow';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowId":"","WindowTaskId":""}'
};
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=AmazonSSM.DeregisterTaskFromMaintenanceWindow',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "WindowId": "",\n "WindowTaskId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"WindowId\": \"\",\n \"WindowTaskId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterTaskFromMaintenanceWindow")
.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({WindowId: '', WindowTaskId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterTaskFromMaintenanceWindow',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {WindowId: '', WindowTaskId: ''},
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=AmazonSSM.DeregisterTaskFromMaintenanceWindow');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
WindowId: '',
WindowTaskId: ''
});
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=AmazonSSM.DeregisterTaskFromMaintenanceWindow',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {WindowId: '', WindowTaskId: ''}
};
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=AmazonSSM.DeregisterTaskFromMaintenanceWindow';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowId":"","WindowTaskId":""}'
};
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 = @{ @"WindowId": @"",
@"WindowTaskId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterTaskFromMaintenanceWindow"]
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=AmazonSSM.DeregisterTaskFromMaintenanceWindow" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"WindowId\": \"\",\n \"WindowTaskId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterTaskFromMaintenanceWindow",
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([
'WindowId' => '',
'WindowTaskId' => ''
]),
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=AmazonSSM.DeregisterTaskFromMaintenanceWindow', [
'body' => '{
"WindowId": "",
"WindowTaskId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterTaskFromMaintenanceWindow');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'WindowId' => '',
'WindowTaskId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'WindowId' => '',
'WindowTaskId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterTaskFromMaintenanceWindow');
$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=AmazonSSM.DeregisterTaskFromMaintenanceWindow' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowId": "",
"WindowTaskId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterTaskFromMaintenanceWindow' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowId": "",
"WindowTaskId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"WindowId\": \"\",\n \"WindowTaskId\": \"\"\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=AmazonSSM.DeregisterTaskFromMaintenanceWindow"
payload = {
"WindowId": "",
"WindowTaskId": ""
}
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=AmazonSSM.DeregisterTaskFromMaintenanceWindow"
payload <- "{\n \"WindowId\": \"\",\n \"WindowTaskId\": \"\"\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=AmazonSSM.DeregisterTaskFromMaintenanceWindow")
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 \"WindowId\": \"\",\n \"WindowTaskId\": \"\"\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 \"WindowId\": \"\",\n \"WindowTaskId\": \"\"\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=AmazonSSM.DeregisterTaskFromMaintenanceWindow";
let payload = json!({
"WindowId": "",
"WindowTaskId": ""
});
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=AmazonSSM.DeregisterTaskFromMaintenanceWindow' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"WindowId": "",
"WindowTaskId": ""
}'
echo '{
"WindowId": "",
"WindowTaskId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterTaskFromMaintenanceWindow' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "WindowId": "",\n "WindowTaskId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterTaskFromMaintenanceWindow'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"WindowId": "",
"WindowTaskId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DeregisterTaskFromMaintenanceWindow")! 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
DescribeActivations
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeActivations
HEADERS
X-Amz-Target
BODY json
{
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeActivations");
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 \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeActivations" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Filters ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeActivations"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeActivations"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeActivations");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeActivations"
payload := strings.NewReader("{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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
{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeActivations")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeActivations"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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 \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeActivations")
.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=AmazonSSM.DescribeActivations")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
Filters: '',
MaxResults: '',
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=AmazonSSM.DescribeActivations');
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=AmazonSSM.DescribeActivations',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Filters: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeActivations';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Filters":"","MaxResults":"","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=AmazonSSM.DescribeActivations',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Filters": "",\n "MaxResults": "",\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 \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeActivations")
.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({Filters: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeActivations',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Filters: '', MaxResults: '', 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=AmazonSSM.DescribeActivations');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Filters: '',
MaxResults: '',
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=AmazonSSM.DescribeActivations',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Filters: '', MaxResults: '', 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=AmazonSSM.DescribeActivations';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Filters":"","MaxResults":"","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 = @{ @"Filters": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeActivations"]
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=AmazonSSM.DescribeActivations" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeActivations",
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([
'Filters' => '',
'MaxResults' => '',
'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=AmazonSSM.DescribeActivations', [
'body' => '{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeActivations');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Filters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Filters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeActivations');
$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=AmazonSSM.DescribeActivations' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeActivations' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeActivations"
payload = {
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeActivations"
payload <- "{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeActivations")
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 \"Filters\": \"\",\n \"MaxResults\": \"\",\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 \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeActivations";
let payload = json!({
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeActivations' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeActivations' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Filters": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeActivations'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Filters": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeActivations")! 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
DescribeAssociation
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociation
HEADERS
X-Amz-Target
BODY json
{
"Name": "",
"InstanceId": "",
"AssociationId": "",
"AssociationVersion": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociation");
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 \"InstanceId\": \"\",\n \"AssociationId\": \"\",\n \"AssociationVersion\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociation" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Name ""
:InstanceId ""
:AssociationId ""
:AssociationVersion ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociation"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Name\": \"\",\n \"InstanceId\": \"\",\n \"AssociationId\": \"\",\n \"AssociationVersion\": \"\"\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=AmazonSSM.DescribeAssociation"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Name\": \"\",\n \"InstanceId\": \"\",\n \"AssociationId\": \"\",\n \"AssociationVersion\": \"\"\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=AmazonSSM.DescribeAssociation");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Name\": \"\",\n \"InstanceId\": \"\",\n \"AssociationId\": \"\",\n \"AssociationVersion\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociation"
payload := strings.NewReader("{\n \"Name\": \"\",\n \"InstanceId\": \"\",\n \"AssociationId\": \"\",\n \"AssociationVersion\": \"\"\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: 87
{
"Name": "",
"InstanceId": "",
"AssociationId": "",
"AssociationVersion": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociation")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Name\": \"\",\n \"InstanceId\": \"\",\n \"AssociationId\": \"\",\n \"AssociationVersion\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociation"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Name\": \"\",\n \"InstanceId\": \"\",\n \"AssociationId\": \"\",\n \"AssociationVersion\": \"\"\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 \"InstanceId\": \"\",\n \"AssociationId\": \"\",\n \"AssociationVersion\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociation")
.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=AmazonSSM.DescribeAssociation")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Name\": \"\",\n \"InstanceId\": \"\",\n \"AssociationId\": \"\",\n \"AssociationVersion\": \"\"\n}")
.asString();
const data = JSON.stringify({
Name: '',
InstanceId: '',
AssociationId: '',
AssociationVersion: ''
});
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=AmazonSSM.DescribeAssociation');
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=AmazonSSM.DescribeAssociation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Name: '', InstanceId: '', AssociationId: '', AssociationVersion: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociation';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","InstanceId":"","AssociationId":"","AssociationVersion":""}'
};
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=AmazonSSM.DescribeAssociation',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Name": "",\n "InstanceId": "",\n "AssociationId": "",\n "AssociationVersion": ""\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 \"InstanceId\": \"\",\n \"AssociationId\": \"\",\n \"AssociationVersion\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociation")
.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: '', InstanceId: '', AssociationId: '', AssociationVersion: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Name: '', InstanceId: '', AssociationId: '', AssociationVersion: ''},
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=AmazonSSM.DescribeAssociation');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Name: '',
InstanceId: '',
AssociationId: '',
AssociationVersion: ''
});
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=AmazonSSM.DescribeAssociation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Name: '', InstanceId: '', AssociationId: '', AssociationVersion: ''}
};
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=AmazonSSM.DescribeAssociation';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","InstanceId":"","AssociationId":"","AssociationVersion":""}'
};
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": @"",
@"InstanceId": @"",
@"AssociationId": @"",
@"AssociationVersion": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociation"]
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=AmazonSSM.DescribeAssociation" 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 \"InstanceId\": \"\",\n \"AssociationId\": \"\",\n \"AssociationVersion\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociation",
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' => '',
'InstanceId' => '',
'AssociationId' => '',
'AssociationVersion' => ''
]),
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=AmazonSSM.DescribeAssociation', [
'body' => '{
"Name": "",
"InstanceId": "",
"AssociationId": "",
"AssociationVersion": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociation');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Name' => '',
'InstanceId' => '',
'AssociationId' => '',
'AssociationVersion' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Name' => '',
'InstanceId' => '',
'AssociationId' => '',
'AssociationVersion' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociation');
$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=AmazonSSM.DescribeAssociation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"InstanceId": "",
"AssociationId": "",
"AssociationVersion": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"InstanceId": "",
"AssociationId": "",
"AssociationVersion": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Name\": \"\",\n \"InstanceId\": \"\",\n \"AssociationId\": \"\",\n \"AssociationVersion\": \"\"\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=AmazonSSM.DescribeAssociation"
payload = {
"Name": "",
"InstanceId": "",
"AssociationId": "",
"AssociationVersion": ""
}
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=AmazonSSM.DescribeAssociation"
payload <- "{\n \"Name\": \"\",\n \"InstanceId\": \"\",\n \"AssociationId\": \"\",\n \"AssociationVersion\": \"\"\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=AmazonSSM.DescribeAssociation")
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 \"InstanceId\": \"\",\n \"AssociationId\": \"\",\n \"AssociationVersion\": \"\"\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 \"InstanceId\": \"\",\n \"AssociationId\": \"\",\n \"AssociationVersion\": \"\"\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=AmazonSSM.DescribeAssociation";
let payload = json!({
"Name": "",
"InstanceId": "",
"AssociationId": "",
"AssociationVersion": ""
});
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=AmazonSSM.DescribeAssociation' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Name": "",
"InstanceId": "",
"AssociationId": "",
"AssociationVersion": ""
}'
echo '{
"Name": "",
"InstanceId": "",
"AssociationId": "",
"AssociationVersion": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociation' \
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 "InstanceId": "",\n "AssociationId": "",\n "AssociationVersion": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociation'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Name": "",
"InstanceId": "",
"AssociationId": "",
"AssociationVersion": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociation")! 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
DescribeAssociationExecutionTargets
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociationExecutionTargets
HEADERS
X-Amz-Target
BODY json
{
"AssociationId": "",
"ExecutionId": "",
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeAssociationExecutionTargets");
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 \"AssociationId\": \"\",\n \"ExecutionId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociationExecutionTargets" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:AssociationId ""
:ExecutionId ""
:Filters ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociationExecutionTargets"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"AssociationId\": \"\",\n \"ExecutionId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeAssociationExecutionTargets"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"AssociationId\": \"\",\n \"ExecutionId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeAssociationExecutionTargets");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AssociationId\": \"\",\n \"ExecutionId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeAssociationExecutionTargets"
payload := strings.NewReader("{\n \"AssociationId\": \"\",\n \"ExecutionId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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: 102
{
"AssociationId": "",
"ExecutionId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociationExecutionTargets")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"AssociationId\": \"\",\n \"ExecutionId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociationExecutionTargets"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AssociationId\": \"\",\n \"ExecutionId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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 \"AssociationId\": \"\",\n \"ExecutionId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociationExecutionTargets")
.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=AmazonSSM.DescribeAssociationExecutionTargets")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"AssociationId\": \"\",\n \"ExecutionId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
AssociationId: '',
ExecutionId: '',
Filters: '',
MaxResults: '',
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=AmazonSSM.DescribeAssociationExecutionTargets');
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=AmazonSSM.DescribeAssociationExecutionTargets',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AssociationId: '', ExecutionId: '', Filters: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociationExecutionTargets';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AssociationId":"","ExecutionId":"","Filters":"","MaxResults":"","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=AmazonSSM.DescribeAssociationExecutionTargets',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "AssociationId": "",\n "ExecutionId": "",\n "Filters": "",\n "MaxResults": "",\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 \"AssociationId\": \"\",\n \"ExecutionId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociationExecutionTargets")
.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({AssociationId: '', ExecutionId: '', Filters: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociationExecutionTargets',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {AssociationId: '', ExecutionId: '', Filters: '', MaxResults: '', 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=AmazonSSM.DescribeAssociationExecutionTargets');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
AssociationId: '',
ExecutionId: '',
Filters: '',
MaxResults: '',
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=AmazonSSM.DescribeAssociationExecutionTargets',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AssociationId: '', ExecutionId: '', Filters: '', MaxResults: '', 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=AmazonSSM.DescribeAssociationExecutionTargets';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AssociationId":"","ExecutionId":"","Filters":"","MaxResults":"","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 = @{ @"AssociationId": @"",
@"ExecutionId": @"",
@"Filters": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociationExecutionTargets"]
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=AmazonSSM.DescribeAssociationExecutionTargets" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"AssociationId\": \"\",\n \"ExecutionId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociationExecutionTargets",
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([
'AssociationId' => '',
'ExecutionId' => '',
'Filters' => '',
'MaxResults' => '',
'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=AmazonSSM.DescribeAssociationExecutionTargets', [
'body' => '{
"AssociationId": "",
"ExecutionId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociationExecutionTargets');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AssociationId' => '',
'ExecutionId' => '',
'Filters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AssociationId' => '',
'ExecutionId' => '',
'Filters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociationExecutionTargets');
$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=AmazonSSM.DescribeAssociationExecutionTargets' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AssociationId": "",
"ExecutionId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociationExecutionTargets' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AssociationId": "",
"ExecutionId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AssociationId\": \"\",\n \"ExecutionId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeAssociationExecutionTargets"
payload = {
"AssociationId": "",
"ExecutionId": "",
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeAssociationExecutionTargets"
payload <- "{\n \"AssociationId\": \"\",\n \"ExecutionId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeAssociationExecutionTargets")
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 \"AssociationId\": \"\",\n \"ExecutionId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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 \"AssociationId\": \"\",\n \"ExecutionId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeAssociationExecutionTargets";
let payload = json!({
"AssociationId": "",
"ExecutionId": "",
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeAssociationExecutionTargets' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"AssociationId": "",
"ExecutionId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"AssociationId": "",
"ExecutionId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociationExecutionTargets' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "AssociationId": "",\n "ExecutionId": "",\n "Filters": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociationExecutionTargets'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"AssociationId": "",
"ExecutionId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociationExecutionTargets")! 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
DescribeAssociationExecutions
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociationExecutions
HEADERS
X-Amz-Target
BODY json
{
"AssociationId": "",
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeAssociationExecutions");
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 \"AssociationId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociationExecutions" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:AssociationId ""
:Filters ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociationExecutions"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"AssociationId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeAssociationExecutions"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"AssociationId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeAssociationExecutions");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AssociationId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeAssociationExecutions"
payload := strings.NewReader("{\n \"AssociationId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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: 81
{
"AssociationId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociationExecutions")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"AssociationId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociationExecutions"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AssociationId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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 \"AssociationId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociationExecutions")
.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=AmazonSSM.DescribeAssociationExecutions")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"AssociationId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
AssociationId: '',
Filters: '',
MaxResults: '',
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=AmazonSSM.DescribeAssociationExecutions');
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=AmazonSSM.DescribeAssociationExecutions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AssociationId: '', Filters: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociationExecutions';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AssociationId":"","Filters":"","MaxResults":"","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=AmazonSSM.DescribeAssociationExecutions',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "AssociationId": "",\n "Filters": "",\n "MaxResults": "",\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 \"AssociationId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociationExecutions")
.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({AssociationId: '', Filters: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociationExecutions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {AssociationId: '', Filters: '', MaxResults: '', 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=AmazonSSM.DescribeAssociationExecutions');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
AssociationId: '',
Filters: '',
MaxResults: '',
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=AmazonSSM.DescribeAssociationExecutions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AssociationId: '', Filters: '', MaxResults: '', 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=AmazonSSM.DescribeAssociationExecutions';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AssociationId":"","Filters":"","MaxResults":"","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 = @{ @"AssociationId": @"",
@"Filters": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociationExecutions"]
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=AmazonSSM.DescribeAssociationExecutions" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"AssociationId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociationExecutions",
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([
'AssociationId' => '',
'Filters' => '',
'MaxResults' => '',
'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=AmazonSSM.DescribeAssociationExecutions', [
'body' => '{
"AssociationId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociationExecutions');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AssociationId' => '',
'Filters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AssociationId' => '',
'Filters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociationExecutions');
$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=AmazonSSM.DescribeAssociationExecutions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AssociationId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociationExecutions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AssociationId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AssociationId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeAssociationExecutions"
payload = {
"AssociationId": "",
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeAssociationExecutions"
payload <- "{\n \"AssociationId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeAssociationExecutions")
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 \"AssociationId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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 \"AssociationId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeAssociationExecutions";
let payload = json!({
"AssociationId": "",
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeAssociationExecutions' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"AssociationId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"AssociationId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociationExecutions' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "AssociationId": "",\n "Filters": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociationExecutions'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"AssociationId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAssociationExecutions")! 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
DescribeAutomationExecutions
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAutomationExecutions
HEADERS
X-Amz-Target
BODY json
{
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeAutomationExecutions");
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 \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAutomationExecutions" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Filters ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAutomationExecutions"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeAutomationExecutions"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeAutomationExecutions");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeAutomationExecutions"
payload := strings.NewReader("{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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
{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAutomationExecutions")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAutomationExecutions"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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 \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAutomationExecutions")
.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=AmazonSSM.DescribeAutomationExecutions")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
Filters: '',
MaxResults: '',
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=AmazonSSM.DescribeAutomationExecutions');
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=AmazonSSM.DescribeAutomationExecutions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Filters: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAutomationExecutions';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Filters":"","MaxResults":"","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=AmazonSSM.DescribeAutomationExecutions',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Filters": "",\n "MaxResults": "",\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 \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAutomationExecutions")
.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({Filters: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAutomationExecutions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Filters: '', MaxResults: '', 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=AmazonSSM.DescribeAutomationExecutions');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Filters: '',
MaxResults: '',
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=AmazonSSM.DescribeAutomationExecutions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Filters: '', MaxResults: '', 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=AmazonSSM.DescribeAutomationExecutions';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Filters":"","MaxResults":"","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 = @{ @"Filters": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAutomationExecutions"]
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=AmazonSSM.DescribeAutomationExecutions" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAutomationExecutions",
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([
'Filters' => '',
'MaxResults' => '',
'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=AmazonSSM.DescribeAutomationExecutions', [
'body' => '{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAutomationExecutions');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Filters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Filters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAutomationExecutions');
$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=AmazonSSM.DescribeAutomationExecutions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAutomationExecutions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeAutomationExecutions"
payload = {
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeAutomationExecutions"
payload <- "{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeAutomationExecutions")
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 \"Filters\": \"\",\n \"MaxResults\": \"\",\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 \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeAutomationExecutions";
let payload = json!({
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeAutomationExecutions' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAutomationExecutions' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Filters": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAutomationExecutions'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Filters": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAutomationExecutions")! 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
DescribeAutomationStepExecutions
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAutomationStepExecutions
HEADERS
X-Amz-Target
BODY json
{
"AutomationExecutionId": "",
"Filters": "",
"NextToken": "",
"MaxResults": "",
"ReverseOrder": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAutomationStepExecutions");
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 \"AutomationExecutionId\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"ReverseOrder\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAutomationStepExecutions" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:AutomationExecutionId ""
:Filters ""
:NextToken ""
:MaxResults ""
:ReverseOrder ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAutomationStepExecutions"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"AutomationExecutionId\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"ReverseOrder\": \"\"\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=AmazonSSM.DescribeAutomationStepExecutions"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"AutomationExecutionId\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"ReverseOrder\": \"\"\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=AmazonSSM.DescribeAutomationStepExecutions");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AutomationExecutionId\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"ReverseOrder\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAutomationStepExecutions"
payload := strings.NewReader("{\n \"AutomationExecutionId\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"ReverseOrder\": \"\"\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: 111
{
"AutomationExecutionId": "",
"Filters": "",
"NextToken": "",
"MaxResults": "",
"ReverseOrder": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAutomationStepExecutions")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"AutomationExecutionId\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"ReverseOrder\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAutomationStepExecutions"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AutomationExecutionId\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"ReverseOrder\": \"\"\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 \"AutomationExecutionId\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"ReverseOrder\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAutomationStepExecutions")
.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=AmazonSSM.DescribeAutomationStepExecutions")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"AutomationExecutionId\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"ReverseOrder\": \"\"\n}")
.asString();
const data = JSON.stringify({
AutomationExecutionId: '',
Filters: '',
NextToken: '',
MaxResults: '',
ReverseOrder: ''
});
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=AmazonSSM.DescribeAutomationStepExecutions');
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=AmazonSSM.DescribeAutomationStepExecutions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
AutomationExecutionId: '',
Filters: '',
NextToken: '',
MaxResults: '',
ReverseOrder: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAutomationStepExecutions';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AutomationExecutionId":"","Filters":"","NextToken":"","MaxResults":"","ReverseOrder":""}'
};
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=AmazonSSM.DescribeAutomationStepExecutions',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "AutomationExecutionId": "",\n "Filters": "",\n "NextToken": "",\n "MaxResults": "",\n "ReverseOrder": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AutomationExecutionId\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"ReverseOrder\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAutomationStepExecutions")
.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({
AutomationExecutionId: '',
Filters: '',
NextToken: '',
MaxResults: '',
ReverseOrder: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAutomationStepExecutions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
AutomationExecutionId: '',
Filters: '',
NextToken: '',
MaxResults: '',
ReverseOrder: ''
},
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=AmazonSSM.DescribeAutomationStepExecutions');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
AutomationExecutionId: '',
Filters: '',
NextToken: '',
MaxResults: '',
ReverseOrder: ''
});
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=AmazonSSM.DescribeAutomationStepExecutions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
AutomationExecutionId: '',
Filters: '',
NextToken: '',
MaxResults: '',
ReverseOrder: ''
}
};
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=AmazonSSM.DescribeAutomationStepExecutions';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AutomationExecutionId":"","Filters":"","NextToken":"","MaxResults":"","ReverseOrder":""}'
};
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 = @{ @"AutomationExecutionId": @"",
@"Filters": @"",
@"NextToken": @"",
@"MaxResults": @"",
@"ReverseOrder": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAutomationStepExecutions"]
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=AmazonSSM.DescribeAutomationStepExecutions" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"AutomationExecutionId\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"ReverseOrder\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAutomationStepExecutions",
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([
'AutomationExecutionId' => '',
'Filters' => '',
'NextToken' => '',
'MaxResults' => '',
'ReverseOrder' => ''
]),
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=AmazonSSM.DescribeAutomationStepExecutions', [
'body' => '{
"AutomationExecutionId": "",
"Filters": "",
"NextToken": "",
"MaxResults": "",
"ReverseOrder": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAutomationStepExecutions');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AutomationExecutionId' => '',
'Filters' => '',
'NextToken' => '',
'MaxResults' => '',
'ReverseOrder' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AutomationExecutionId' => '',
'Filters' => '',
'NextToken' => '',
'MaxResults' => '',
'ReverseOrder' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAutomationStepExecutions');
$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=AmazonSSM.DescribeAutomationStepExecutions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AutomationExecutionId": "",
"Filters": "",
"NextToken": "",
"MaxResults": "",
"ReverseOrder": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAutomationStepExecutions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AutomationExecutionId": "",
"Filters": "",
"NextToken": "",
"MaxResults": "",
"ReverseOrder": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AutomationExecutionId\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"ReverseOrder\": \"\"\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=AmazonSSM.DescribeAutomationStepExecutions"
payload = {
"AutomationExecutionId": "",
"Filters": "",
"NextToken": "",
"MaxResults": "",
"ReverseOrder": ""
}
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=AmazonSSM.DescribeAutomationStepExecutions"
payload <- "{\n \"AutomationExecutionId\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"ReverseOrder\": \"\"\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=AmazonSSM.DescribeAutomationStepExecutions")
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 \"AutomationExecutionId\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"ReverseOrder\": \"\"\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 \"AutomationExecutionId\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"ReverseOrder\": \"\"\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=AmazonSSM.DescribeAutomationStepExecutions";
let payload = json!({
"AutomationExecutionId": "",
"Filters": "",
"NextToken": "",
"MaxResults": "",
"ReverseOrder": ""
});
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=AmazonSSM.DescribeAutomationStepExecutions' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"AutomationExecutionId": "",
"Filters": "",
"NextToken": "",
"MaxResults": "",
"ReverseOrder": ""
}'
echo '{
"AutomationExecutionId": "",
"Filters": "",
"NextToken": "",
"MaxResults": "",
"ReverseOrder": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAutomationStepExecutions' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "AutomationExecutionId": "",\n "Filters": "",\n "NextToken": "",\n "MaxResults": "",\n "ReverseOrder": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAutomationStepExecutions'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"AutomationExecutionId": "",
"Filters": "",
"NextToken": "",
"MaxResults": "",
"ReverseOrder": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAutomationStepExecutions")! 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
DescribeAvailablePatches
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAvailablePatches
HEADERS
X-Amz-Target
BODY json
{
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeAvailablePatches");
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 \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAvailablePatches" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Filters ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAvailablePatches"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeAvailablePatches"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeAvailablePatches");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeAvailablePatches"
payload := strings.NewReader("{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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
{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAvailablePatches")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAvailablePatches"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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 \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAvailablePatches")
.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=AmazonSSM.DescribeAvailablePatches")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
Filters: '',
MaxResults: '',
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=AmazonSSM.DescribeAvailablePatches');
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=AmazonSSM.DescribeAvailablePatches',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Filters: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAvailablePatches';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Filters":"","MaxResults":"","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=AmazonSSM.DescribeAvailablePatches',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Filters": "",\n "MaxResults": "",\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 \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAvailablePatches")
.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({Filters: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAvailablePatches',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Filters: '', MaxResults: '', 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=AmazonSSM.DescribeAvailablePatches');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Filters: '',
MaxResults: '',
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=AmazonSSM.DescribeAvailablePatches',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Filters: '', MaxResults: '', 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=AmazonSSM.DescribeAvailablePatches';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Filters":"","MaxResults":"","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 = @{ @"Filters": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAvailablePatches"]
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=AmazonSSM.DescribeAvailablePatches" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAvailablePatches",
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([
'Filters' => '',
'MaxResults' => '',
'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=AmazonSSM.DescribeAvailablePatches', [
'body' => '{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAvailablePatches');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Filters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Filters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAvailablePatches');
$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=AmazonSSM.DescribeAvailablePatches' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAvailablePatches' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeAvailablePatches"
payload = {
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeAvailablePatches"
payload <- "{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeAvailablePatches")
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 \"Filters\": \"\",\n \"MaxResults\": \"\",\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 \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeAvailablePatches";
let payload = json!({
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeAvailablePatches' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAvailablePatches' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Filters": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAvailablePatches'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Filters": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeAvailablePatches")! 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
DescribeDocument
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeDocument
HEADERS
X-Amz-Target
BODY json
{
"Name": "",
"DocumentVersion": "",
"VersionName": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeDocument");
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 \"DocumentVersion\": \"\",\n \"VersionName\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeDocument" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Name ""
:DocumentVersion ""
:VersionName ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeDocument"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"VersionName\": \"\"\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=AmazonSSM.DescribeDocument"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"VersionName\": \"\"\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=AmazonSSM.DescribeDocument");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"VersionName\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeDocument"
payload := strings.NewReader("{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"VersionName\": \"\"\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
{
"Name": "",
"DocumentVersion": "",
"VersionName": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeDocument")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"VersionName\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeDocument"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"VersionName\": \"\"\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 \"DocumentVersion\": \"\",\n \"VersionName\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeDocument")
.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=AmazonSSM.DescribeDocument")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"VersionName\": \"\"\n}")
.asString();
const data = JSON.stringify({
Name: '',
DocumentVersion: '',
VersionName: ''
});
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=AmazonSSM.DescribeDocument');
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=AmazonSSM.DescribeDocument',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Name: '', DocumentVersion: '', VersionName: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeDocument';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","DocumentVersion":"","VersionName":""}'
};
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=AmazonSSM.DescribeDocument',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Name": "",\n "DocumentVersion": "",\n "VersionName": ""\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 \"DocumentVersion\": \"\",\n \"VersionName\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeDocument")
.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: '', DocumentVersion: '', VersionName: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeDocument',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Name: '', DocumentVersion: '', VersionName: ''},
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=AmazonSSM.DescribeDocument');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Name: '',
DocumentVersion: '',
VersionName: ''
});
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=AmazonSSM.DescribeDocument',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Name: '', DocumentVersion: '', VersionName: ''}
};
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=AmazonSSM.DescribeDocument';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","DocumentVersion":"","VersionName":""}'
};
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": @"",
@"DocumentVersion": @"",
@"VersionName": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeDocument"]
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=AmazonSSM.DescribeDocument" 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 \"DocumentVersion\": \"\",\n \"VersionName\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeDocument",
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' => '',
'DocumentVersion' => '',
'VersionName' => ''
]),
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=AmazonSSM.DescribeDocument', [
'body' => '{
"Name": "",
"DocumentVersion": "",
"VersionName": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeDocument');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Name' => '',
'DocumentVersion' => '',
'VersionName' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Name' => '',
'DocumentVersion' => '',
'VersionName' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeDocument');
$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=AmazonSSM.DescribeDocument' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"DocumentVersion": "",
"VersionName": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeDocument' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"DocumentVersion": "",
"VersionName": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"VersionName\": \"\"\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=AmazonSSM.DescribeDocument"
payload = {
"Name": "",
"DocumentVersion": "",
"VersionName": ""
}
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=AmazonSSM.DescribeDocument"
payload <- "{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"VersionName\": \"\"\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=AmazonSSM.DescribeDocument")
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 \"DocumentVersion\": \"\",\n \"VersionName\": \"\"\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 \"DocumentVersion\": \"\",\n \"VersionName\": \"\"\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=AmazonSSM.DescribeDocument";
let payload = json!({
"Name": "",
"DocumentVersion": "",
"VersionName": ""
});
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=AmazonSSM.DescribeDocument' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Name": "",
"DocumentVersion": "",
"VersionName": ""
}'
echo '{
"Name": "",
"DocumentVersion": "",
"VersionName": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeDocument' \
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 "DocumentVersion": "",\n "VersionName": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeDocument'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Name": "",
"DocumentVersion": "",
"VersionName": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeDocument")! 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
DescribeDocumentPermission
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeDocumentPermission
HEADERS
X-Amz-Target
BODY json
{
"Name": "",
"PermissionType": "",
"MaxResults": "",
"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=AmazonSSM.DescribeDocumentPermission");
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 \"PermissionType\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeDocumentPermission" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Name ""
:PermissionType ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeDocumentPermission"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Name\": \"\",\n \"PermissionType\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeDocumentPermission"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Name\": \"\",\n \"PermissionType\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeDocumentPermission");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Name\": \"\",\n \"PermissionType\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeDocumentPermission"
payload := strings.NewReader("{\n \"Name\": \"\",\n \"PermissionType\": \"\",\n \"MaxResults\": \"\",\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: 79
{
"Name": "",
"PermissionType": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeDocumentPermission")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Name\": \"\",\n \"PermissionType\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeDocumentPermission"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Name\": \"\",\n \"PermissionType\": \"\",\n \"MaxResults\": \"\",\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 \"Name\": \"\",\n \"PermissionType\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeDocumentPermission")
.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=AmazonSSM.DescribeDocumentPermission")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Name\": \"\",\n \"PermissionType\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
Name: '',
PermissionType: '',
MaxResults: '',
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=AmazonSSM.DescribeDocumentPermission');
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=AmazonSSM.DescribeDocumentPermission',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Name: '', PermissionType: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeDocumentPermission';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","PermissionType":"","MaxResults":"","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=AmazonSSM.DescribeDocumentPermission',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Name": "",\n "PermissionType": "",\n "MaxResults": "",\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 \"Name\": \"\",\n \"PermissionType\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeDocumentPermission")
.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: '', PermissionType: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeDocumentPermission',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Name: '', PermissionType: '', MaxResults: '', 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=AmazonSSM.DescribeDocumentPermission');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Name: '',
PermissionType: '',
MaxResults: '',
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=AmazonSSM.DescribeDocumentPermission',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Name: '', PermissionType: '', MaxResults: '', 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=AmazonSSM.DescribeDocumentPermission';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","PermissionType":"","MaxResults":"","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 = @{ @"Name": @"",
@"PermissionType": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeDocumentPermission"]
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=AmazonSSM.DescribeDocumentPermission" 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 \"PermissionType\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeDocumentPermission",
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' => '',
'PermissionType' => '',
'MaxResults' => '',
'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=AmazonSSM.DescribeDocumentPermission', [
'body' => '{
"Name": "",
"PermissionType": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeDocumentPermission');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Name' => '',
'PermissionType' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Name' => '',
'PermissionType' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeDocumentPermission');
$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=AmazonSSM.DescribeDocumentPermission' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"PermissionType": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeDocumentPermission' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"PermissionType": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Name\": \"\",\n \"PermissionType\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeDocumentPermission"
payload = {
"Name": "",
"PermissionType": "",
"MaxResults": "",
"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=AmazonSSM.DescribeDocumentPermission"
payload <- "{\n \"Name\": \"\",\n \"PermissionType\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeDocumentPermission")
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 \"PermissionType\": \"\",\n \"MaxResults\": \"\",\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 \"Name\": \"\",\n \"PermissionType\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeDocumentPermission";
let payload = json!({
"Name": "",
"PermissionType": "",
"MaxResults": "",
"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=AmazonSSM.DescribeDocumentPermission' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Name": "",
"PermissionType": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"Name": "",
"PermissionType": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeDocumentPermission' \
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 "PermissionType": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeDocumentPermission'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Name": "",
"PermissionType": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeDocumentPermission")! 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
DescribeEffectiveInstanceAssociations
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeEffectiveInstanceAssociations
HEADERS
X-Amz-Target
BODY json
{
"InstanceId": "",
"MaxResults": "",
"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=AmazonSSM.DescribeEffectiveInstanceAssociations");
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 \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeEffectiveInstanceAssociations" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:InstanceId ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeEffectiveInstanceAssociations"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeEffectiveInstanceAssociations"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeEffectiveInstanceAssociations");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeEffectiveInstanceAssociations"
payload := strings.NewReader("{\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\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: 61
{
"InstanceId": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeEffectiveInstanceAssociations")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeEffectiveInstanceAssociations"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\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 \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeEffectiveInstanceAssociations")
.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=AmazonSSM.DescribeEffectiveInstanceAssociations")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
InstanceId: '',
MaxResults: '',
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=AmazonSSM.DescribeEffectiveInstanceAssociations');
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=AmazonSSM.DescribeEffectiveInstanceAssociations',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeEffectiveInstanceAssociations';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":"","MaxResults":"","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=AmazonSSM.DescribeEffectiveInstanceAssociations',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "InstanceId": "",\n "MaxResults": "",\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 \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeEffectiveInstanceAssociations")
.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({InstanceId: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeEffectiveInstanceAssociations',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {InstanceId: '', MaxResults: '', 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=AmazonSSM.DescribeEffectiveInstanceAssociations');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
InstanceId: '',
MaxResults: '',
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=AmazonSSM.DescribeEffectiveInstanceAssociations',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: '', MaxResults: '', 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=AmazonSSM.DescribeEffectiveInstanceAssociations';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":"","MaxResults":"","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 = @{ @"InstanceId": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeEffectiveInstanceAssociations"]
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=AmazonSSM.DescribeEffectiveInstanceAssociations" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeEffectiveInstanceAssociations",
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([
'InstanceId' => '',
'MaxResults' => '',
'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=AmazonSSM.DescribeEffectiveInstanceAssociations', [
'body' => '{
"InstanceId": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeEffectiveInstanceAssociations');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'InstanceId' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'InstanceId' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeEffectiveInstanceAssociations');
$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=AmazonSSM.DescribeEffectiveInstanceAssociations' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeEffectiveInstanceAssociations' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeEffectiveInstanceAssociations"
payload = {
"InstanceId": "",
"MaxResults": "",
"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=AmazonSSM.DescribeEffectiveInstanceAssociations"
payload <- "{\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeEffectiveInstanceAssociations")
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 \"InstanceId\": \"\",\n \"MaxResults\": \"\",\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 \"InstanceId\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeEffectiveInstanceAssociations";
let payload = json!({
"InstanceId": "",
"MaxResults": "",
"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=AmazonSSM.DescribeEffectiveInstanceAssociations' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"InstanceId": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"InstanceId": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeEffectiveInstanceAssociations' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "InstanceId": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeEffectiveInstanceAssociations'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"InstanceId": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeEffectiveInstanceAssociations")! 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
DescribeEffectivePatchesForPatchBaseline
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeEffectivePatchesForPatchBaseline
HEADERS
X-Amz-Target
BODY json
{
"BaselineId": "",
"MaxResults": "",
"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=AmazonSSM.DescribeEffectivePatchesForPatchBaseline");
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 \"BaselineId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeEffectivePatchesForPatchBaseline" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:BaselineId ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeEffectivePatchesForPatchBaseline"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"BaselineId\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeEffectivePatchesForPatchBaseline"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"BaselineId\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeEffectivePatchesForPatchBaseline");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"BaselineId\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeEffectivePatchesForPatchBaseline"
payload := strings.NewReader("{\n \"BaselineId\": \"\",\n \"MaxResults\": \"\",\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: 61
{
"BaselineId": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeEffectivePatchesForPatchBaseline")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"BaselineId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeEffectivePatchesForPatchBaseline"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"BaselineId\": \"\",\n \"MaxResults\": \"\",\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 \"BaselineId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeEffectivePatchesForPatchBaseline")
.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=AmazonSSM.DescribeEffectivePatchesForPatchBaseline")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"BaselineId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
BaselineId: '',
MaxResults: '',
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=AmazonSSM.DescribeEffectivePatchesForPatchBaseline');
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=AmazonSSM.DescribeEffectivePatchesForPatchBaseline',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {BaselineId: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeEffectivePatchesForPatchBaseline';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"BaselineId":"","MaxResults":"","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=AmazonSSM.DescribeEffectivePatchesForPatchBaseline',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "BaselineId": "",\n "MaxResults": "",\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 \"BaselineId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeEffectivePatchesForPatchBaseline")
.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({BaselineId: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeEffectivePatchesForPatchBaseline',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {BaselineId: '', MaxResults: '', 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=AmazonSSM.DescribeEffectivePatchesForPatchBaseline');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
BaselineId: '',
MaxResults: '',
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=AmazonSSM.DescribeEffectivePatchesForPatchBaseline',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {BaselineId: '', MaxResults: '', 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=AmazonSSM.DescribeEffectivePatchesForPatchBaseline';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"BaselineId":"","MaxResults":"","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 = @{ @"BaselineId": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeEffectivePatchesForPatchBaseline"]
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=AmazonSSM.DescribeEffectivePatchesForPatchBaseline" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"BaselineId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeEffectivePatchesForPatchBaseline",
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([
'BaselineId' => '',
'MaxResults' => '',
'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=AmazonSSM.DescribeEffectivePatchesForPatchBaseline', [
'body' => '{
"BaselineId": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeEffectivePatchesForPatchBaseline');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'BaselineId' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'BaselineId' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeEffectivePatchesForPatchBaseline');
$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=AmazonSSM.DescribeEffectivePatchesForPatchBaseline' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"BaselineId": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeEffectivePatchesForPatchBaseline' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"BaselineId": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"BaselineId\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeEffectivePatchesForPatchBaseline"
payload = {
"BaselineId": "",
"MaxResults": "",
"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=AmazonSSM.DescribeEffectivePatchesForPatchBaseline"
payload <- "{\n \"BaselineId\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeEffectivePatchesForPatchBaseline")
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 \"BaselineId\": \"\",\n \"MaxResults\": \"\",\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 \"BaselineId\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeEffectivePatchesForPatchBaseline";
let payload = json!({
"BaselineId": "",
"MaxResults": "",
"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=AmazonSSM.DescribeEffectivePatchesForPatchBaseline' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"BaselineId": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"BaselineId": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeEffectivePatchesForPatchBaseline' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "BaselineId": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeEffectivePatchesForPatchBaseline'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"BaselineId": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeEffectivePatchesForPatchBaseline")! 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
DescribeInstanceAssociationsStatus
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstanceAssociationsStatus
HEADERS
X-Amz-Target
BODY json
{
"InstanceId": "",
"MaxResults": "",
"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=AmazonSSM.DescribeInstanceAssociationsStatus");
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 \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstanceAssociationsStatus" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:InstanceId ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstanceAssociationsStatus"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeInstanceAssociationsStatus"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeInstanceAssociationsStatus");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeInstanceAssociationsStatus"
payload := strings.NewReader("{\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\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: 61
{
"InstanceId": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstanceAssociationsStatus")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstanceAssociationsStatus"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\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 \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstanceAssociationsStatus")
.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=AmazonSSM.DescribeInstanceAssociationsStatus")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
InstanceId: '',
MaxResults: '',
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=AmazonSSM.DescribeInstanceAssociationsStatus');
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=AmazonSSM.DescribeInstanceAssociationsStatus',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstanceAssociationsStatus';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":"","MaxResults":"","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=AmazonSSM.DescribeInstanceAssociationsStatus',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "InstanceId": "",\n "MaxResults": "",\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 \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstanceAssociationsStatus")
.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({InstanceId: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstanceAssociationsStatus',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {InstanceId: '', MaxResults: '', 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=AmazonSSM.DescribeInstanceAssociationsStatus');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
InstanceId: '',
MaxResults: '',
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=AmazonSSM.DescribeInstanceAssociationsStatus',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: '', MaxResults: '', 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=AmazonSSM.DescribeInstanceAssociationsStatus';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":"","MaxResults":"","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 = @{ @"InstanceId": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstanceAssociationsStatus"]
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=AmazonSSM.DescribeInstanceAssociationsStatus" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstanceAssociationsStatus",
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([
'InstanceId' => '',
'MaxResults' => '',
'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=AmazonSSM.DescribeInstanceAssociationsStatus', [
'body' => '{
"InstanceId": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstanceAssociationsStatus');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'InstanceId' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'InstanceId' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstanceAssociationsStatus');
$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=AmazonSSM.DescribeInstanceAssociationsStatus' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstanceAssociationsStatus' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeInstanceAssociationsStatus"
payload = {
"InstanceId": "",
"MaxResults": "",
"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=AmazonSSM.DescribeInstanceAssociationsStatus"
payload <- "{\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeInstanceAssociationsStatus")
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 \"InstanceId\": \"\",\n \"MaxResults\": \"\",\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 \"InstanceId\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeInstanceAssociationsStatus";
let payload = json!({
"InstanceId": "",
"MaxResults": "",
"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=AmazonSSM.DescribeInstanceAssociationsStatus' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"InstanceId": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"InstanceId": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstanceAssociationsStatus' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "InstanceId": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstanceAssociationsStatus'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"InstanceId": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstanceAssociationsStatus")! 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
DescribeInstanceInformation
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstanceInformation
HEADERS
X-Amz-Target
BODY json
{
"InstanceInformationFilterList": "",
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeInstanceInformation");
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 \"InstanceInformationFilterList\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstanceInformation" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:InstanceInformationFilterList ""
:Filters ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstanceInformation"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"InstanceInformationFilterList\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeInstanceInformation"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"InstanceInformationFilterList\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeInstanceInformation");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"InstanceInformationFilterList\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeInstanceInformation"
payload := strings.NewReader("{\n \"InstanceInformationFilterList\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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: 97
{
"InstanceInformationFilterList": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstanceInformation")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"InstanceInformationFilterList\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstanceInformation"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"InstanceInformationFilterList\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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 \"InstanceInformationFilterList\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstanceInformation")
.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=AmazonSSM.DescribeInstanceInformation")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"InstanceInformationFilterList\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
InstanceInformationFilterList: '',
Filters: '',
MaxResults: '',
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=AmazonSSM.DescribeInstanceInformation');
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=AmazonSSM.DescribeInstanceInformation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceInformationFilterList: '', Filters: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstanceInformation';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceInformationFilterList":"","Filters":"","MaxResults":"","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=AmazonSSM.DescribeInstanceInformation',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "InstanceInformationFilterList": "",\n "Filters": "",\n "MaxResults": "",\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 \"InstanceInformationFilterList\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstanceInformation")
.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({InstanceInformationFilterList: '', Filters: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstanceInformation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {InstanceInformationFilterList: '', Filters: '', MaxResults: '', 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=AmazonSSM.DescribeInstanceInformation');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
InstanceInformationFilterList: '',
Filters: '',
MaxResults: '',
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=AmazonSSM.DescribeInstanceInformation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceInformationFilterList: '', Filters: '', MaxResults: '', 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=AmazonSSM.DescribeInstanceInformation';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceInformationFilterList":"","Filters":"","MaxResults":"","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 = @{ @"InstanceInformationFilterList": @"",
@"Filters": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstanceInformation"]
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=AmazonSSM.DescribeInstanceInformation" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"InstanceInformationFilterList\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstanceInformation",
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([
'InstanceInformationFilterList' => '',
'Filters' => '',
'MaxResults' => '',
'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=AmazonSSM.DescribeInstanceInformation', [
'body' => '{
"InstanceInformationFilterList": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstanceInformation');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'InstanceInformationFilterList' => '',
'Filters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'InstanceInformationFilterList' => '',
'Filters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstanceInformation');
$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=AmazonSSM.DescribeInstanceInformation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceInformationFilterList": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstanceInformation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceInformationFilterList": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"InstanceInformationFilterList\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeInstanceInformation"
payload = {
"InstanceInformationFilterList": "",
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeInstanceInformation"
payload <- "{\n \"InstanceInformationFilterList\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeInstanceInformation")
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 \"InstanceInformationFilterList\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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 \"InstanceInformationFilterList\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeInstanceInformation";
let payload = json!({
"InstanceInformationFilterList": "",
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeInstanceInformation' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"InstanceInformationFilterList": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"InstanceInformationFilterList": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstanceInformation' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "InstanceInformationFilterList": "",\n "Filters": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstanceInformation'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"InstanceInformationFilterList": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstanceInformation")! 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
DescribeInstancePatchStates
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatchStates
HEADERS
X-Amz-Target
BODY json
{
"InstanceIds": "",
"NextToken": "",
"MaxResults": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatchStates");
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 \"InstanceIds\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatchStates" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:InstanceIds ""
:NextToken ""
:MaxResults ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatchStates"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"InstanceIds\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.DescribeInstancePatchStates"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"InstanceIds\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.DescribeInstancePatchStates");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"InstanceIds\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatchStates"
payload := strings.NewReader("{\n \"InstanceIds\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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
{
"InstanceIds": "",
"NextToken": "",
"MaxResults": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatchStates")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"InstanceIds\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatchStates"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"InstanceIds\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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 \"InstanceIds\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatchStates")
.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=AmazonSSM.DescribeInstancePatchStates")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"InstanceIds\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.asString();
const data = JSON.stringify({
InstanceIds: '',
NextToken: '',
MaxResults: ''
});
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=AmazonSSM.DescribeInstancePatchStates');
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=AmazonSSM.DescribeInstancePatchStates',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceIds: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatchStates';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceIds":"","NextToken":"","MaxResults":""}'
};
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=AmazonSSM.DescribeInstancePatchStates',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "InstanceIds": "",\n "NextToken": "",\n "MaxResults": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"InstanceIds\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatchStates")
.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({InstanceIds: '', NextToken: '', MaxResults: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatchStates',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {InstanceIds: '', NextToken: '', MaxResults: ''},
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=AmazonSSM.DescribeInstancePatchStates');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
InstanceIds: '',
NextToken: '',
MaxResults: ''
});
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=AmazonSSM.DescribeInstancePatchStates',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceIds: '', NextToken: '', MaxResults: ''}
};
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=AmazonSSM.DescribeInstancePatchStates';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceIds":"","NextToken":"","MaxResults":""}'
};
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 = @{ @"InstanceIds": @"",
@"NextToken": @"",
@"MaxResults": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatchStates"]
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=AmazonSSM.DescribeInstancePatchStates" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"InstanceIds\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatchStates",
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([
'InstanceIds' => '',
'NextToken' => '',
'MaxResults' => ''
]),
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=AmazonSSM.DescribeInstancePatchStates', [
'body' => '{
"InstanceIds": "",
"NextToken": "",
"MaxResults": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatchStates');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'InstanceIds' => '',
'NextToken' => '',
'MaxResults' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'InstanceIds' => '',
'NextToken' => '',
'MaxResults' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatchStates');
$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=AmazonSSM.DescribeInstancePatchStates' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceIds": "",
"NextToken": "",
"MaxResults": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatchStates' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceIds": "",
"NextToken": "",
"MaxResults": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"InstanceIds\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.DescribeInstancePatchStates"
payload = {
"InstanceIds": "",
"NextToken": "",
"MaxResults": ""
}
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=AmazonSSM.DescribeInstancePatchStates"
payload <- "{\n \"InstanceIds\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.DescribeInstancePatchStates")
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 \"InstanceIds\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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 \"InstanceIds\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.DescribeInstancePatchStates";
let payload = json!({
"InstanceIds": "",
"NextToken": "",
"MaxResults": ""
});
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=AmazonSSM.DescribeInstancePatchStates' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"InstanceIds": "",
"NextToken": "",
"MaxResults": ""
}'
echo '{
"InstanceIds": "",
"NextToken": "",
"MaxResults": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatchStates' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "InstanceIds": "",\n "NextToken": "",\n "MaxResults": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatchStates'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"InstanceIds": "",
"NextToken": "",
"MaxResults": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatchStates")! 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
DescribeInstancePatchStatesForPatchGroup
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatchStatesForPatchGroup
HEADERS
X-Amz-Target
BODY json
{
"PatchGroup": "",
"Filters": "",
"NextToken": "",
"MaxResults": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatchStatesForPatchGroup");
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 \"PatchGroup\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatchStatesForPatchGroup" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:PatchGroup ""
:Filters ""
:NextToken ""
:MaxResults ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatchStatesForPatchGroup"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"PatchGroup\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.DescribeInstancePatchStatesForPatchGroup"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"PatchGroup\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.DescribeInstancePatchStatesForPatchGroup");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"PatchGroup\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatchStatesForPatchGroup"
payload := strings.NewReader("{\n \"PatchGroup\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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
{
"PatchGroup": "",
"Filters": "",
"NextToken": "",
"MaxResults": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatchStatesForPatchGroup")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"PatchGroup\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatchStatesForPatchGroup"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"PatchGroup\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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 \"PatchGroup\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatchStatesForPatchGroup")
.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=AmazonSSM.DescribeInstancePatchStatesForPatchGroup")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"PatchGroup\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.asString();
const data = JSON.stringify({
PatchGroup: '',
Filters: '',
NextToken: '',
MaxResults: ''
});
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=AmazonSSM.DescribeInstancePatchStatesForPatchGroup');
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=AmazonSSM.DescribeInstancePatchStatesForPatchGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {PatchGroup: '', Filters: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatchStatesForPatchGroup';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"PatchGroup":"","Filters":"","NextToken":"","MaxResults":""}'
};
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=AmazonSSM.DescribeInstancePatchStatesForPatchGroup',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "PatchGroup": "",\n "Filters": "",\n "NextToken": "",\n "MaxResults": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"PatchGroup\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatchStatesForPatchGroup")
.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({PatchGroup: '', Filters: '', NextToken: '', MaxResults: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatchStatesForPatchGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {PatchGroup: '', Filters: '', NextToken: '', MaxResults: ''},
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=AmazonSSM.DescribeInstancePatchStatesForPatchGroup');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
PatchGroup: '',
Filters: '',
NextToken: '',
MaxResults: ''
});
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=AmazonSSM.DescribeInstancePatchStatesForPatchGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {PatchGroup: '', Filters: '', NextToken: '', MaxResults: ''}
};
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=AmazonSSM.DescribeInstancePatchStatesForPatchGroup';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"PatchGroup":"","Filters":"","NextToken":"","MaxResults":""}'
};
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 = @{ @"PatchGroup": @"",
@"Filters": @"",
@"NextToken": @"",
@"MaxResults": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatchStatesForPatchGroup"]
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=AmazonSSM.DescribeInstancePatchStatesForPatchGroup" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"PatchGroup\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatchStatesForPatchGroup",
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([
'PatchGroup' => '',
'Filters' => '',
'NextToken' => '',
'MaxResults' => ''
]),
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=AmazonSSM.DescribeInstancePatchStatesForPatchGroup', [
'body' => '{
"PatchGroup": "",
"Filters": "",
"NextToken": "",
"MaxResults": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatchStatesForPatchGroup');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'PatchGroup' => '',
'Filters' => '',
'NextToken' => '',
'MaxResults' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'PatchGroup' => '',
'Filters' => '',
'NextToken' => '',
'MaxResults' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatchStatesForPatchGroup');
$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=AmazonSSM.DescribeInstancePatchStatesForPatchGroup' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"PatchGroup": "",
"Filters": "",
"NextToken": "",
"MaxResults": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatchStatesForPatchGroup' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"PatchGroup": "",
"Filters": "",
"NextToken": "",
"MaxResults": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"PatchGroup\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.DescribeInstancePatchStatesForPatchGroup"
payload = {
"PatchGroup": "",
"Filters": "",
"NextToken": "",
"MaxResults": ""
}
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=AmazonSSM.DescribeInstancePatchStatesForPatchGroup"
payload <- "{\n \"PatchGroup\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.DescribeInstancePatchStatesForPatchGroup")
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 \"PatchGroup\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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 \"PatchGroup\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.DescribeInstancePatchStatesForPatchGroup";
let payload = json!({
"PatchGroup": "",
"Filters": "",
"NextToken": "",
"MaxResults": ""
});
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=AmazonSSM.DescribeInstancePatchStatesForPatchGroup' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"PatchGroup": "",
"Filters": "",
"NextToken": "",
"MaxResults": ""
}'
echo '{
"PatchGroup": "",
"Filters": "",
"NextToken": "",
"MaxResults": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatchStatesForPatchGroup' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "PatchGroup": "",\n "Filters": "",\n "NextToken": "",\n "MaxResults": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatchStatesForPatchGroup'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"PatchGroup": "",
"Filters": "",
"NextToken": "",
"MaxResults": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatchStatesForPatchGroup")! 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
DescribeInstancePatches
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatches
HEADERS
X-Amz-Target
BODY json
{
"InstanceId": "",
"Filters": "",
"NextToken": "",
"MaxResults": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatches");
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 \"InstanceId\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatches" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:InstanceId ""
:Filters ""
:NextToken ""
:MaxResults ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatches"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"InstanceId\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.DescribeInstancePatches"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"InstanceId\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.DescribeInstancePatches");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"InstanceId\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatches"
payload := strings.NewReader("{\n \"InstanceId\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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
{
"InstanceId": "",
"Filters": "",
"NextToken": "",
"MaxResults": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatches")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"InstanceId\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatches"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"InstanceId\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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 \"InstanceId\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatches")
.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=AmazonSSM.DescribeInstancePatches")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"InstanceId\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.asString();
const data = JSON.stringify({
InstanceId: '',
Filters: '',
NextToken: '',
MaxResults: ''
});
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=AmazonSSM.DescribeInstancePatches');
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=AmazonSSM.DescribeInstancePatches',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: '', Filters: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatches';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":"","Filters":"","NextToken":"","MaxResults":""}'
};
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=AmazonSSM.DescribeInstancePatches',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "InstanceId": "",\n "Filters": "",\n "NextToken": "",\n "MaxResults": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"InstanceId\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatches")
.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({InstanceId: '', Filters: '', NextToken: '', MaxResults: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatches',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {InstanceId: '', Filters: '', NextToken: '', MaxResults: ''},
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=AmazonSSM.DescribeInstancePatches');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
InstanceId: '',
Filters: '',
NextToken: '',
MaxResults: ''
});
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=AmazonSSM.DescribeInstancePatches',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: '', Filters: '', NextToken: '', MaxResults: ''}
};
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=AmazonSSM.DescribeInstancePatches';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":"","Filters":"","NextToken":"","MaxResults":""}'
};
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 = @{ @"InstanceId": @"",
@"Filters": @"",
@"NextToken": @"",
@"MaxResults": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatches"]
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=AmazonSSM.DescribeInstancePatches" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"InstanceId\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatches",
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([
'InstanceId' => '',
'Filters' => '',
'NextToken' => '',
'MaxResults' => ''
]),
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=AmazonSSM.DescribeInstancePatches', [
'body' => '{
"InstanceId": "",
"Filters": "",
"NextToken": "",
"MaxResults": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatches');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'InstanceId' => '',
'Filters' => '',
'NextToken' => '',
'MaxResults' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'InstanceId' => '',
'Filters' => '',
'NextToken' => '',
'MaxResults' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatches');
$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=AmazonSSM.DescribeInstancePatches' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": "",
"Filters": "",
"NextToken": "",
"MaxResults": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatches' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": "",
"Filters": "",
"NextToken": "",
"MaxResults": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"InstanceId\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.DescribeInstancePatches"
payload = {
"InstanceId": "",
"Filters": "",
"NextToken": "",
"MaxResults": ""
}
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=AmazonSSM.DescribeInstancePatches"
payload <- "{\n \"InstanceId\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.DescribeInstancePatches")
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 \"InstanceId\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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 \"InstanceId\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.DescribeInstancePatches";
let payload = json!({
"InstanceId": "",
"Filters": "",
"NextToken": "",
"MaxResults": ""
});
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=AmazonSSM.DescribeInstancePatches' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"InstanceId": "",
"Filters": "",
"NextToken": "",
"MaxResults": ""
}'
echo '{
"InstanceId": "",
"Filters": "",
"NextToken": "",
"MaxResults": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatches' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "InstanceId": "",\n "Filters": "",\n "NextToken": "",\n "MaxResults": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatches'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"InstanceId": "",
"Filters": "",
"NextToken": "",
"MaxResults": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInstancePatches")! 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
DescribeInventoryDeletions
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInventoryDeletions
HEADERS
X-Amz-Target
BODY json
{
"DeletionId": "",
"NextToken": "",
"MaxResults": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInventoryDeletions");
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 \"DeletionId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInventoryDeletions" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DeletionId ""
:NextToken ""
:MaxResults ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInventoryDeletions"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DeletionId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.DescribeInventoryDeletions"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DeletionId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.DescribeInventoryDeletions");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DeletionId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInventoryDeletions"
payload := strings.NewReader("{\n \"DeletionId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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: 61
{
"DeletionId": "",
"NextToken": "",
"MaxResults": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInventoryDeletions")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DeletionId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInventoryDeletions"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DeletionId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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 \"DeletionId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInventoryDeletions")
.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=AmazonSSM.DescribeInventoryDeletions")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DeletionId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.asString();
const data = JSON.stringify({
DeletionId: '',
NextToken: '',
MaxResults: ''
});
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=AmazonSSM.DescribeInventoryDeletions');
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=AmazonSSM.DescribeInventoryDeletions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DeletionId: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInventoryDeletions';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DeletionId":"","NextToken":"","MaxResults":""}'
};
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=AmazonSSM.DescribeInventoryDeletions',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DeletionId": "",\n "NextToken": "",\n "MaxResults": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DeletionId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInventoryDeletions")
.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({DeletionId: '', NextToken: '', MaxResults: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInventoryDeletions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DeletionId: '', NextToken: '', MaxResults: ''},
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=AmazonSSM.DescribeInventoryDeletions');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DeletionId: '',
NextToken: '',
MaxResults: ''
});
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=AmazonSSM.DescribeInventoryDeletions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DeletionId: '', NextToken: '', MaxResults: ''}
};
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=AmazonSSM.DescribeInventoryDeletions';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DeletionId":"","NextToken":"","MaxResults":""}'
};
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 = @{ @"DeletionId": @"",
@"NextToken": @"",
@"MaxResults": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInventoryDeletions"]
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=AmazonSSM.DescribeInventoryDeletions" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DeletionId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInventoryDeletions",
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([
'DeletionId' => '',
'NextToken' => '',
'MaxResults' => ''
]),
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=AmazonSSM.DescribeInventoryDeletions', [
'body' => '{
"DeletionId": "",
"NextToken": "",
"MaxResults": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInventoryDeletions');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DeletionId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DeletionId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInventoryDeletions');
$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=AmazonSSM.DescribeInventoryDeletions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DeletionId": "",
"NextToken": "",
"MaxResults": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInventoryDeletions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DeletionId": "",
"NextToken": "",
"MaxResults": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DeletionId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.DescribeInventoryDeletions"
payload = {
"DeletionId": "",
"NextToken": "",
"MaxResults": ""
}
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=AmazonSSM.DescribeInventoryDeletions"
payload <- "{\n \"DeletionId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.DescribeInventoryDeletions")
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 \"DeletionId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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 \"DeletionId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.DescribeInventoryDeletions";
let payload = json!({
"DeletionId": "",
"NextToken": "",
"MaxResults": ""
});
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=AmazonSSM.DescribeInventoryDeletions' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DeletionId": "",
"NextToken": "",
"MaxResults": ""
}'
echo '{
"DeletionId": "",
"NextToken": "",
"MaxResults": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInventoryDeletions' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DeletionId": "",\n "NextToken": "",\n "MaxResults": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInventoryDeletions'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DeletionId": "",
"NextToken": "",
"MaxResults": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeInventoryDeletions")! 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
DescribeMaintenanceWindowExecutionTaskInvocations
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations
HEADERS
X-Amz-Target
BODY json
{
"WindowExecutionId": "",
"TaskId": "",
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations");
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 \"WindowExecutionId\": \"\",\n \"TaskId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:WindowExecutionId ""
:TaskId ""
:Filters ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"WindowExecutionId\": \"\",\n \"TaskId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"WindowExecutionId\": \"\",\n \"TaskId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"WindowExecutionId\": \"\",\n \"TaskId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations"
payload := strings.NewReader("{\n \"WindowExecutionId\": \"\",\n \"TaskId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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: 101
{
"WindowExecutionId": "",
"TaskId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"WindowExecutionId\": \"\",\n \"TaskId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"WindowExecutionId\": \"\",\n \"TaskId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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 \"WindowExecutionId\": \"\",\n \"TaskId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations")
.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=AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"WindowExecutionId\": \"\",\n \"TaskId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
WindowExecutionId: '',
TaskId: '',
Filters: '',
MaxResults: '',
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=AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations');
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=AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {WindowExecutionId: '', TaskId: '', Filters: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowExecutionId":"","TaskId":"","Filters":"","MaxResults":"","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=AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "WindowExecutionId": "",\n "TaskId": "",\n "Filters": "",\n "MaxResults": "",\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 \"WindowExecutionId\": \"\",\n \"TaskId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations")
.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({WindowExecutionId: '', TaskId: '', Filters: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {WindowExecutionId: '', TaskId: '', Filters: '', MaxResults: '', 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=AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
WindowExecutionId: '',
TaskId: '',
Filters: '',
MaxResults: '',
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=AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {WindowExecutionId: '', TaskId: '', Filters: '', MaxResults: '', 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=AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowExecutionId":"","TaskId":"","Filters":"","MaxResults":"","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 = @{ @"WindowExecutionId": @"",
@"TaskId": @"",
@"Filters": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations"]
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=AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"WindowExecutionId\": \"\",\n \"TaskId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations",
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([
'WindowExecutionId' => '',
'TaskId' => '',
'Filters' => '',
'MaxResults' => '',
'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=AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations', [
'body' => '{
"WindowExecutionId": "",
"TaskId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'WindowExecutionId' => '',
'TaskId' => '',
'Filters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'WindowExecutionId' => '',
'TaskId' => '',
'Filters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations');
$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=AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowExecutionId": "",
"TaskId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowExecutionId": "",
"TaskId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"WindowExecutionId\": \"\",\n \"TaskId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations"
payload = {
"WindowExecutionId": "",
"TaskId": "",
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations"
payload <- "{\n \"WindowExecutionId\": \"\",\n \"TaskId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations")
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 \"WindowExecutionId\": \"\",\n \"TaskId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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 \"WindowExecutionId\": \"\",\n \"TaskId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations";
let payload = json!({
"WindowExecutionId": "",
"TaskId": "",
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"WindowExecutionId": "",
"TaskId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"WindowExecutionId": "",
"TaskId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "WindowExecutionId": "",\n "TaskId": "",\n "Filters": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"WindowExecutionId": "",
"TaskId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutionTaskInvocations")! 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
DescribeMaintenanceWindowExecutionTasks
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutionTasks
HEADERS
X-Amz-Target
BODY json
{
"WindowExecutionId": "",
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeMaintenanceWindowExecutionTasks");
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 \"WindowExecutionId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutionTasks" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:WindowExecutionId ""
:Filters ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutionTasks"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"WindowExecutionId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowExecutionTasks"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"WindowExecutionId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowExecutionTasks");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"WindowExecutionId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowExecutionTasks"
payload := strings.NewReader("{\n \"WindowExecutionId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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: 85
{
"WindowExecutionId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutionTasks")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"WindowExecutionId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutionTasks"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"WindowExecutionId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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 \"WindowExecutionId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutionTasks")
.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=AmazonSSM.DescribeMaintenanceWindowExecutionTasks")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"WindowExecutionId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
WindowExecutionId: '',
Filters: '',
MaxResults: '',
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=AmazonSSM.DescribeMaintenanceWindowExecutionTasks');
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=AmazonSSM.DescribeMaintenanceWindowExecutionTasks',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {WindowExecutionId: '', Filters: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutionTasks';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowExecutionId":"","Filters":"","MaxResults":"","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=AmazonSSM.DescribeMaintenanceWindowExecutionTasks',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "WindowExecutionId": "",\n "Filters": "",\n "MaxResults": "",\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 \"WindowExecutionId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutionTasks")
.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({WindowExecutionId: '', Filters: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutionTasks',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {WindowExecutionId: '', Filters: '', MaxResults: '', 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=AmazonSSM.DescribeMaintenanceWindowExecutionTasks');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
WindowExecutionId: '',
Filters: '',
MaxResults: '',
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=AmazonSSM.DescribeMaintenanceWindowExecutionTasks',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {WindowExecutionId: '', Filters: '', MaxResults: '', 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=AmazonSSM.DescribeMaintenanceWindowExecutionTasks';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowExecutionId":"","Filters":"","MaxResults":"","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 = @{ @"WindowExecutionId": @"",
@"Filters": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutionTasks"]
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=AmazonSSM.DescribeMaintenanceWindowExecutionTasks" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"WindowExecutionId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutionTasks",
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([
'WindowExecutionId' => '',
'Filters' => '',
'MaxResults' => '',
'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=AmazonSSM.DescribeMaintenanceWindowExecutionTasks', [
'body' => '{
"WindowExecutionId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutionTasks');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'WindowExecutionId' => '',
'Filters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'WindowExecutionId' => '',
'Filters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutionTasks');
$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=AmazonSSM.DescribeMaintenanceWindowExecutionTasks' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowExecutionId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutionTasks' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowExecutionId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"WindowExecutionId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowExecutionTasks"
payload = {
"WindowExecutionId": "",
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeMaintenanceWindowExecutionTasks"
payload <- "{\n \"WindowExecutionId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowExecutionTasks")
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 \"WindowExecutionId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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 \"WindowExecutionId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowExecutionTasks";
let payload = json!({
"WindowExecutionId": "",
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeMaintenanceWindowExecutionTasks' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"WindowExecutionId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"WindowExecutionId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutionTasks' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "WindowExecutionId": "",\n "Filters": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutionTasks'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"WindowExecutionId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutionTasks")! 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
DescribeMaintenanceWindowExecutions
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutions
HEADERS
X-Amz-Target
BODY json
{
"WindowId": "",
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeMaintenanceWindowExecutions");
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 \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutions" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:WindowId ""
:Filters ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutions"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowExecutions"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowExecutions");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowExecutions"
payload := strings.NewReader("{\n \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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: 76
{
"WindowId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutions")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutions"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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 \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutions")
.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=AmazonSSM.DescribeMaintenanceWindowExecutions")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
WindowId: '',
Filters: '',
MaxResults: '',
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=AmazonSSM.DescribeMaintenanceWindowExecutions');
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=AmazonSSM.DescribeMaintenanceWindowExecutions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {WindowId: '', Filters: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutions';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowId":"","Filters":"","MaxResults":"","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=AmazonSSM.DescribeMaintenanceWindowExecutions',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "WindowId": "",\n "Filters": "",\n "MaxResults": "",\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 \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutions")
.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({WindowId: '', Filters: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {WindowId: '', Filters: '', MaxResults: '', 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=AmazonSSM.DescribeMaintenanceWindowExecutions');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
WindowId: '',
Filters: '',
MaxResults: '',
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=AmazonSSM.DescribeMaintenanceWindowExecutions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {WindowId: '', Filters: '', MaxResults: '', 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=AmazonSSM.DescribeMaintenanceWindowExecutions';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowId":"","Filters":"","MaxResults":"","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 = @{ @"WindowId": @"",
@"Filters": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutions"]
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=AmazonSSM.DescribeMaintenanceWindowExecutions" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutions",
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([
'WindowId' => '',
'Filters' => '',
'MaxResults' => '',
'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=AmazonSSM.DescribeMaintenanceWindowExecutions', [
'body' => '{
"WindowId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutions');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'WindowId' => '',
'Filters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'WindowId' => '',
'Filters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutions');
$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=AmazonSSM.DescribeMaintenanceWindowExecutions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowExecutions"
payload = {
"WindowId": "",
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeMaintenanceWindowExecutions"
payload <- "{\n \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowExecutions")
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 \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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 \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowExecutions";
let payload = json!({
"WindowId": "",
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeMaintenanceWindowExecutions' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"WindowId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"WindowId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutions' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "WindowId": "",\n "Filters": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutions'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"WindowId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowExecutions")! 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
DescribeMaintenanceWindowSchedule
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowSchedule
HEADERS
X-Amz-Target
BODY json
{
"WindowId": "",
"Targets": "",
"ResourceType": "",
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeMaintenanceWindowSchedule");
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 \"WindowId\": \"\",\n \"Targets\": \"\",\n \"ResourceType\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowSchedule" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:WindowId ""
:Targets ""
:ResourceType ""
:Filters ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowSchedule"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"WindowId\": \"\",\n \"Targets\": \"\",\n \"ResourceType\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowSchedule"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"WindowId\": \"\",\n \"Targets\": \"\",\n \"ResourceType\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowSchedule");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"WindowId\": \"\",\n \"Targets\": \"\",\n \"ResourceType\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowSchedule"
payload := strings.NewReader("{\n \"WindowId\": \"\",\n \"Targets\": \"\",\n \"ResourceType\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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: 115
{
"WindowId": "",
"Targets": "",
"ResourceType": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowSchedule")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"WindowId\": \"\",\n \"Targets\": \"\",\n \"ResourceType\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowSchedule"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"WindowId\": \"\",\n \"Targets\": \"\",\n \"ResourceType\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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 \"WindowId\": \"\",\n \"Targets\": \"\",\n \"ResourceType\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowSchedule")
.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=AmazonSSM.DescribeMaintenanceWindowSchedule")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"WindowId\": \"\",\n \"Targets\": \"\",\n \"ResourceType\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
WindowId: '',
Targets: '',
ResourceType: '',
Filters: '',
MaxResults: '',
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=AmazonSSM.DescribeMaintenanceWindowSchedule');
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=AmazonSSM.DescribeMaintenanceWindowSchedule',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
WindowId: '',
Targets: '',
ResourceType: '',
Filters: '',
MaxResults: '',
NextToken: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowSchedule';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowId":"","Targets":"","ResourceType":"","Filters":"","MaxResults":"","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=AmazonSSM.DescribeMaintenanceWindowSchedule',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "WindowId": "",\n "Targets": "",\n "ResourceType": "",\n "Filters": "",\n "MaxResults": "",\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 \"WindowId\": \"\",\n \"Targets\": \"\",\n \"ResourceType\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowSchedule")
.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({
WindowId: '',
Targets: '',
ResourceType: '',
Filters: '',
MaxResults: '',
NextToken: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowSchedule',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
WindowId: '',
Targets: '',
ResourceType: '',
Filters: '',
MaxResults: '',
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=AmazonSSM.DescribeMaintenanceWindowSchedule');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
WindowId: '',
Targets: '',
ResourceType: '',
Filters: '',
MaxResults: '',
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=AmazonSSM.DescribeMaintenanceWindowSchedule',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
WindowId: '',
Targets: '',
ResourceType: '',
Filters: '',
MaxResults: '',
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=AmazonSSM.DescribeMaintenanceWindowSchedule';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowId":"","Targets":"","ResourceType":"","Filters":"","MaxResults":"","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 = @{ @"WindowId": @"",
@"Targets": @"",
@"ResourceType": @"",
@"Filters": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowSchedule"]
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=AmazonSSM.DescribeMaintenanceWindowSchedule" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"WindowId\": \"\",\n \"Targets\": \"\",\n \"ResourceType\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowSchedule",
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([
'WindowId' => '',
'Targets' => '',
'ResourceType' => '',
'Filters' => '',
'MaxResults' => '',
'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=AmazonSSM.DescribeMaintenanceWindowSchedule', [
'body' => '{
"WindowId": "",
"Targets": "",
"ResourceType": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowSchedule');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'WindowId' => '',
'Targets' => '',
'ResourceType' => '',
'Filters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'WindowId' => '',
'Targets' => '',
'ResourceType' => '',
'Filters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowSchedule');
$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=AmazonSSM.DescribeMaintenanceWindowSchedule' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowId": "",
"Targets": "",
"ResourceType": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowSchedule' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowId": "",
"Targets": "",
"ResourceType": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"WindowId\": \"\",\n \"Targets\": \"\",\n \"ResourceType\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowSchedule"
payload = {
"WindowId": "",
"Targets": "",
"ResourceType": "",
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeMaintenanceWindowSchedule"
payload <- "{\n \"WindowId\": \"\",\n \"Targets\": \"\",\n \"ResourceType\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowSchedule")
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 \"WindowId\": \"\",\n \"Targets\": \"\",\n \"ResourceType\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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 \"WindowId\": \"\",\n \"Targets\": \"\",\n \"ResourceType\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowSchedule";
let payload = json!({
"WindowId": "",
"Targets": "",
"ResourceType": "",
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeMaintenanceWindowSchedule' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"WindowId": "",
"Targets": "",
"ResourceType": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"WindowId": "",
"Targets": "",
"ResourceType": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowSchedule' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "WindowId": "",\n "Targets": "",\n "ResourceType": "",\n "Filters": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowSchedule'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"WindowId": "",
"Targets": "",
"ResourceType": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowSchedule")! 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
DescribeMaintenanceWindowTargets
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowTargets
HEADERS
X-Amz-Target
BODY json
{
"WindowId": "",
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeMaintenanceWindowTargets");
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 \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowTargets" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:WindowId ""
:Filters ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowTargets"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowTargets"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowTargets");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowTargets"
payload := strings.NewReader("{\n \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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: 76
{
"WindowId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowTargets")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowTargets"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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 \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowTargets")
.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=AmazonSSM.DescribeMaintenanceWindowTargets")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
WindowId: '',
Filters: '',
MaxResults: '',
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=AmazonSSM.DescribeMaintenanceWindowTargets');
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=AmazonSSM.DescribeMaintenanceWindowTargets',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {WindowId: '', Filters: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowTargets';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowId":"","Filters":"","MaxResults":"","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=AmazonSSM.DescribeMaintenanceWindowTargets',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "WindowId": "",\n "Filters": "",\n "MaxResults": "",\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 \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowTargets")
.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({WindowId: '', Filters: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowTargets',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {WindowId: '', Filters: '', MaxResults: '', 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=AmazonSSM.DescribeMaintenanceWindowTargets');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
WindowId: '',
Filters: '',
MaxResults: '',
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=AmazonSSM.DescribeMaintenanceWindowTargets',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {WindowId: '', Filters: '', MaxResults: '', 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=AmazonSSM.DescribeMaintenanceWindowTargets';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowId":"","Filters":"","MaxResults":"","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 = @{ @"WindowId": @"",
@"Filters": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowTargets"]
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=AmazonSSM.DescribeMaintenanceWindowTargets" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowTargets",
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([
'WindowId' => '',
'Filters' => '',
'MaxResults' => '',
'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=AmazonSSM.DescribeMaintenanceWindowTargets', [
'body' => '{
"WindowId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowTargets');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'WindowId' => '',
'Filters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'WindowId' => '',
'Filters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowTargets');
$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=AmazonSSM.DescribeMaintenanceWindowTargets' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowTargets' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowTargets"
payload = {
"WindowId": "",
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeMaintenanceWindowTargets"
payload <- "{\n \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowTargets")
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 \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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 \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowTargets";
let payload = json!({
"WindowId": "",
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeMaintenanceWindowTargets' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"WindowId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"WindowId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowTargets' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "WindowId": "",\n "Filters": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowTargets'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"WindowId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowTargets")! 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
DescribeMaintenanceWindowTasks
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowTasks
HEADERS
X-Amz-Target
BODY json
{
"WindowId": "",
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeMaintenanceWindowTasks");
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 \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowTasks" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:WindowId ""
:Filters ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowTasks"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowTasks"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowTasks");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowTasks"
payload := strings.NewReader("{\n \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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: 76
{
"WindowId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowTasks")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowTasks"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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 \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowTasks")
.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=AmazonSSM.DescribeMaintenanceWindowTasks")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
WindowId: '',
Filters: '',
MaxResults: '',
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=AmazonSSM.DescribeMaintenanceWindowTasks');
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=AmazonSSM.DescribeMaintenanceWindowTasks',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {WindowId: '', Filters: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowTasks';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowId":"","Filters":"","MaxResults":"","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=AmazonSSM.DescribeMaintenanceWindowTasks',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "WindowId": "",\n "Filters": "",\n "MaxResults": "",\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 \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowTasks")
.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({WindowId: '', Filters: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowTasks',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {WindowId: '', Filters: '', MaxResults: '', 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=AmazonSSM.DescribeMaintenanceWindowTasks');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
WindowId: '',
Filters: '',
MaxResults: '',
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=AmazonSSM.DescribeMaintenanceWindowTasks',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {WindowId: '', Filters: '', MaxResults: '', 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=AmazonSSM.DescribeMaintenanceWindowTasks';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowId":"","Filters":"","MaxResults":"","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 = @{ @"WindowId": @"",
@"Filters": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowTasks"]
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=AmazonSSM.DescribeMaintenanceWindowTasks" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowTasks",
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([
'WindowId' => '',
'Filters' => '',
'MaxResults' => '',
'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=AmazonSSM.DescribeMaintenanceWindowTasks', [
'body' => '{
"WindowId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowTasks');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'WindowId' => '',
'Filters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'WindowId' => '',
'Filters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowTasks');
$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=AmazonSSM.DescribeMaintenanceWindowTasks' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowTasks' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowTasks"
payload = {
"WindowId": "",
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeMaintenanceWindowTasks"
payload <- "{\n \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowTasks")
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 \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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 \"WindowId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowTasks";
let payload = json!({
"WindowId": "",
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeMaintenanceWindowTasks' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"WindowId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"WindowId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowTasks' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "WindowId": "",\n "Filters": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowTasks'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"WindowId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowTasks")! 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
DescribeMaintenanceWindows
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindows
HEADERS
X-Amz-Target
BODY json
{
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeMaintenanceWindows");
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 \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindows" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Filters ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindows"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindows"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindows");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindows"
payload := strings.NewReader("{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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
{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindows")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindows"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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 \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindows")
.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=AmazonSSM.DescribeMaintenanceWindows")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
Filters: '',
MaxResults: '',
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=AmazonSSM.DescribeMaintenanceWindows');
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=AmazonSSM.DescribeMaintenanceWindows',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Filters: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindows';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Filters":"","MaxResults":"","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=AmazonSSM.DescribeMaintenanceWindows',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Filters": "",\n "MaxResults": "",\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 \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindows")
.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({Filters: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindows',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Filters: '', MaxResults: '', 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=AmazonSSM.DescribeMaintenanceWindows');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Filters: '',
MaxResults: '',
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=AmazonSSM.DescribeMaintenanceWindows',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Filters: '', MaxResults: '', 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=AmazonSSM.DescribeMaintenanceWindows';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Filters":"","MaxResults":"","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 = @{ @"Filters": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindows"]
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=AmazonSSM.DescribeMaintenanceWindows" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindows",
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([
'Filters' => '',
'MaxResults' => '',
'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=AmazonSSM.DescribeMaintenanceWindows', [
'body' => '{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindows');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Filters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Filters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindows');
$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=AmazonSSM.DescribeMaintenanceWindows' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindows' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindows"
payload = {
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeMaintenanceWindows"
payload <- "{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindows")
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 \"Filters\": \"\",\n \"MaxResults\": \"\",\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 \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindows";
let payload = json!({
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeMaintenanceWindows' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindows' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Filters": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindows'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Filters": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindows")! 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
DescribeMaintenanceWindowsForTarget
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowsForTarget
HEADERS
X-Amz-Target
BODY json
{
"Targets": "",
"ResourceType": "",
"MaxResults": "",
"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=AmazonSSM.DescribeMaintenanceWindowsForTarget");
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 \"Targets\": \"\",\n \"ResourceType\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowsForTarget" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Targets ""
:ResourceType ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowsForTarget"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Targets\": \"\",\n \"ResourceType\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowsForTarget"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Targets\": \"\",\n \"ResourceType\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowsForTarget");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Targets\": \"\",\n \"ResourceType\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowsForTarget"
payload := strings.NewReader("{\n \"Targets\": \"\",\n \"ResourceType\": \"\",\n \"MaxResults\": \"\",\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: 80
{
"Targets": "",
"ResourceType": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowsForTarget")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Targets\": \"\",\n \"ResourceType\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowsForTarget"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Targets\": \"\",\n \"ResourceType\": \"\",\n \"MaxResults\": \"\",\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 \"Targets\": \"\",\n \"ResourceType\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowsForTarget")
.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=AmazonSSM.DescribeMaintenanceWindowsForTarget")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Targets\": \"\",\n \"ResourceType\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
Targets: '',
ResourceType: '',
MaxResults: '',
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=AmazonSSM.DescribeMaintenanceWindowsForTarget');
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=AmazonSSM.DescribeMaintenanceWindowsForTarget',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Targets: '', ResourceType: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowsForTarget';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Targets":"","ResourceType":"","MaxResults":"","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=AmazonSSM.DescribeMaintenanceWindowsForTarget',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Targets": "",\n "ResourceType": "",\n "MaxResults": "",\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 \"Targets\": \"\",\n \"ResourceType\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowsForTarget")
.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({Targets: '', ResourceType: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowsForTarget',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Targets: '', ResourceType: '', MaxResults: '', 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=AmazonSSM.DescribeMaintenanceWindowsForTarget');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Targets: '',
ResourceType: '',
MaxResults: '',
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=AmazonSSM.DescribeMaintenanceWindowsForTarget',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Targets: '', ResourceType: '', MaxResults: '', 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=AmazonSSM.DescribeMaintenanceWindowsForTarget';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Targets":"","ResourceType":"","MaxResults":"","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 = @{ @"Targets": @"",
@"ResourceType": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowsForTarget"]
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=AmazonSSM.DescribeMaintenanceWindowsForTarget" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Targets\": \"\",\n \"ResourceType\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowsForTarget",
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([
'Targets' => '',
'ResourceType' => '',
'MaxResults' => '',
'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=AmazonSSM.DescribeMaintenanceWindowsForTarget', [
'body' => '{
"Targets": "",
"ResourceType": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowsForTarget');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Targets' => '',
'ResourceType' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Targets' => '',
'ResourceType' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowsForTarget');
$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=AmazonSSM.DescribeMaintenanceWindowsForTarget' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Targets": "",
"ResourceType": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowsForTarget' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Targets": "",
"ResourceType": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Targets\": \"\",\n \"ResourceType\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowsForTarget"
payload = {
"Targets": "",
"ResourceType": "",
"MaxResults": "",
"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=AmazonSSM.DescribeMaintenanceWindowsForTarget"
payload <- "{\n \"Targets\": \"\",\n \"ResourceType\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowsForTarget")
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 \"Targets\": \"\",\n \"ResourceType\": \"\",\n \"MaxResults\": \"\",\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 \"Targets\": \"\",\n \"ResourceType\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeMaintenanceWindowsForTarget";
let payload = json!({
"Targets": "",
"ResourceType": "",
"MaxResults": "",
"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=AmazonSSM.DescribeMaintenanceWindowsForTarget' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Targets": "",
"ResourceType": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"Targets": "",
"ResourceType": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowsForTarget' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Targets": "",\n "ResourceType": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowsForTarget'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Targets": "",
"ResourceType": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeMaintenanceWindowsForTarget")! 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
DescribeOpsItems
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeOpsItems
HEADERS
X-Amz-Target
BODY json
{
"OpsItemFilters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeOpsItems");
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 \"OpsItemFilters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeOpsItems" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OpsItemFilters ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeOpsItems"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OpsItemFilters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeOpsItems"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OpsItemFilters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeOpsItems");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OpsItemFilters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeOpsItems"
payload := strings.NewReader("{\n \"OpsItemFilters\": \"\",\n \"MaxResults\": \"\",\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: 65
{
"OpsItemFilters": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeOpsItems")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OpsItemFilters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeOpsItems"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OpsItemFilters\": \"\",\n \"MaxResults\": \"\",\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 \"OpsItemFilters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeOpsItems")
.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=AmazonSSM.DescribeOpsItems")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OpsItemFilters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
OpsItemFilters: '',
MaxResults: '',
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=AmazonSSM.DescribeOpsItems');
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=AmazonSSM.DescribeOpsItems',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OpsItemFilters: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeOpsItems';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OpsItemFilters":"","MaxResults":"","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=AmazonSSM.DescribeOpsItems',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OpsItemFilters": "",\n "MaxResults": "",\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 \"OpsItemFilters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeOpsItems")
.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({OpsItemFilters: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeOpsItems',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OpsItemFilters: '', MaxResults: '', 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=AmazonSSM.DescribeOpsItems');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OpsItemFilters: '',
MaxResults: '',
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=AmazonSSM.DescribeOpsItems',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OpsItemFilters: '', MaxResults: '', 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=AmazonSSM.DescribeOpsItems';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OpsItemFilters":"","MaxResults":"","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 = @{ @"OpsItemFilters": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeOpsItems"]
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=AmazonSSM.DescribeOpsItems" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OpsItemFilters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeOpsItems",
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([
'OpsItemFilters' => '',
'MaxResults' => '',
'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=AmazonSSM.DescribeOpsItems', [
'body' => '{
"OpsItemFilters": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeOpsItems');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OpsItemFilters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OpsItemFilters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeOpsItems');
$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=AmazonSSM.DescribeOpsItems' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OpsItemFilters": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeOpsItems' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OpsItemFilters": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OpsItemFilters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeOpsItems"
payload = {
"OpsItemFilters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeOpsItems"
payload <- "{\n \"OpsItemFilters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeOpsItems")
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 \"OpsItemFilters\": \"\",\n \"MaxResults\": \"\",\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 \"OpsItemFilters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeOpsItems";
let payload = json!({
"OpsItemFilters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeOpsItems' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OpsItemFilters": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"OpsItemFilters": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeOpsItems' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OpsItemFilters": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeOpsItems'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OpsItemFilters": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeOpsItems")! 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
DescribeParameters
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeParameters
HEADERS
X-Amz-Target
BODY json
{
"Filters": "",
"ParameterFilters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeParameters");
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 \"Filters\": \"\",\n \"ParameterFilters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeParameters" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Filters ""
:ParameterFilters ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeParameters"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Filters\": \"\",\n \"ParameterFilters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeParameters"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Filters\": \"\",\n \"ParameterFilters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeParameters");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Filters\": \"\",\n \"ParameterFilters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeParameters"
payload := strings.NewReader("{\n \"Filters\": \"\",\n \"ParameterFilters\": \"\",\n \"MaxResults\": \"\",\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: 84
{
"Filters": "",
"ParameterFilters": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeParameters")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Filters\": \"\",\n \"ParameterFilters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeParameters"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Filters\": \"\",\n \"ParameterFilters\": \"\",\n \"MaxResults\": \"\",\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 \"Filters\": \"\",\n \"ParameterFilters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeParameters")
.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=AmazonSSM.DescribeParameters")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Filters\": \"\",\n \"ParameterFilters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
Filters: '',
ParameterFilters: '',
MaxResults: '',
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=AmazonSSM.DescribeParameters');
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=AmazonSSM.DescribeParameters',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Filters: '', ParameterFilters: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeParameters';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Filters":"","ParameterFilters":"","MaxResults":"","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=AmazonSSM.DescribeParameters',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Filters": "",\n "ParameterFilters": "",\n "MaxResults": "",\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 \"Filters\": \"\",\n \"ParameterFilters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeParameters")
.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({Filters: '', ParameterFilters: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeParameters',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Filters: '', ParameterFilters: '', MaxResults: '', 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=AmazonSSM.DescribeParameters');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Filters: '',
ParameterFilters: '',
MaxResults: '',
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=AmazonSSM.DescribeParameters',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Filters: '', ParameterFilters: '', MaxResults: '', 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=AmazonSSM.DescribeParameters';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Filters":"","ParameterFilters":"","MaxResults":"","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 = @{ @"Filters": @"",
@"ParameterFilters": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeParameters"]
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=AmazonSSM.DescribeParameters" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Filters\": \"\",\n \"ParameterFilters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeParameters",
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([
'Filters' => '',
'ParameterFilters' => '',
'MaxResults' => '',
'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=AmazonSSM.DescribeParameters', [
'body' => '{
"Filters": "",
"ParameterFilters": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeParameters');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Filters' => '',
'ParameterFilters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Filters' => '',
'ParameterFilters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeParameters');
$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=AmazonSSM.DescribeParameters' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Filters": "",
"ParameterFilters": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeParameters' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Filters": "",
"ParameterFilters": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Filters\": \"\",\n \"ParameterFilters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeParameters"
payload = {
"Filters": "",
"ParameterFilters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeParameters"
payload <- "{\n \"Filters\": \"\",\n \"ParameterFilters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeParameters")
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 \"Filters\": \"\",\n \"ParameterFilters\": \"\",\n \"MaxResults\": \"\",\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 \"Filters\": \"\",\n \"ParameterFilters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribeParameters";
let payload = json!({
"Filters": "",
"ParameterFilters": "",
"MaxResults": "",
"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=AmazonSSM.DescribeParameters' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Filters": "",
"ParameterFilters": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"Filters": "",
"ParameterFilters": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeParameters' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Filters": "",\n "ParameterFilters": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeParameters'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Filters": "",
"ParameterFilters": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeParameters")! 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
DescribePatchBaselines
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchBaselines
HEADERS
X-Amz-Target
BODY json
{
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribePatchBaselines");
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 \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchBaselines" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Filters ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchBaselines"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribePatchBaselines"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribePatchBaselines");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribePatchBaselines"
payload := strings.NewReader("{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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
{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchBaselines")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchBaselines"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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 \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchBaselines")
.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=AmazonSSM.DescribePatchBaselines")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
Filters: '',
MaxResults: '',
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=AmazonSSM.DescribePatchBaselines');
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=AmazonSSM.DescribePatchBaselines',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Filters: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchBaselines';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Filters":"","MaxResults":"","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=AmazonSSM.DescribePatchBaselines',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Filters": "",\n "MaxResults": "",\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 \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchBaselines")
.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({Filters: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchBaselines',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Filters: '', MaxResults: '', 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=AmazonSSM.DescribePatchBaselines');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Filters: '',
MaxResults: '',
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=AmazonSSM.DescribePatchBaselines',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Filters: '', MaxResults: '', 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=AmazonSSM.DescribePatchBaselines';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Filters":"","MaxResults":"","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 = @{ @"Filters": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchBaselines"]
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=AmazonSSM.DescribePatchBaselines" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchBaselines",
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([
'Filters' => '',
'MaxResults' => '',
'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=AmazonSSM.DescribePatchBaselines', [
'body' => '{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchBaselines');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Filters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Filters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchBaselines');
$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=AmazonSSM.DescribePatchBaselines' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchBaselines' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribePatchBaselines"
payload = {
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribePatchBaselines"
payload <- "{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribePatchBaselines")
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 \"Filters\": \"\",\n \"MaxResults\": \"\",\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 \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribePatchBaselines";
let payload = json!({
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.DescribePatchBaselines' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchBaselines' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Filters": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchBaselines'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Filters": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchBaselines")! 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
DescribePatchGroupState
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchGroupState
HEADERS
X-Amz-Target
BODY json
{
"PatchGroup": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchGroupState");
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 \"PatchGroup\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchGroupState" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:PatchGroup ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchGroupState"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"PatchGroup\": \"\"\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=AmazonSSM.DescribePatchGroupState"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"PatchGroup\": \"\"\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=AmazonSSM.DescribePatchGroupState");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"PatchGroup\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchGroupState"
payload := strings.NewReader("{\n \"PatchGroup\": \"\"\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
{
"PatchGroup": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchGroupState")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"PatchGroup\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchGroupState"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"PatchGroup\": \"\"\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 \"PatchGroup\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchGroupState")
.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=AmazonSSM.DescribePatchGroupState")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"PatchGroup\": \"\"\n}")
.asString();
const data = JSON.stringify({
PatchGroup: ''
});
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=AmazonSSM.DescribePatchGroupState');
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=AmazonSSM.DescribePatchGroupState',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {PatchGroup: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchGroupState';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"PatchGroup":""}'
};
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=AmazonSSM.DescribePatchGroupState',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "PatchGroup": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"PatchGroup\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchGroupState")
.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({PatchGroup: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchGroupState',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {PatchGroup: ''},
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=AmazonSSM.DescribePatchGroupState');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
PatchGroup: ''
});
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=AmazonSSM.DescribePatchGroupState',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {PatchGroup: ''}
};
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=AmazonSSM.DescribePatchGroupState';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"PatchGroup":""}'
};
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 = @{ @"PatchGroup": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchGroupState"]
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=AmazonSSM.DescribePatchGroupState" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"PatchGroup\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchGroupState",
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([
'PatchGroup' => ''
]),
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=AmazonSSM.DescribePatchGroupState', [
'body' => '{
"PatchGroup": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchGroupState');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'PatchGroup' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'PatchGroup' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchGroupState');
$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=AmazonSSM.DescribePatchGroupState' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"PatchGroup": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchGroupState' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"PatchGroup": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"PatchGroup\": \"\"\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=AmazonSSM.DescribePatchGroupState"
payload = { "PatchGroup": "" }
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=AmazonSSM.DescribePatchGroupState"
payload <- "{\n \"PatchGroup\": \"\"\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=AmazonSSM.DescribePatchGroupState")
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 \"PatchGroup\": \"\"\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 \"PatchGroup\": \"\"\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=AmazonSSM.DescribePatchGroupState";
let payload = json!({"PatchGroup": ""});
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=AmazonSSM.DescribePatchGroupState' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"PatchGroup": ""
}'
echo '{
"PatchGroup": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchGroupState' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "PatchGroup": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchGroupState'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["PatchGroup": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchGroupState")! 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
DescribePatchGroups
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchGroups
HEADERS
X-Amz-Target
BODY json
{
"MaxResults": "",
"Filters": "",
"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=AmazonSSM.DescribePatchGroups");
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 \"MaxResults\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchGroups" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:MaxResults ""
:Filters ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchGroups"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"MaxResults\": \"\",\n \"Filters\": \"\",\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=AmazonSSM.DescribePatchGroups"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"MaxResults\": \"\",\n \"Filters\": \"\",\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=AmazonSSM.DescribePatchGroups");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"MaxResults\": \"\",\n \"Filters\": \"\",\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=AmazonSSM.DescribePatchGroups"
payload := strings.NewReader("{\n \"MaxResults\": \"\",\n \"Filters\": \"\",\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
{
"MaxResults": "",
"Filters": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchGroups")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"MaxResults\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchGroups"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"MaxResults\": \"\",\n \"Filters\": \"\",\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 \"MaxResults\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchGroups")
.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=AmazonSSM.DescribePatchGroups")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"MaxResults\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
MaxResults: '',
Filters: '',
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=AmazonSSM.DescribePatchGroups');
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=AmazonSSM.DescribePatchGroups',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {MaxResults: '', Filters: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchGroups';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"MaxResults":"","Filters":"","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=AmazonSSM.DescribePatchGroups',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "MaxResults": "",\n "Filters": "",\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 \"MaxResults\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchGroups")
.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({MaxResults: '', Filters: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchGroups',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {MaxResults: '', Filters: '', 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=AmazonSSM.DescribePatchGroups');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
MaxResults: '',
Filters: '',
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=AmazonSSM.DescribePatchGroups',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {MaxResults: '', Filters: '', 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=AmazonSSM.DescribePatchGroups';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"MaxResults":"","Filters":"","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 = @{ @"MaxResults": @"",
@"Filters": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchGroups"]
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=AmazonSSM.DescribePatchGroups" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"MaxResults\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchGroups",
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([
'MaxResults' => '',
'Filters' => '',
'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=AmazonSSM.DescribePatchGroups', [
'body' => '{
"MaxResults": "",
"Filters": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchGroups');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'MaxResults' => '',
'Filters' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'MaxResults' => '',
'Filters' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchGroups');
$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=AmazonSSM.DescribePatchGroups' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"MaxResults": "",
"Filters": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchGroups' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"MaxResults": "",
"Filters": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"MaxResults\": \"\",\n \"Filters\": \"\",\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=AmazonSSM.DescribePatchGroups"
payload = {
"MaxResults": "",
"Filters": "",
"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=AmazonSSM.DescribePatchGroups"
payload <- "{\n \"MaxResults\": \"\",\n \"Filters\": \"\",\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=AmazonSSM.DescribePatchGroups")
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 \"MaxResults\": \"\",\n \"Filters\": \"\",\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 \"MaxResults\": \"\",\n \"Filters\": \"\",\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=AmazonSSM.DescribePatchGroups";
let payload = json!({
"MaxResults": "",
"Filters": "",
"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=AmazonSSM.DescribePatchGroups' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"MaxResults": "",
"Filters": "",
"NextToken": ""
}'
echo '{
"MaxResults": "",
"Filters": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchGroups' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "MaxResults": "",\n "Filters": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchGroups'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"MaxResults": "",
"Filters": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchGroups")! 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
DescribePatchProperties
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchProperties
HEADERS
X-Amz-Target
BODY json
{
"OperatingSystem": "",
"Property": "",
"PatchSet": "",
"MaxResults": "",
"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=AmazonSSM.DescribePatchProperties");
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 \"OperatingSystem\": \"\",\n \"Property\": \"\",\n \"PatchSet\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchProperties" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OperatingSystem ""
:Property ""
:PatchSet ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchProperties"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OperatingSystem\": \"\",\n \"Property\": \"\",\n \"PatchSet\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribePatchProperties"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OperatingSystem\": \"\",\n \"Property\": \"\",\n \"PatchSet\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribePatchProperties");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OperatingSystem\": \"\",\n \"Property\": \"\",\n \"PatchSet\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribePatchProperties"
payload := strings.NewReader("{\n \"OperatingSystem\": \"\",\n \"Property\": \"\",\n \"PatchSet\": \"\",\n \"MaxResults\": \"\",\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: 102
{
"OperatingSystem": "",
"Property": "",
"PatchSet": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchProperties")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OperatingSystem\": \"\",\n \"Property\": \"\",\n \"PatchSet\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchProperties"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OperatingSystem\": \"\",\n \"Property\": \"\",\n \"PatchSet\": \"\",\n \"MaxResults\": \"\",\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 \"OperatingSystem\": \"\",\n \"Property\": \"\",\n \"PatchSet\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchProperties")
.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=AmazonSSM.DescribePatchProperties")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OperatingSystem\": \"\",\n \"Property\": \"\",\n \"PatchSet\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
OperatingSystem: '',
Property: '',
PatchSet: '',
MaxResults: '',
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=AmazonSSM.DescribePatchProperties');
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=AmazonSSM.DescribePatchProperties',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OperatingSystem: '', Property: '', PatchSet: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchProperties';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OperatingSystem":"","Property":"","PatchSet":"","MaxResults":"","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=AmazonSSM.DescribePatchProperties',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OperatingSystem": "",\n "Property": "",\n "PatchSet": "",\n "MaxResults": "",\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 \"OperatingSystem\": \"\",\n \"Property\": \"\",\n \"PatchSet\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchProperties")
.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({OperatingSystem: '', Property: '', PatchSet: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchProperties',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OperatingSystem: '', Property: '', PatchSet: '', MaxResults: '', 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=AmazonSSM.DescribePatchProperties');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OperatingSystem: '',
Property: '',
PatchSet: '',
MaxResults: '',
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=AmazonSSM.DescribePatchProperties',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OperatingSystem: '', Property: '', PatchSet: '', MaxResults: '', 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=AmazonSSM.DescribePatchProperties';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OperatingSystem":"","Property":"","PatchSet":"","MaxResults":"","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 = @{ @"OperatingSystem": @"",
@"Property": @"",
@"PatchSet": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchProperties"]
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=AmazonSSM.DescribePatchProperties" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OperatingSystem\": \"\",\n \"Property\": \"\",\n \"PatchSet\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchProperties",
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([
'OperatingSystem' => '',
'Property' => '',
'PatchSet' => '',
'MaxResults' => '',
'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=AmazonSSM.DescribePatchProperties', [
'body' => '{
"OperatingSystem": "",
"Property": "",
"PatchSet": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchProperties');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OperatingSystem' => '',
'Property' => '',
'PatchSet' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OperatingSystem' => '',
'Property' => '',
'PatchSet' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchProperties');
$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=AmazonSSM.DescribePatchProperties' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OperatingSystem": "",
"Property": "",
"PatchSet": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchProperties' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OperatingSystem": "",
"Property": "",
"PatchSet": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OperatingSystem\": \"\",\n \"Property\": \"\",\n \"PatchSet\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribePatchProperties"
payload = {
"OperatingSystem": "",
"Property": "",
"PatchSet": "",
"MaxResults": "",
"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=AmazonSSM.DescribePatchProperties"
payload <- "{\n \"OperatingSystem\": \"\",\n \"Property\": \"\",\n \"PatchSet\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribePatchProperties")
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 \"OperatingSystem\": \"\",\n \"Property\": \"\",\n \"PatchSet\": \"\",\n \"MaxResults\": \"\",\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 \"OperatingSystem\": \"\",\n \"Property\": \"\",\n \"PatchSet\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.DescribePatchProperties";
let payload = json!({
"OperatingSystem": "",
"Property": "",
"PatchSet": "",
"MaxResults": "",
"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=AmazonSSM.DescribePatchProperties' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OperatingSystem": "",
"Property": "",
"PatchSet": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"OperatingSystem": "",
"Property": "",
"PatchSet": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchProperties' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OperatingSystem": "",\n "Property": "",\n "PatchSet": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchProperties'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OperatingSystem": "",
"Property": "",
"PatchSet": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribePatchProperties")! 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
DescribeSessions
{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeSessions
HEADERS
X-Amz-Target
BODY json
{
"State": "",
"MaxResults": "",
"NextToken": "",
"Filters": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeSessions");
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 \"State\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeSessions" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:State ""
:MaxResults ""
:NextToken ""
:Filters ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeSessions"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"State\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\"\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=AmazonSSM.DescribeSessions"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"State\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\"\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=AmazonSSM.DescribeSessions");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"State\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeSessions"
payload := strings.NewReader("{\n \"State\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\"\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: 73
{
"State": "",
"MaxResults": "",
"NextToken": "",
"Filters": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeSessions")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"State\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeSessions"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"State\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\"\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 \"State\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeSessions")
.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=AmazonSSM.DescribeSessions")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"State\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\"\n}")
.asString();
const data = JSON.stringify({
State: '',
MaxResults: '',
NextToken: '',
Filters: ''
});
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=AmazonSSM.DescribeSessions');
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=AmazonSSM.DescribeSessions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {State: '', MaxResults: '', NextToken: '', Filters: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeSessions';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"State":"","MaxResults":"","NextToken":"","Filters":""}'
};
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=AmazonSSM.DescribeSessions',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "State": "",\n "MaxResults": "",\n "NextToken": "",\n "Filters": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"State\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeSessions")
.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({State: '', MaxResults: '', NextToken: '', Filters: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeSessions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {State: '', MaxResults: '', NextToken: '', Filters: ''},
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=AmazonSSM.DescribeSessions');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
State: '',
MaxResults: '',
NextToken: '',
Filters: ''
});
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=AmazonSSM.DescribeSessions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {State: '', MaxResults: '', NextToken: '', Filters: ''}
};
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=AmazonSSM.DescribeSessions';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"State":"","MaxResults":"","NextToken":"","Filters":""}'
};
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 = @{ @"State": @"",
@"MaxResults": @"",
@"NextToken": @"",
@"Filters": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeSessions"]
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=AmazonSSM.DescribeSessions" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"State\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeSessions",
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([
'State' => '',
'MaxResults' => '',
'NextToken' => '',
'Filters' => ''
]),
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=AmazonSSM.DescribeSessions', [
'body' => '{
"State": "",
"MaxResults": "",
"NextToken": "",
"Filters": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeSessions');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'State' => '',
'MaxResults' => '',
'NextToken' => '',
'Filters' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'State' => '',
'MaxResults' => '',
'NextToken' => '',
'Filters' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeSessions');
$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=AmazonSSM.DescribeSessions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"State": "",
"MaxResults": "",
"NextToken": "",
"Filters": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeSessions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"State": "",
"MaxResults": "",
"NextToken": "",
"Filters": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"State\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\"\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=AmazonSSM.DescribeSessions"
payload = {
"State": "",
"MaxResults": "",
"NextToken": "",
"Filters": ""
}
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=AmazonSSM.DescribeSessions"
payload <- "{\n \"State\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\"\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=AmazonSSM.DescribeSessions")
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 \"State\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\"\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 \"State\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\"\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=AmazonSSM.DescribeSessions";
let payload = json!({
"State": "",
"MaxResults": "",
"NextToken": "",
"Filters": ""
});
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=AmazonSSM.DescribeSessions' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"State": "",
"MaxResults": "",
"NextToken": "",
"Filters": ""
}'
echo '{
"State": "",
"MaxResults": "",
"NextToken": "",
"Filters": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeSessions' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "State": "",\n "MaxResults": "",\n "NextToken": "",\n "Filters": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeSessions'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"State": "",
"MaxResults": "",
"NextToken": "",
"Filters": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DescribeSessions")! 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=AmazonSSM.DisassociateOpsItemRelatedItem");
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 \"OpsItemId\": \"\",\n \"AssociationId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DisassociateOpsItemRelatedItem" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OpsItemId ""
:AssociationId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DisassociateOpsItemRelatedItem"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OpsItemId\": \"\",\n \"AssociationId\": \"\"\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=AmazonSSM.DisassociateOpsItemRelatedItem"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OpsItemId\": \"\",\n \"AssociationId\": \"\"\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=AmazonSSM.DisassociateOpsItemRelatedItem");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OpsItemId\": \"\",\n \"AssociationId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DisassociateOpsItemRelatedItem"
payload := strings.NewReader("{\n \"OpsItemId\": \"\",\n \"AssociationId\": \"\"\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: 44
{
"OpsItemId": "",
"AssociationId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DisassociateOpsItemRelatedItem")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OpsItemId\": \"\",\n \"AssociationId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DisassociateOpsItemRelatedItem"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OpsItemId\": \"\",\n \"AssociationId\": \"\"\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 \"OpsItemId\": \"\",\n \"AssociationId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DisassociateOpsItemRelatedItem")
.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=AmazonSSM.DisassociateOpsItemRelatedItem")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OpsItemId\": \"\",\n \"AssociationId\": \"\"\n}")
.asString();
const data = JSON.stringify({
OpsItemId: '',
AssociationId: ''
});
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=AmazonSSM.DisassociateOpsItemRelatedItem');
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=AmazonSSM.DisassociateOpsItemRelatedItem',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OpsItemId: '', AssociationId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DisassociateOpsItemRelatedItem';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OpsItemId":"","AssociationId":""}'
};
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=AmazonSSM.DisassociateOpsItemRelatedItem',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OpsItemId": "",\n "AssociationId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OpsItemId\": \"\",\n \"AssociationId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.DisassociateOpsItemRelatedItem")
.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({OpsItemId: '', AssociationId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DisassociateOpsItemRelatedItem',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OpsItemId: '', AssociationId: ''},
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=AmazonSSM.DisassociateOpsItemRelatedItem');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OpsItemId: '',
AssociationId: ''
});
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=AmazonSSM.DisassociateOpsItemRelatedItem',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OpsItemId: '', AssociationId: ''}
};
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=AmazonSSM.DisassociateOpsItemRelatedItem';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OpsItemId":"","AssociationId":""}'
};
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 = @{ @"OpsItemId": @"",
@"AssociationId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DisassociateOpsItemRelatedItem"]
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=AmazonSSM.DisassociateOpsItemRelatedItem" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OpsItemId\": \"\",\n \"AssociationId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.DisassociateOpsItemRelatedItem",
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([
'OpsItemId' => '',
'AssociationId' => ''
]),
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=AmazonSSM.DisassociateOpsItemRelatedItem', [
'body' => '{
"OpsItemId": "",
"AssociationId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DisassociateOpsItemRelatedItem');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OpsItemId' => '',
'AssociationId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OpsItemId' => '',
'AssociationId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.DisassociateOpsItemRelatedItem');
$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=AmazonSSM.DisassociateOpsItemRelatedItem' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OpsItemId": "",
"AssociationId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DisassociateOpsItemRelatedItem' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OpsItemId": "",
"AssociationId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OpsItemId\": \"\",\n \"AssociationId\": \"\"\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=AmazonSSM.DisassociateOpsItemRelatedItem"
payload = {
"OpsItemId": "",
"AssociationId": ""
}
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=AmazonSSM.DisassociateOpsItemRelatedItem"
payload <- "{\n \"OpsItemId\": \"\",\n \"AssociationId\": \"\"\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=AmazonSSM.DisassociateOpsItemRelatedItem")
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 \"OpsItemId\": \"\",\n \"AssociationId\": \"\"\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 \"OpsItemId\": \"\",\n \"AssociationId\": \"\"\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=AmazonSSM.DisassociateOpsItemRelatedItem";
let payload = json!({
"OpsItemId": "",
"AssociationId": ""
});
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=AmazonSSM.DisassociateOpsItemRelatedItem' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OpsItemId": "",
"AssociationId": ""
}'
echo '{
"OpsItemId": "",
"AssociationId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DisassociateOpsItemRelatedItem' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OpsItemId": "",\n "AssociationId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.DisassociateOpsItemRelatedItem'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OpsItemId": "",
"AssociationId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.DisassociateOpsItemRelatedItem")! 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
GetAutomationExecution
{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetAutomationExecution
HEADERS
X-Amz-Target
BODY json
{
"AutomationExecutionId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetAutomationExecution");
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 \"AutomationExecutionId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetAutomationExecution" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:AutomationExecutionId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetAutomationExecution"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"AutomationExecutionId\": \"\"\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=AmazonSSM.GetAutomationExecution"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"AutomationExecutionId\": \"\"\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=AmazonSSM.GetAutomationExecution");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AutomationExecutionId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetAutomationExecution"
payload := strings.NewReader("{\n \"AutomationExecutionId\": \"\"\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: 33
{
"AutomationExecutionId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetAutomationExecution")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"AutomationExecutionId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetAutomationExecution"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AutomationExecutionId\": \"\"\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 \"AutomationExecutionId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetAutomationExecution")
.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=AmazonSSM.GetAutomationExecution")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"AutomationExecutionId\": \"\"\n}")
.asString();
const data = JSON.stringify({
AutomationExecutionId: ''
});
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=AmazonSSM.GetAutomationExecution');
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=AmazonSSM.GetAutomationExecution',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AutomationExecutionId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetAutomationExecution';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AutomationExecutionId":""}'
};
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=AmazonSSM.GetAutomationExecution',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "AutomationExecutionId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AutomationExecutionId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetAutomationExecution")
.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({AutomationExecutionId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetAutomationExecution',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {AutomationExecutionId: ''},
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=AmazonSSM.GetAutomationExecution');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
AutomationExecutionId: ''
});
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=AmazonSSM.GetAutomationExecution',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AutomationExecutionId: ''}
};
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=AmazonSSM.GetAutomationExecution';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AutomationExecutionId":""}'
};
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 = @{ @"AutomationExecutionId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetAutomationExecution"]
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=AmazonSSM.GetAutomationExecution" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"AutomationExecutionId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetAutomationExecution",
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([
'AutomationExecutionId' => ''
]),
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=AmazonSSM.GetAutomationExecution', [
'body' => '{
"AutomationExecutionId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetAutomationExecution');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AutomationExecutionId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AutomationExecutionId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetAutomationExecution');
$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=AmazonSSM.GetAutomationExecution' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AutomationExecutionId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetAutomationExecution' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AutomationExecutionId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AutomationExecutionId\": \"\"\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=AmazonSSM.GetAutomationExecution"
payload = { "AutomationExecutionId": "" }
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=AmazonSSM.GetAutomationExecution"
payload <- "{\n \"AutomationExecutionId\": \"\"\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=AmazonSSM.GetAutomationExecution")
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 \"AutomationExecutionId\": \"\"\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 \"AutomationExecutionId\": \"\"\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=AmazonSSM.GetAutomationExecution";
let payload = json!({"AutomationExecutionId": ""});
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=AmazonSSM.GetAutomationExecution' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"AutomationExecutionId": ""
}'
echo '{
"AutomationExecutionId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetAutomationExecution' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "AutomationExecutionId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetAutomationExecution'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["AutomationExecutionId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetAutomationExecution")! 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
GetCalendarState
{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetCalendarState
HEADERS
X-Amz-Target
BODY json
{
"CalendarNames": "",
"AtTime": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetCalendarState");
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 \"CalendarNames\": \"\",\n \"AtTime\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetCalendarState" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:CalendarNames ""
:AtTime ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetCalendarState"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"CalendarNames\": \"\",\n \"AtTime\": \"\"\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=AmazonSSM.GetCalendarState"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"CalendarNames\": \"\",\n \"AtTime\": \"\"\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=AmazonSSM.GetCalendarState");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"CalendarNames\": \"\",\n \"AtTime\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetCalendarState"
payload := strings.NewReader("{\n \"CalendarNames\": \"\",\n \"AtTime\": \"\"\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
{
"CalendarNames": "",
"AtTime": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetCalendarState")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"CalendarNames\": \"\",\n \"AtTime\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetCalendarState"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"CalendarNames\": \"\",\n \"AtTime\": \"\"\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 \"CalendarNames\": \"\",\n \"AtTime\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetCalendarState")
.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=AmazonSSM.GetCalendarState")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"CalendarNames\": \"\",\n \"AtTime\": \"\"\n}")
.asString();
const data = JSON.stringify({
CalendarNames: '',
AtTime: ''
});
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=AmazonSSM.GetCalendarState');
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=AmazonSSM.GetCalendarState',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {CalendarNames: '', AtTime: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetCalendarState';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"CalendarNames":"","AtTime":""}'
};
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=AmazonSSM.GetCalendarState',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "CalendarNames": "",\n "AtTime": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"CalendarNames\": \"\",\n \"AtTime\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetCalendarState")
.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({CalendarNames: '', AtTime: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetCalendarState',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {CalendarNames: '', AtTime: ''},
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=AmazonSSM.GetCalendarState');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
CalendarNames: '',
AtTime: ''
});
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=AmazonSSM.GetCalendarState',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {CalendarNames: '', AtTime: ''}
};
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=AmazonSSM.GetCalendarState';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"CalendarNames":"","AtTime":""}'
};
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 = @{ @"CalendarNames": @"",
@"AtTime": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetCalendarState"]
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=AmazonSSM.GetCalendarState" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"CalendarNames\": \"\",\n \"AtTime\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetCalendarState",
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([
'CalendarNames' => '',
'AtTime' => ''
]),
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=AmazonSSM.GetCalendarState', [
'body' => '{
"CalendarNames": "",
"AtTime": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetCalendarState');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'CalendarNames' => '',
'AtTime' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'CalendarNames' => '',
'AtTime' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetCalendarState');
$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=AmazonSSM.GetCalendarState' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"CalendarNames": "",
"AtTime": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetCalendarState' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"CalendarNames": "",
"AtTime": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"CalendarNames\": \"\",\n \"AtTime\": \"\"\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=AmazonSSM.GetCalendarState"
payload = {
"CalendarNames": "",
"AtTime": ""
}
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=AmazonSSM.GetCalendarState"
payload <- "{\n \"CalendarNames\": \"\",\n \"AtTime\": \"\"\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=AmazonSSM.GetCalendarState")
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 \"CalendarNames\": \"\",\n \"AtTime\": \"\"\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 \"CalendarNames\": \"\",\n \"AtTime\": \"\"\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=AmazonSSM.GetCalendarState";
let payload = json!({
"CalendarNames": "",
"AtTime": ""
});
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=AmazonSSM.GetCalendarState' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"CalendarNames": "",
"AtTime": ""
}'
echo '{
"CalendarNames": "",
"AtTime": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetCalendarState' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "CalendarNames": "",\n "AtTime": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetCalendarState'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"CalendarNames": "",
"AtTime": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetCalendarState")! 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
GetCommandInvocation
{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetCommandInvocation
HEADERS
X-Amz-Target
BODY json
{
"CommandId": "",
"InstanceId": "",
"PluginName": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetCommandInvocation");
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 \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"PluginName\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetCommandInvocation" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:CommandId ""
:InstanceId ""
:PluginName ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetCommandInvocation"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"PluginName\": \"\"\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=AmazonSSM.GetCommandInvocation"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"PluginName\": \"\"\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=AmazonSSM.GetCommandInvocation");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"PluginName\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetCommandInvocation"
payload := strings.NewReader("{\n \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"PluginName\": \"\"\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: 61
{
"CommandId": "",
"InstanceId": "",
"PluginName": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetCommandInvocation")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"PluginName\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetCommandInvocation"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"PluginName\": \"\"\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 \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"PluginName\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetCommandInvocation")
.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=AmazonSSM.GetCommandInvocation")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"PluginName\": \"\"\n}")
.asString();
const data = JSON.stringify({
CommandId: '',
InstanceId: '',
PluginName: ''
});
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=AmazonSSM.GetCommandInvocation');
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=AmazonSSM.GetCommandInvocation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {CommandId: '', InstanceId: '', PluginName: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetCommandInvocation';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"CommandId":"","InstanceId":"","PluginName":""}'
};
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=AmazonSSM.GetCommandInvocation',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "CommandId": "",\n "InstanceId": "",\n "PluginName": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"PluginName\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetCommandInvocation")
.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({CommandId: '', InstanceId: '', PluginName: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetCommandInvocation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {CommandId: '', InstanceId: '', PluginName: ''},
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=AmazonSSM.GetCommandInvocation');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
CommandId: '',
InstanceId: '',
PluginName: ''
});
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=AmazonSSM.GetCommandInvocation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {CommandId: '', InstanceId: '', PluginName: ''}
};
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=AmazonSSM.GetCommandInvocation';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"CommandId":"","InstanceId":"","PluginName":""}'
};
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 = @{ @"CommandId": @"",
@"InstanceId": @"",
@"PluginName": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetCommandInvocation"]
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=AmazonSSM.GetCommandInvocation" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"PluginName\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetCommandInvocation",
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([
'CommandId' => '',
'InstanceId' => '',
'PluginName' => ''
]),
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=AmazonSSM.GetCommandInvocation', [
'body' => '{
"CommandId": "",
"InstanceId": "",
"PluginName": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetCommandInvocation');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'CommandId' => '',
'InstanceId' => '',
'PluginName' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'CommandId' => '',
'InstanceId' => '',
'PluginName' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetCommandInvocation');
$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=AmazonSSM.GetCommandInvocation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"CommandId": "",
"InstanceId": "",
"PluginName": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetCommandInvocation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"CommandId": "",
"InstanceId": "",
"PluginName": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"PluginName\": \"\"\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=AmazonSSM.GetCommandInvocation"
payload = {
"CommandId": "",
"InstanceId": "",
"PluginName": ""
}
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=AmazonSSM.GetCommandInvocation"
payload <- "{\n \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"PluginName\": \"\"\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=AmazonSSM.GetCommandInvocation")
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 \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"PluginName\": \"\"\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 \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"PluginName\": \"\"\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=AmazonSSM.GetCommandInvocation";
let payload = json!({
"CommandId": "",
"InstanceId": "",
"PluginName": ""
});
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=AmazonSSM.GetCommandInvocation' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"CommandId": "",
"InstanceId": "",
"PluginName": ""
}'
echo '{
"CommandId": "",
"InstanceId": "",
"PluginName": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetCommandInvocation' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "CommandId": "",\n "InstanceId": "",\n "PluginName": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetCommandInvocation'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"CommandId": "",
"InstanceId": "",
"PluginName": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetCommandInvocation")! 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
GetConnectionStatus
{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetConnectionStatus
HEADERS
X-Amz-Target
BODY json
{
"Target": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetConnectionStatus");
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 \"Target\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetConnectionStatus" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Target ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetConnectionStatus"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Target\": \"\"\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=AmazonSSM.GetConnectionStatus"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Target\": \"\"\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=AmazonSSM.GetConnectionStatus");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Target\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetConnectionStatus"
payload := strings.NewReader("{\n \"Target\": \"\"\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: 18
{
"Target": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetConnectionStatus")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Target\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetConnectionStatus"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Target\": \"\"\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 \"Target\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetConnectionStatus")
.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=AmazonSSM.GetConnectionStatus")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Target\": \"\"\n}")
.asString();
const data = JSON.stringify({
Target: ''
});
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=AmazonSSM.GetConnectionStatus');
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=AmazonSSM.GetConnectionStatus',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Target: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetConnectionStatus';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Target":""}'
};
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=AmazonSSM.GetConnectionStatus',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Target": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Target\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetConnectionStatus")
.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({Target: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetConnectionStatus',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Target: ''},
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=AmazonSSM.GetConnectionStatus');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Target: ''
});
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=AmazonSSM.GetConnectionStatus',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Target: ''}
};
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=AmazonSSM.GetConnectionStatus';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Target":""}'
};
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 = @{ @"Target": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetConnectionStatus"]
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=AmazonSSM.GetConnectionStatus" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Target\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetConnectionStatus",
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([
'Target' => ''
]),
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=AmazonSSM.GetConnectionStatus', [
'body' => '{
"Target": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetConnectionStatus');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Target' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Target' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetConnectionStatus');
$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=AmazonSSM.GetConnectionStatus' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Target": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetConnectionStatus' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Target": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Target\": \"\"\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=AmazonSSM.GetConnectionStatus"
payload = { "Target": "" }
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=AmazonSSM.GetConnectionStatus"
payload <- "{\n \"Target\": \"\"\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=AmazonSSM.GetConnectionStatus")
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 \"Target\": \"\"\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 \"Target\": \"\"\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=AmazonSSM.GetConnectionStatus";
let payload = json!({"Target": ""});
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=AmazonSSM.GetConnectionStatus' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Target": ""
}'
echo '{
"Target": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetConnectionStatus' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Target": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetConnectionStatus'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["Target": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetConnectionStatus")! 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
GetDefaultPatchBaseline
{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDefaultPatchBaseline
HEADERS
X-Amz-Target
BODY json
{
"OperatingSystem": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDefaultPatchBaseline");
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 \"OperatingSystem\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDefaultPatchBaseline" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OperatingSystem ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDefaultPatchBaseline"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OperatingSystem\": \"\"\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=AmazonSSM.GetDefaultPatchBaseline"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OperatingSystem\": \"\"\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=AmazonSSM.GetDefaultPatchBaseline");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OperatingSystem\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDefaultPatchBaseline"
payload := strings.NewReader("{\n \"OperatingSystem\": \"\"\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: 27
{
"OperatingSystem": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDefaultPatchBaseline")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OperatingSystem\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDefaultPatchBaseline"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OperatingSystem\": \"\"\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 \"OperatingSystem\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDefaultPatchBaseline")
.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=AmazonSSM.GetDefaultPatchBaseline")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OperatingSystem\": \"\"\n}")
.asString();
const data = JSON.stringify({
OperatingSystem: ''
});
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=AmazonSSM.GetDefaultPatchBaseline');
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=AmazonSSM.GetDefaultPatchBaseline',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OperatingSystem: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDefaultPatchBaseline';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OperatingSystem":""}'
};
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=AmazonSSM.GetDefaultPatchBaseline',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OperatingSystem": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OperatingSystem\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDefaultPatchBaseline")
.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({OperatingSystem: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDefaultPatchBaseline',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OperatingSystem: ''},
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=AmazonSSM.GetDefaultPatchBaseline');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OperatingSystem: ''
});
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=AmazonSSM.GetDefaultPatchBaseline',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OperatingSystem: ''}
};
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=AmazonSSM.GetDefaultPatchBaseline';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OperatingSystem":""}'
};
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 = @{ @"OperatingSystem": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDefaultPatchBaseline"]
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=AmazonSSM.GetDefaultPatchBaseline" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OperatingSystem\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDefaultPatchBaseline",
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([
'OperatingSystem' => ''
]),
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=AmazonSSM.GetDefaultPatchBaseline', [
'body' => '{
"OperatingSystem": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDefaultPatchBaseline');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OperatingSystem' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OperatingSystem' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDefaultPatchBaseline');
$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=AmazonSSM.GetDefaultPatchBaseline' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OperatingSystem": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDefaultPatchBaseline' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OperatingSystem": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OperatingSystem\": \"\"\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=AmazonSSM.GetDefaultPatchBaseline"
payload = { "OperatingSystem": "" }
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=AmazonSSM.GetDefaultPatchBaseline"
payload <- "{\n \"OperatingSystem\": \"\"\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=AmazonSSM.GetDefaultPatchBaseline")
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 \"OperatingSystem\": \"\"\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 \"OperatingSystem\": \"\"\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=AmazonSSM.GetDefaultPatchBaseline";
let payload = json!({"OperatingSystem": ""});
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=AmazonSSM.GetDefaultPatchBaseline' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OperatingSystem": ""
}'
echo '{
"OperatingSystem": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDefaultPatchBaseline' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OperatingSystem": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDefaultPatchBaseline'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["OperatingSystem": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDefaultPatchBaseline")! 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
GetDeployablePatchSnapshotForInstance
{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDeployablePatchSnapshotForInstance
HEADERS
X-Amz-Target
BODY json
{
"InstanceId": "",
"SnapshotId": "",
"BaselineOverride": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDeployablePatchSnapshotForInstance");
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 \"InstanceId\": \"\",\n \"SnapshotId\": \"\",\n \"BaselineOverride\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDeployablePatchSnapshotForInstance" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:InstanceId ""
:SnapshotId ""
:BaselineOverride ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDeployablePatchSnapshotForInstance"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"InstanceId\": \"\",\n \"SnapshotId\": \"\",\n \"BaselineOverride\": \"\"\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=AmazonSSM.GetDeployablePatchSnapshotForInstance"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"InstanceId\": \"\",\n \"SnapshotId\": \"\",\n \"BaselineOverride\": \"\"\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=AmazonSSM.GetDeployablePatchSnapshotForInstance");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"InstanceId\": \"\",\n \"SnapshotId\": \"\",\n \"BaselineOverride\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDeployablePatchSnapshotForInstance"
payload := strings.NewReader("{\n \"InstanceId\": \"\",\n \"SnapshotId\": \"\",\n \"BaselineOverride\": \"\"\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: 68
{
"InstanceId": "",
"SnapshotId": "",
"BaselineOverride": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDeployablePatchSnapshotForInstance")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"InstanceId\": \"\",\n \"SnapshotId\": \"\",\n \"BaselineOverride\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDeployablePatchSnapshotForInstance"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"InstanceId\": \"\",\n \"SnapshotId\": \"\",\n \"BaselineOverride\": \"\"\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 \"InstanceId\": \"\",\n \"SnapshotId\": \"\",\n \"BaselineOverride\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDeployablePatchSnapshotForInstance")
.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=AmazonSSM.GetDeployablePatchSnapshotForInstance")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"InstanceId\": \"\",\n \"SnapshotId\": \"\",\n \"BaselineOverride\": \"\"\n}")
.asString();
const data = JSON.stringify({
InstanceId: '',
SnapshotId: '',
BaselineOverride: ''
});
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=AmazonSSM.GetDeployablePatchSnapshotForInstance');
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=AmazonSSM.GetDeployablePatchSnapshotForInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: '', SnapshotId: '', BaselineOverride: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDeployablePatchSnapshotForInstance';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":"","SnapshotId":"","BaselineOverride":""}'
};
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=AmazonSSM.GetDeployablePatchSnapshotForInstance',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "InstanceId": "",\n "SnapshotId": "",\n "BaselineOverride": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"InstanceId\": \"\",\n \"SnapshotId\": \"\",\n \"BaselineOverride\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDeployablePatchSnapshotForInstance")
.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({InstanceId: '', SnapshotId: '', BaselineOverride: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDeployablePatchSnapshotForInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {InstanceId: '', SnapshotId: '', BaselineOverride: ''},
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=AmazonSSM.GetDeployablePatchSnapshotForInstance');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
InstanceId: '',
SnapshotId: '',
BaselineOverride: ''
});
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=AmazonSSM.GetDeployablePatchSnapshotForInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: '', SnapshotId: '', BaselineOverride: ''}
};
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=AmazonSSM.GetDeployablePatchSnapshotForInstance';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":"","SnapshotId":"","BaselineOverride":""}'
};
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 = @{ @"InstanceId": @"",
@"SnapshotId": @"",
@"BaselineOverride": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDeployablePatchSnapshotForInstance"]
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=AmazonSSM.GetDeployablePatchSnapshotForInstance" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"InstanceId\": \"\",\n \"SnapshotId\": \"\",\n \"BaselineOverride\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDeployablePatchSnapshotForInstance",
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([
'InstanceId' => '',
'SnapshotId' => '',
'BaselineOverride' => ''
]),
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=AmazonSSM.GetDeployablePatchSnapshotForInstance', [
'body' => '{
"InstanceId": "",
"SnapshotId": "",
"BaselineOverride": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDeployablePatchSnapshotForInstance');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'InstanceId' => '',
'SnapshotId' => '',
'BaselineOverride' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'InstanceId' => '',
'SnapshotId' => '',
'BaselineOverride' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDeployablePatchSnapshotForInstance');
$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=AmazonSSM.GetDeployablePatchSnapshotForInstance' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": "",
"SnapshotId": "",
"BaselineOverride": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDeployablePatchSnapshotForInstance' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": "",
"SnapshotId": "",
"BaselineOverride": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"InstanceId\": \"\",\n \"SnapshotId\": \"\",\n \"BaselineOverride\": \"\"\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=AmazonSSM.GetDeployablePatchSnapshotForInstance"
payload = {
"InstanceId": "",
"SnapshotId": "",
"BaselineOverride": ""
}
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=AmazonSSM.GetDeployablePatchSnapshotForInstance"
payload <- "{\n \"InstanceId\": \"\",\n \"SnapshotId\": \"\",\n \"BaselineOverride\": \"\"\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=AmazonSSM.GetDeployablePatchSnapshotForInstance")
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 \"InstanceId\": \"\",\n \"SnapshotId\": \"\",\n \"BaselineOverride\": \"\"\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 \"InstanceId\": \"\",\n \"SnapshotId\": \"\",\n \"BaselineOverride\": \"\"\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=AmazonSSM.GetDeployablePatchSnapshotForInstance";
let payload = json!({
"InstanceId": "",
"SnapshotId": "",
"BaselineOverride": ""
});
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=AmazonSSM.GetDeployablePatchSnapshotForInstance' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"InstanceId": "",
"SnapshotId": "",
"BaselineOverride": ""
}'
echo '{
"InstanceId": "",
"SnapshotId": "",
"BaselineOverride": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDeployablePatchSnapshotForInstance' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "InstanceId": "",\n "SnapshotId": "",\n "BaselineOverride": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDeployablePatchSnapshotForInstance'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"InstanceId": "",
"SnapshotId": "",
"BaselineOverride": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDeployablePatchSnapshotForInstance")! 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
GetDocument
{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDocument
HEADERS
X-Amz-Target
BODY json
{
"Name": "",
"VersionName": "",
"DocumentVersion": "",
"DocumentFormat": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDocument");
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 \"VersionName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentFormat\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDocument" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Name ""
:VersionName ""
:DocumentVersion ""
:DocumentFormat ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDocument"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Name\": \"\",\n \"VersionName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentFormat\": \"\"\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=AmazonSSM.GetDocument"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Name\": \"\",\n \"VersionName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentFormat\": \"\"\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=AmazonSSM.GetDocument");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Name\": \"\",\n \"VersionName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentFormat\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDocument"
payload := strings.NewReader("{\n \"Name\": \"\",\n \"VersionName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentFormat\": \"\"\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
{
"Name": "",
"VersionName": "",
"DocumentVersion": "",
"DocumentFormat": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDocument")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Name\": \"\",\n \"VersionName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentFormat\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDocument"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Name\": \"\",\n \"VersionName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentFormat\": \"\"\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 \"VersionName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentFormat\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDocument")
.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=AmazonSSM.GetDocument")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Name\": \"\",\n \"VersionName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentFormat\": \"\"\n}")
.asString();
const data = JSON.stringify({
Name: '',
VersionName: '',
DocumentVersion: '',
DocumentFormat: ''
});
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=AmazonSSM.GetDocument');
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=AmazonSSM.GetDocument',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Name: '', VersionName: '', DocumentVersion: '', DocumentFormat: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDocument';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","VersionName":"","DocumentVersion":"","DocumentFormat":""}'
};
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=AmazonSSM.GetDocument',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Name": "",\n "VersionName": "",\n "DocumentVersion": "",\n "DocumentFormat": ""\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 \"VersionName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentFormat\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDocument")
.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: '', VersionName: '', DocumentVersion: '', DocumentFormat: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDocument',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Name: '', VersionName: '', DocumentVersion: '', DocumentFormat: ''},
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=AmazonSSM.GetDocument');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Name: '',
VersionName: '',
DocumentVersion: '',
DocumentFormat: ''
});
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=AmazonSSM.GetDocument',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Name: '', VersionName: '', DocumentVersion: '', DocumentFormat: ''}
};
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=AmazonSSM.GetDocument';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","VersionName":"","DocumentVersion":"","DocumentFormat":""}'
};
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": @"",
@"VersionName": @"",
@"DocumentVersion": @"",
@"DocumentFormat": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDocument"]
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=AmazonSSM.GetDocument" 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 \"VersionName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentFormat\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDocument",
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' => '',
'VersionName' => '',
'DocumentVersion' => '',
'DocumentFormat' => ''
]),
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=AmazonSSM.GetDocument', [
'body' => '{
"Name": "",
"VersionName": "",
"DocumentVersion": "",
"DocumentFormat": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDocument');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Name' => '',
'VersionName' => '',
'DocumentVersion' => '',
'DocumentFormat' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Name' => '',
'VersionName' => '',
'DocumentVersion' => '',
'DocumentFormat' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDocument');
$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=AmazonSSM.GetDocument' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"VersionName": "",
"DocumentVersion": "",
"DocumentFormat": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDocument' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"VersionName": "",
"DocumentVersion": "",
"DocumentFormat": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Name\": \"\",\n \"VersionName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentFormat\": \"\"\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=AmazonSSM.GetDocument"
payload = {
"Name": "",
"VersionName": "",
"DocumentVersion": "",
"DocumentFormat": ""
}
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=AmazonSSM.GetDocument"
payload <- "{\n \"Name\": \"\",\n \"VersionName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentFormat\": \"\"\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=AmazonSSM.GetDocument")
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 \"VersionName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentFormat\": \"\"\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 \"VersionName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentFormat\": \"\"\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=AmazonSSM.GetDocument";
let payload = json!({
"Name": "",
"VersionName": "",
"DocumentVersion": "",
"DocumentFormat": ""
});
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=AmazonSSM.GetDocument' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Name": "",
"VersionName": "",
"DocumentVersion": "",
"DocumentFormat": ""
}'
echo '{
"Name": "",
"VersionName": "",
"DocumentVersion": "",
"DocumentFormat": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDocument' \
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 "VersionName": "",\n "DocumentVersion": "",\n "DocumentFormat": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDocument'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Name": "",
"VersionName": "",
"DocumentVersion": "",
"DocumentFormat": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetDocument")! 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
GetInventory
{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetInventory
HEADERS
X-Amz-Target
BODY json
{
"Filters": "",
"Aggregators": "",
"ResultAttributes": "",
"NextToken": "",
"MaxResults": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetInventory");
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 \"Filters\": \"\",\n \"Aggregators\": \"\",\n \"ResultAttributes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetInventory" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Filters ""
:Aggregators ""
:ResultAttributes ""
:NextToken ""
:MaxResults ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetInventory"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Filters\": \"\",\n \"Aggregators\": \"\",\n \"ResultAttributes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.GetInventory"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Filters\": \"\",\n \"Aggregators\": \"\",\n \"ResultAttributes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.GetInventory");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Filters\": \"\",\n \"Aggregators\": \"\",\n \"ResultAttributes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetInventory"
payload := strings.NewReader("{\n \"Filters\": \"\",\n \"Aggregators\": \"\",\n \"ResultAttributes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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
{
"Filters": "",
"Aggregators": "",
"ResultAttributes": "",
"NextToken": "",
"MaxResults": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetInventory")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Filters\": \"\",\n \"Aggregators\": \"\",\n \"ResultAttributes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetInventory"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Filters\": \"\",\n \"Aggregators\": \"\",\n \"ResultAttributes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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 \"Filters\": \"\",\n \"Aggregators\": \"\",\n \"ResultAttributes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetInventory")
.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=AmazonSSM.GetInventory")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Filters\": \"\",\n \"Aggregators\": \"\",\n \"ResultAttributes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.asString();
const data = JSON.stringify({
Filters: '',
Aggregators: '',
ResultAttributes: '',
NextToken: '',
MaxResults: ''
});
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=AmazonSSM.GetInventory');
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=AmazonSSM.GetInventory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Filters: '',
Aggregators: '',
ResultAttributes: '',
NextToken: '',
MaxResults: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetInventory';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Filters":"","Aggregators":"","ResultAttributes":"","NextToken":"","MaxResults":""}'
};
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=AmazonSSM.GetInventory',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Filters": "",\n "Aggregators": "",\n "ResultAttributes": "",\n "NextToken": "",\n "MaxResults": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Filters\": \"\",\n \"Aggregators\": \"\",\n \"ResultAttributes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetInventory")
.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({
Filters: '',
Aggregators: '',
ResultAttributes: '',
NextToken: '',
MaxResults: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetInventory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
Filters: '',
Aggregators: '',
ResultAttributes: '',
NextToken: '',
MaxResults: ''
},
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=AmazonSSM.GetInventory');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Filters: '',
Aggregators: '',
ResultAttributes: '',
NextToken: '',
MaxResults: ''
});
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=AmazonSSM.GetInventory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Filters: '',
Aggregators: '',
ResultAttributes: '',
NextToken: '',
MaxResults: ''
}
};
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=AmazonSSM.GetInventory';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Filters":"","Aggregators":"","ResultAttributes":"","NextToken":"","MaxResults":""}'
};
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 = @{ @"Filters": @"",
@"Aggregators": @"",
@"ResultAttributes": @"",
@"NextToken": @"",
@"MaxResults": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetInventory"]
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=AmazonSSM.GetInventory" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Filters\": \"\",\n \"Aggregators\": \"\",\n \"ResultAttributes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetInventory",
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([
'Filters' => '',
'Aggregators' => '',
'ResultAttributes' => '',
'NextToken' => '',
'MaxResults' => ''
]),
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=AmazonSSM.GetInventory', [
'body' => '{
"Filters": "",
"Aggregators": "",
"ResultAttributes": "",
"NextToken": "",
"MaxResults": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetInventory');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Filters' => '',
'Aggregators' => '',
'ResultAttributes' => '',
'NextToken' => '',
'MaxResults' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Filters' => '',
'Aggregators' => '',
'ResultAttributes' => '',
'NextToken' => '',
'MaxResults' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetInventory');
$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=AmazonSSM.GetInventory' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Filters": "",
"Aggregators": "",
"ResultAttributes": "",
"NextToken": "",
"MaxResults": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetInventory' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Filters": "",
"Aggregators": "",
"ResultAttributes": "",
"NextToken": "",
"MaxResults": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Filters\": \"\",\n \"Aggregators\": \"\",\n \"ResultAttributes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.GetInventory"
payload = {
"Filters": "",
"Aggregators": "",
"ResultAttributes": "",
"NextToken": "",
"MaxResults": ""
}
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=AmazonSSM.GetInventory"
payload <- "{\n \"Filters\": \"\",\n \"Aggregators\": \"\",\n \"ResultAttributes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.GetInventory")
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 \"Filters\": \"\",\n \"Aggregators\": \"\",\n \"ResultAttributes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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 \"Filters\": \"\",\n \"Aggregators\": \"\",\n \"ResultAttributes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.GetInventory";
let payload = json!({
"Filters": "",
"Aggregators": "",
"ResultAttributes": "",
"NextToken": "",
"MaxResults": ""
});
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=AmazonSSM.GetInventory' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Filters": "",
"Aggregators": "",
"ResultAttributes": "",
"NextToken": "",
"MaxResults": ""
}'
echo '{
"Filters": "",
"Aggregators": "",
"ResultAttributes": "",
"NextToken": "",
"MaxResults": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetInventory' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Filters": "",\n "Aggregators": "",\n "ResultAttributes": "",\n "NextToken": "",\n "MaxResults": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetInventory'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Filters": "",
"Aggregators": "",
"ResultAttributes": "",
"NextToken": "",
"MaxResults": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetInventory")! 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
GetInventorySchema
{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetInventorySchema
HEADERS
X-Amz-Target
BODY json
{
"TypeName": "",
"NextToken": "",
"MaxResults": "",
"Aggregator": "",
"SubType": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetInventorySchema");
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 \"TypeName\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"Aggregator\": \"\",\n \"SubType\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetInventorySchema" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:TypeName ""
:NextToken ""
:MaxResults ""
:Aggregator ""
:SubType ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetInventorySchema"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"TypeName\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"Aggregator\": \"\",\n \"SubType\": \"\"\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=AmazonSSM.GetInventorySchema"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"TypeName\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"Aggregator\": \"\",\n \"SubType\": \"\"\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=AmazonSSM.GetInventorySchema");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"TypeName\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"Aggregator\": \"\",\n \"SubType\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetInventorySchema"
payload := strings.NewReader("{\n \"TypeName\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"Aggregator\": \"\",\n \"SubType\": \"\"\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: 96
{
"TypeName": "",
"NextToken": "",
"MaxResults": "",
"Aggregator": "",
"SubType": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetInventorySchema")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"TypeName\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"Aggregator\": \"\",\n \"SubType\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetInventorySchema"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"TypeName\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"Aggregator\": \"\",\n \"SubType\": \"\"\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 \"TypeName\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"Aggregator\": \"\",\n \"SubType\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetInventorySchema")
.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=AmazonSSM.GetInventorySchema")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"TypeName\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"Aggregator\": \"\",\n \"SubType\": \"\"\n}")
.asString();
const data = JSON.stringify({
TypeName: '',
NextToken: '',
MaxResults: '',
Aggregator: '',
SubType: ''
});
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=AmazonSSM.GetInventorySchema');
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=AmazonSSM.GetInventorySchema',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {TypeName: '', NextToken: '', MaxResults: '', Aggregator: '', SubType: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetInventorySchema';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"TypeName":"","NextToken":"","MaxResults":"","Aggregator":"","SubType":""}'
};
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=AmazonSSM.GetInventorySchema',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "TypeName": "",\n "NextToken": "",\n "MaxResults": "",\n "Aggregator": "",\n "SubType": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"TypeName\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"Aggregator\": \"\",\n \"SubType\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetInventorySchema")
.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({TypeName: '', NextToken: '', MaxResults: '', Aggregator: '', SubType: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetInventorySchema',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {TypeName: '', NextToken: '', MaxResults: '', Aggregator: '', SubType: ''},
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=AmazonSSM.GetInventorySchema');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
TypeName: '',
NextToken: '',
MaxResults: '',
Aggregator: '',
SubType: ''
});
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=AmazonSSM.GetInventorySchema',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {TypeName: '', NextToken: '', MaxResults: '', Aggregator: '', SubType: ''}
};
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=AmazonSSM.GetInventorySchema';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"TypeName":"","NextToken":"","MaxResults":"","Aggregator":"","SubType":""}'
};
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 = @{ @"TypeName": @"",
@"NextToken": @"",
@"MaxResults": @"",
@"Aggregator": @"",
@"SubType": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetInventorySchema"]
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=AmazonSSM.GetInventorySchema" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"TypeName\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"Aggregator\": \"\",\n \"SubType\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetInventorySchema",
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([
'TypeName' => '',
'NextToken' => '',
'MaxResults' => '',
'Aggregator' => '',
'SubType' => ''
]),
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=AmazonSSM.GetInventorySchema', [
'body' => '{
"TypeName": "",
"NextToken": "",
"MaxResults": "",
"Aggregator": "",
"SubType": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetInventorySchema');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'TypeName' => '',
'NextToken' => '',
'MaxResults' => '',
'Aggregator' => '',
'SubType' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'TypeName' => '',
'NextToken' => '',
'MaxResults' => '',
'Aggregator' => '',
'SubType' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetInventorySchema');
$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=AmazonSSM.GetInventorySchema' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"TypeName": "",
"NextToken": "",
"MaxResults": "",
"Aggregator": "",
"SubType": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetInventorySchema' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"TypeName": "",
"NextToken": "",
"MaxResults": "",
"Aggregator": "",
"SubType": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"TypeName\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"Aggregator\": \"\",\n \"SubType\": \"\"\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=AmazonSSM.GetInventorySchema"
payload = {
"TypeName": "",
"NextToken": "",
"MaxResults": "",
"Aggregator": "",
"SubType": ""
}
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=AmazonSSM.GetInventorySchema"
payload <- "{\n \"TypeName\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"Aggregator\": \"\",\n \"SubType\": \"\"\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=AmazonSSM.GetInventorySchema")
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 \"TypeName\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"Aggregator\": \"\",\n \"SubType\": \"\"\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 \"TypeName\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"Aggregator\": \"\",\n \"SubType\": \"\"\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=AmazonSSM.GetInventorySchema";
let payload = json!({
"TypeName": "",
"NextToken": "",
"MaxResults": "",
"Aggregator": "",
"SubType": ""
});
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=AmazonSSM.GetInventorySchema' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"TypeName": "",
"NextToken": "",
"MaxResults": "",
"Aggregator": "",
"SubType": ""
}'
echo '{
"TypeName": "",
"NextToken": "",
"MaxResults": "",
"Aggregator": "",
"SubType": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetInventorySchema' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "TypeName": "",\n "NextToken": "",\n "MaxResults": "",\n "Aggregator": "",\n "SubType": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetInventorySchema'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"TypeName": "",
"NextToken": "",
"MaxResults": "",
"Aggregator": "",
"SubType": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetInventorySchema")! 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
GetMaintenanceWindow
{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindow
HEADERS
X-Amz-Target
BODY json
{
"WindowId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindow");
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 \"WindowId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindow" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:WindowId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindow"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"WindowId\": \"\"\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=AmazonSSM.GetMaintenanceWindow"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"WindowId\": \"\"\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=AmazonSSM.GetMaintenanceWindow");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"WindowId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindow"
payload := strings.NewReader("{\n \"WindowId\": \"\"\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: 20
{
"WindowId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindow")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"WindowId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindow"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"WindowId\": \"\"\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 \"WindowId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindow")
.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=AmazonSSM.GetMaintenanceWindow")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"WindowId\": \"\"\n}")
.asString();
const data = JSON.stringify({
WindowId: ''
});
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=AmazonSSM.GetMaintenanceWindow');
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=AmazonSSM.GetMaintenanceWindow',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {WindowId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindow';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowId":""}'
};
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=AmazonSSM.GetMaintenanceWindow',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "WindowId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"WindowId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindow")
.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({WindowId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindow',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {WindowId: ''},
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=AmazonSSM.GetMaintenanceWindow');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
WindowId: ''
});
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=AmazonSSM.GetMaintenanceWindow',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {WindowId: ''}
};
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=AmazonSSM.GetMaintenanceWindow';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowId":""}'
};
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 = @{ @"WindowId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindow"]
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=AmazonSSM.GetMaintenanceWindow" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"WindowId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindow",
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([
'WindowId' => ''
]),
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=AmazonSSM.GetMaintenanceWindow', [
'body' => '{
"WindowId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindow');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'WindowId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'WindowId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindow');
$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=AmazonSSM.GetMaintenanceWindow' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindow' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"WindowId\": \"\"\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=AmazonSSM.GetMaintenanceWindow"
payload = { "WindowId": "" }
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=AmazonSSM.GetMaintenanceWindow"
payload <- "{\n \"WindowId\": \"\"\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=AmazonSSM.GetMaintenanceWindow")
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 \"WindowId\": \"\"\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 \"WindowId\": \"\"\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=AmazonSSM.GetMaintenanceWindow";
let payload = json!({"WindowId": ""});
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=AmazonSSM.GetMaintenanceWindow' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"WindowId": ""
}'
echo '{
"WindowId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindow' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "WindowId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindow'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["WindowId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindow")! 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
GetMaintenanceWindowExecution
{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecution
HEADERS
X-Amz-Target
BODY json
{
"WindowExecutionId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecution");
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 \"WindowExecutionId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecution" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:WindowExecutionId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecution"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"WindowExecutionId\": \"\"\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=AmazonSSM.GetMaintenanceWindowExecution"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"WindowExecutionId\": \"\"\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=AmazonSSM.GetMaintenanceWindowExecution");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"WindowExecutionId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecution"
payload := strings.NewReader("{\n \"WindowExecutionId\": \"\"\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
{
"WindowExecutionId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecution")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"WindowExecutionId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecution"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"WindowExecutionId\": \"\"\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 \"WindowExecutionId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecution")
.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=AmazonSSM.GetMaintenanceWindowExecution")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"WindowExecutionId\": \"\"\n}")
.asString();
const data = JSON.stringify({
WindowExecutionId: ''
});
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=AmazonSSM.GetMaintenanceWindowExecution');
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=AmazonSSM.GetMaintenanceWindowExecution',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {WindowExecutionId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecution';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowExecutionId":""}'
};
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=AmazonSSM.GetMaintenanceWindowExecution',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "WindowExecutionId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"WindowExecutionId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecution")
.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({WindowExecutionId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecution',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {WindowExecutionId: ''},
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=AmazonSSM.GetMaintenanceWindowExecution');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
WindowExecutionId: ''
});
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=AmazonSSM.GetMaintenanceWindowExecution',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {WindowExecutionId: ''}
};
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=AmazonSSM.GetMaintenanceWindowExecution';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowExecutionId":""}'
};
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 = @{ @"WindowExecutionId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecution"]
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=AmazonSSM.GetMaintenanceWindowExecution" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"WindowExecutionId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecution",
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([
'WindowExecutionId' => ''
]),
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=AmazonSSM.GetMaintenanceWindowExecution', [
'body' => '{
"WindowExecutionId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecution');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'WindowExecutionId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'WindowExecutionId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecution');
$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=AmazonSSM.GetMaintenanceWindowExecution' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowExecutionId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecution' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowExecutionId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"WindowExecutionId\": \"\"\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=AmazonSSM.GetMaintenanceWindowExecution"
payload = { "WindowExecutionId": "" }
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=AmazonSSM.GetMaintenanceWindowExecution"
payload <- "{\n \"WindowExecutionId\": \"\"\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=AmazonSSM.GetMaintenanceWindowExecution")
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 \"WindowExecutionId\": \"\"\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 \"WindowExecutionId\": \"\"\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=AmazonSSM.GetMaintenanceWindowExecution";
let payload = json!({"WindowExecutionId": ""});
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=AmazonSSM.GetMaintenanceWindowExecution' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"WindowExecutionId": ""
}'
echo '{
"WindowExecutionId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecution' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "WindowExecutionId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecution'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["WindowExecutionId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecution")! 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
GetMaintenanceWindowExecutionTask
{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecutionTask
HEADERS
X-Amz-Target
BODY json
{
"WindowExecutionId": "",
"TaskId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecutionTask");
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 \"WindowExecutionId\": \"\",\n \"TaskId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecutionTask" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:WindowExecutionId ""
:TaskId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecutionTask"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"WindowExecutionId\": \"\",\n \"TaskId\": \"\"\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=AmazonSSM.GetMaintenanceWindowExecutionTask"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"WindowExecutionId\": \"\",\n \"TaskId\": \"\"\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=AmazonSSM.GetMaintenanceWindowExecutionTask");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"WindowExecutionId\": \"\",\n \"TaskId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecutionTask"
payload := strings.NewReader("{\n \"WindowExecutionId\": \"\",\n \"TaskId\": \"\"\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
{
"WindowExecutionId": "",
"TaskId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecutionTask")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"WindowExecutionId\": \"\",\n \"TaskId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecutionTask"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"WindowExecutionId\": \"\",\n \"TaskId\": \"\"\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 \"WindowExecutionId\": \"\",\n \"TaskId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecutionTask")
.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=AmazonSSM.GetMaintenanceWindowExecutionTask")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"WindowExecutionId\": \"\",\n \"TaskId\": \"\"\n}")
.asString();
const data = JSON.stringify({
WindowExecutionId: '',
TaskId: ''
});
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=AmazonSSM.GetMaintenanceWindowExecutionTask');
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=AmazonSSM.GetMaintenanceWindowExecutionTask',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {WindowExecutionId: '', TaskId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecutionTask';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowExecutionId":"","TaskId":""}'
};
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=AmazonSSM.GetMaintenanceWindowExecutionTask',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "WindowExecutionId": "",\n "TaskId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"WindowExecutionId\": \"\",\n \"TaskId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecutionTask")
.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({WindowExecutionId: '', TaskId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecutionTask',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {WindowExecutionId: '', TaskId: ''},
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=AmazonSSM.GetMaintenanceWindowExecutionTask');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
WindowExecutionId: '',
TaskId: ''
});
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=AmazonSSM.GetMaintenanceWindowExecutionTask',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {WindowExecutionId: '', TaskId: ''}
};
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=AmazonSSM.GetMaintenanceWindowExecutionTask';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowExecutionId":"","TaskId":""}'
};
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 = @{ @"WindowExecutionId": @"",
@"TaskId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecutionTask"]
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=AmazonSSM.GetMaintenanceWindowExecutionTask" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"WindowExecutionId\": \"\",\n \"TaskId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecutionTask",
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([
'WindowExecutionId' => '',
'TaskId' => ''
]),
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=AmazonSSM.GetMaintenanceWindowExecutionTask', [
'body' => '{
"WindowExecutionId": "",
"TaskId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecutionTask');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'WindowExecutionId' => '',
'TaskId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'WindowExecutionId' => '',
'TaskId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecutionTask');
$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=AmazonSSM.GetMaintenanceWindowExecutionTask' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowExecutionId": "",
"TaskId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecutionTask' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowExecutionId": "",
"TaskId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"WindowExecutionId\": \"\",\n \"TaskId\": \"\"\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=AmazonSSM.GetMaintenanceWindowExecutionTask"
payload = {
"WindowExecutionId": "",
"TaskId": ""
}
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=AmazonSSM.GetMaintenanceWindowExecutionTask"
payload <- "{\n \"WindowExecutionId\": \"\",\n \"TaskId\": \"\"\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=AmazonSSM.GetMaintenanceWindowExecutionTask")
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 \"WindowExecutionId\": \"\",\n \"TaskId\": \"\"\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 \"WindowExecutionId\": \"\",\n \"TaskId\": \"\"\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=AmazonSSM.GetMaintenanceWindowExecutionTask";
let payload = json!({
"WindowExecutionId": "",
"TaskId": ""
});
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=AmazonSSM.GetMaintenanceWindowExecutionTask' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"WindowExecutionId": "",
"TaskId": ""
}'
echo '{
"WindowExecutionId": "",
"TaskId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecutionTask' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "WindowExecutionId": "",\n "TaskId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecutionTask'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"WindowExecutionId": "",
"TaskId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecutionTask")! 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
GetMaintenanceWindowExecutionTaskInvocation
{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation
HEADERS
X-Amz-Target
BODY json
{
"WindowExecutionId": "",
"TaskId": "",
"InvocationId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation");
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 \"WindowExecutionId\": \"\",\n \"TaskId\": \"\",\n \"InvocationId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:WindowExecutionId ""
:TaskId ""
:InvocationId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"WindowExecutionId\": \"\",\n \"TaskId\": \"\",\n \"InvocationId\": \"\"\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=AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"WindowExecutionId\": \"\",\n \"TaskId\": \"\",\n \"InvocationId\": \"\"\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=AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"WindowExecutionId\": \"\",\n \"TaskId\": \"\",\n \"InvocationId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation"
payload := strings.NewReader("{\n \"WindowExecutionId\": \"\",\n \"TaskId\": \"\",\n \"InvocationId\": \"\"\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: 67
{
"WindowExecutionId": "",
"TaskId": "",
"InvocationId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"WindowExecutionId\": \"\",\n \"TaskId\": \"\",\n \"InvocationId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"WindowExecutionId\": \"\",\n \"TaskId\": \"\",\n \"InvocationId\": \"\"\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 \"WindowExecutionId\": \"\",\n \"TaskId\": \"\",\n \"InvocationId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation")
.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=AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"WindowExecutionId\": \"\",\n \"TaskId\": \"\",\n \"InvocationId\": \"\"\n}")
.asString();
const data = JSON.stringify({
WindowExecutionId: '',
TaskId: '',
InvocationId: ''
});
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=AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation');
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=AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {WindowExecutionId: '', TaskId: '', InvocationId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowExecutionId":"","TaskId":"","InvocationId":""}'
};
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=AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "WindowExecutionId": "",\n "TaskId": "",\n "InvocationId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"WindowExecutionId\": \"\",\n \"TaskId\": \"\",\n \"InvocationId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation")
.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({WindowExecutionId: '', TaskId: '', InvocationId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {WindowExecutionId: '', TaskId: '', InvocationId: ''},
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=AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
WindowExecutionId: '',
TaskId: '',
InvocationId: ''
});
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=AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {WindowExecutionId: '', TaskId: '', InvocationId: ''}
};
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=AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowExecutionId":"","TaskId":"","InvocationId":""}'
};
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 = @{ @"WindowExecutionId": @"",
@"TaskId": @"",
@"InvocationId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation"]
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=AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"WindowExecutionId\": \"\",\n \"TaskId\": \"\",\n \"InvocationId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation",
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([
'WindowExecutionId' => '',
'TaskId' => '',
'InvocationId' => ''
]),
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=AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation', [
'body' => '{
"WindowExecutionId": "",
"TaskId": "",
"InvocationId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'WindowExecutionId' => '',
'TaskId' => '',
'InvocationId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'WindowExecutionId' => '',
'TaskId' => '',
'InvocationId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation');
$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=AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowExecutionId": "",
"TaskId": "",
"InvocationId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowExecutionId": "",
"TaskId": "",
"InvocationId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"WindowExecutionId\": \"\",\n \"TaskId\": \"\",\n \"InvocationId\": \"\"\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=AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation"
payload = {
"WindowExecutionId": "",
"TaskId": "",
"InvocationId": ""
}
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=AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation"
payload <- "{\n \"WindowExecutionId\": \"\",\n \"TaskId\": \"\",\n \"InvocationId\": \"\"\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=AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation")
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 \"WindowExecutionId\": \"\",\n \"TaskId\": \"\",\n \"InvocationId\": \"\"\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 \"WindowExecutionId\": \"\",\n \"TaskId\": \"\",\n \"InvocationId\": \"\"\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=AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation";
let payload = json!({
"WindowExecutionId": "",
"TaskId": "",
"InvocationId": ""
});
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=AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"WindowExecutionId": "",
"TaskId": "",
"InvocationId": ""
}'
echo '{
"WindowExecutionId": "",
"TaskId": "",
"InvocationId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "WindowExecutionId": "",\n "TaskId": "",\n "InvocationId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"WindowExecutionId": "",
"TaskId": "",
"InvocationId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowExecutionTaskInvocation")! 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
GetMaintenanceWindowTask
{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowTask
HEADERS
X-Amz-Target
BODY json
{
"WindowId": "",
"WindowTaskId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowTask");
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 \"WindowId\": \"\",\n \"WindowTaskId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowTask" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:WindowId ""
:WindowTaskId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowTask"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"WindowId\": \"\",\n \"WindowTaskId\": \"\"\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=AmazonSSM.GetMaintenanceWindowTask"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"WindowId\": \"\",\n \"WindowTaskId\": \"\"\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=AmazonSSM.GetMaintenanceWindowTask");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"WindowId\": \"\",\n \"WindowTaskId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowTask"
payload := strings.NewReader("{\n \"WindowId\": \"\",\n \"WindowTaskId\": \"\"\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
{
"WindowId": "",
"WindowTaskId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowTask")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"WindowId\": \"\",\n \"WindowTaskId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowTask"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"WindowId\": \"\",\n \"WindowTaskId\": \"\"\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 \"WindowId\": \"\",\n \"WindowTaskId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowTask")
.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=AmazonSSM.GetMaintenanceWindowTask")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"WindowId\": \"\",\n \"WindowTaskId\": \"\"\n}")
.asString();
const data = JSON.stringify({
WindowId: '',
WindowTaskId: ''
});
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=AmazonSSM.GetMaintenanceWindowTask');
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=AmazonSSM.GetMaintenanceWindowTask',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {WindowId: '', WindowTaskId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowTask';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowId":"","WindowTaskId":""}'
};
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=AmazonSSM.GetMaintenanceWindowTask',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "WindowId": "",\n "WindowTaskId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"WindowId\": \"\",\n \"WindowTaskId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowTask")
.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({WindowId: '', WindowTaskId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowTask',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {WindowId: '', WindowTaskId: ''},
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=AmazonSSM.GetMaintenanceWindowTask');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
WindowId: '',
WindowTaskId: ''
});
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=AmazonSSM.GetMaintenanceWindowTask',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {WindowId: '', WindowTaskId: ''}
};
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=AmazonSSM.GetMaintenanceWindowTask';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowId":"","WindowTaskId":""}'
};
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 = @{ @"WindowId": @"",
@"WindowTaskId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowTask"]
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=AmazonSSM.GetMaintenanceWindowTask" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"WindowId\": \"\",\n \"WindowTaskId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowTask",
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([
'WindowId' => '',
'WindowTaskId' => ''
]),
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=AmazonSSM.GetMaintenanceWindowTask', [
'body' => '{
"WindowId": "",
"WindowTaskId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowTask');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'WindowId' => '',
'WindowTaskId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'WindowId' => '',
'WindowTaskId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowTask');
$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=AmazonSSM.GetMaintenanceWindowTask' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowId": "",
"WindowTaskId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowTask' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowId": "",
"WindowTaskId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"WindowId\": \"\",\n \"WindowTaskId\": \"\"\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=AmazonSSM.GetMaintenanceWindowTask"
payload = {
"WindowId": "",
"WindowTaskId": ""
}
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=AmazonSSM.GetMaintenanceWindowTask"
payload <- "{\n \"WindowId\": \"\",\n \"WindowTaskId\": \"\"\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=AmazonSSM.GetMaintenanceWindowTask")
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 \"WindowId\": \"\",\n \"WindowTaskId\": \"\"\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 \"WindowId\": \"\",\n \"WindowTaskId\": \"\"\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=AmazonSSM.GetMaintenanceWindowTask";
let payload = json!({
"WindowId": "",
"WindowTaskId": ""
});
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=AmazonSSM.GetMaintenanceWindowTask' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"WindowId": "",
"WindowTaskId": ""
}'
echo '{
"WindowId": "",
"WindowTaskId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowTask' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "WindowId": "",\n "WindowTaskId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowTask'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"WindowId": "",
"WindowTaskId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetMaintenanceWindowTask")! 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
GetOpsItem
{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsItem
HEADERS
X-Amz-Target
BODY json
{
"OpsItemId": "",
"OpsItemArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsItem");
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 \"OpsItemId\": \"\",\n \"OpsItemArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsItem" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OpsItemId ""
:OpsItemArn ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsItem"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OpsItemId\": \"\",\n \"OpsItemArn\": \"\"\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=AmazonSSM.GetOpsItem"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OpsItemId\": \"\",\n \"OpsItemArn\": \"\"\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=AmazonSSM.GetOpsItem");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OpsItemId\": \"\",\n \"OpsItemArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsItem"
payload := strings.NewReader("{\n \"OpsItemId\": \"\",\n \"OpsItemArn\": \"\"\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
{
"OpsItemId": "",
"OpsItemArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsItem")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OpsItemId\": \"\",\n \"OpsItemArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsItem"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OpsItemId\": \"\",\n \"OpsItemArn\": \"\"\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 \"OpsItemId\": \"\",\n \"OpsItemArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsItem")
.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=AmazonSSM.GetOpsItem")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OpsItemId\": \"\",\n \"OpsItemArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
OpsItemId: '',
OpsItemArn: ''
});
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=AmazonSSM.GetOpsItem');
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=AmazonSSM.GetOpsItem',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OpsItemId: '', OpsItemArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsItem';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OpsItemId":"","OpsItemArn":""}'
};
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=AmazonSSM.GetOpsItem',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OpsItemId": "",\n "OpsItemArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OpsItemId\": \"\",\n \"OpsItemArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsItem")
.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({OpsItemId: '', OpsItemArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsItem',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OpsItemId: '', OpsItemArn: ''},
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=AmazonSSM.GetOpsItem');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OpsItemId: '',
OpsItemArn: ''
});
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=AmazonSSM.GetOpsItem',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OpsItemId: '', OpsItemArn: ''}
};
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=AmazonSSM.GetOpsItem';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OpsItemId":"","OpsItemArn":""}'
};
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 = @{ @"OpsItemId": @"",
@"OpsItemArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsItem"]
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=AmazonSSM.GetOpsItem" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OpsItemId\": \"\",\n \"OpsItemArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsItem",
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([
'OpsItemId' => '',
'OpsItemArn' => ''
]),
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=AmazonSSM.GetOpsItem', [
'body' => '{
"OpsItemId": "",
"OpsItemArn": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsItem');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OpsItemId' => '',
'OpsItemArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OpsItemId' => '',
'OpsItemArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsItem');
$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=AmazonSSM.GetOpsItem' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OpsItemId": "",
"OpsItemArn": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsItem' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OpsItemId": "",
"OpsItemArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OpsItemId\": \"\",\n \"OpsItemArn\": \"\"\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=AmazonSSM.GetOpsItem"
payload = {
"OpsItemId": "",
"OpsItemArn": ""
}
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=AmazonSSM.GetOpsItem"
payload <- "{\n \"OpsItemId\": \"\",\n \"OpsItemArn\": \"\"\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=AmazonSSM.GetOpsItem")
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 \"OpsItemId\": \"\",\n \"OpsItemArn\": \"\"\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 \"OpsItemId\": \"\",\n \"OpsItemArn\": \"\"\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=AmazonSSM.GetOpsItem";
let payload = json!({
"OpsItemId": "",
"OpsItemArn": ""
});
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=AmazonSSM.GetOpsItem' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OpsItemId": "",
"OpsItemArn": ""
}'
echo '{
"OpsItemId": "",
"OpsItemArn": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsItem' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OpsItemId": "",\n "OpsItemArn": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsItem'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OpsItemId": "",
"OpsItemArn": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsItem")! 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
GetOpsMetadata
{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsMetadata
HEADERS
X-Amz-Target
BODY json
{
"OpsMetadataArn": "",
"MaxResults": "",
"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=AmazonSSM.GetOpsMetadata");
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 \"OpsMetadataArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsMetadata" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OpsMetadataArn ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsMetadata"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OpsMetadataArn\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.GetOpsMetadata"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OpsMetadataArn\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.GetOpsMetadata");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OpsMetadataArn\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.GetOpsMetadata"
payload := strings.NewReader("{\n \"OpsMetadataArn\": \"\",\n \"MaxResults\": \"\",\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: 65
{
"OpsMetadataArn": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsMetadata")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OpsMetadataArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsMetadata"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OpsMetadataArn\": \"\",\n \"MaxResults\": \"\",\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 \"OpsMetadataArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsMetadata")
.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=AmazonSSM.GetOpsMetadata")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OpsMetadataArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
OpsMetadataArn: '',
MaxResults: '',
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=AmazonSSM.GetOpsMetadata');
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=AmazonSSM.GetOpsMetadata',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OpsMetadataArn: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsMetadata';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OpsMetadataArn":"","MaxResults":"","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=AmazonSSM.GetOpsMetadata',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OpsMetadataArn": "",\n "MaxResults": "",\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 \"OpsMetadataArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsMetadata")
.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({OpsMetadataArn: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsMetadata',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OpsMetadataArn: '', MaxResults: '', 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=AmazonSSM.GetOpsMetadata');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OpsMetadataArn: '',
MaxResults: '',
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=AmazonSSM.GetOpsMetadata',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OpsMetadataArn: '', MaxResults: '', 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=AmazonSSM.GetOpsMetadata';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OpsMetadataArn":"","MaxResults":"","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 = @{ @"OpsMetadataArn": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsMetadata"]
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=AmazonSSM.GetOpsMetadata" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OpsMetadataArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsMetadata",
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([
'OpsMetadataArn' => '',
'MaxResults' => '',
'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=AmazonSSM.GetOpsMetadata', [
'body' => '{
"OpsMetadataArn": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsMetadata');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OpsMetadataArn' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OpsMetadataArn' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsMetadata');
$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=AmazonSSM.GetOpsMetadata' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OpsMetadataArn": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsMetadata' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OpsMetadataArn": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OpsMetadataArn\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.GetOpsMetadata"
payload = {
"OpsMetadataArn": "",
"MaxResults": "",
"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=AmazonSSM.GetOpsMetadata"
payload <- "{\n \"OpsMetadataArn\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.GetOpsMetadata")
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 \"OpsMetadataArn\": \"\",\n \"MaxResults\": \"\",\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 \"OpsMetadataArn\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.GetOpsMetadata";
let payload = json!({
"OpsMetadataArn": "",
"MaxResults": "",
"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=AmazonSSM.GetOpsMetadata' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OpsMetadataArn": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"OpsMetadataArn": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsMetadata' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OpsMetadataArn": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsMetadata'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OpsMetadataArn": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsMetadata")! 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
GetOpsSummary
{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsSummary
HEADERS
X-Amz-Target
BODY json
{
"SyncName": "",
"Filters": "",
"Aggregators": "",
"ResultAttributes": "",
"NextToken": "",
"MaxResults": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsSummary");
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 \"SyncName\": \"\",\n \"Filters\": \"\",\n \"Aggregators\": \"\",\n \"ResultAttributes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsSummary" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:SyncName ""
:Filters ""
:Aggregators ""
:ResultAttributes ""
:NextToken ""
:MaxResults ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsSummary"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"SyncName\": \"\",\n \"Filters\": \"\",\n \"Aggregators\": \"\",\n \"ResultAttributes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.GetOpsSummary"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"SyncName\": \"\",\n \"Filters\": \"\",\n \"Aggregators\": \"\",\n \"ResultAttributes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.GetOpsSummary");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"SyncName\": \"\",\n \"Filters\": \"\",\n \"Aggregators\": \"\",\n \"ResultAttributes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsSummary"
payload := strings.NewReader("{\n \"SyncName\": \"\",\n \"Filters\": \"\",\n \"Aggregators\": \"\",\n \"ResultAttributes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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
{
"SyncName": "",
"Filters": "",
"Aggregators": "",
"ResultAttributes": "",
"NextToken": "",
"MaxResults": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsSummary")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"SyncName\": \"\",\n \"Filters\": \"\",\n \"Aggregators\": \"\",\n \"ResultAttributes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsSummary"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"SyncName\": \"\",\n \"Filters\": \"\",\n \"Aggregators\": \"\",\n \"ResultAttributes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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 \"SyncName\": \"\",\n \"Filters\": \"\",\n \"Aggregators\": \"\",\n \"ResultAttributes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsSummary")
.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=AmazonSSM.GetOpsSummary")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"SyncName\": \"\",\n \"Filters\": \"\",\n \"Aggregators\": \"\",\n \"ResultAttributes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.asString();
const data = JSON.stringify({
SyncName: '',
Filters: '',
Aggregators: '',
ResultAttributes: '',
NextToken: '',
MaxResults: ''
});
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=AmazonSSM.GetOpsSummary');
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=AmazonSSM.GetOpsSummary',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
SyncName: '',
Filters: '',
Aggregators: '',
ResultAttributes: '',
NextToken: '',
MaxResults: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsSummary';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"SyncName":"","Filters":"","Aggregators":"","ResultAttributes":"","NextToken":"","MaxResults":""}'
};
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=AmazonSSM.GetOpsSummary',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "SyncName": "",\n "Filters": "",\n "Aggregators": "",\n "ResultAttributes": "",\n "NextToken": "",\n "MaxResults": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"SyncName\": \"\",\n \"Filters\": \"\",\n \"Aggregators\": \"\",\n \"ResultAttributes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsSummary")
.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({
SyncName: '',
Filters: '',
Aggregators: '',
ResultAttributes: '',
NextToken: '',
MaxResults: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsSummary',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
SyncName: '',
Filters: '',
Aggregators: '',
ResultAttributes: '',
NextToken: '',
MaxResults: ''
},
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=AmazonSSM.GetOpsSummary');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
SyncName: '',
Filters: '',
Aggregators: '',
ResultAttributes: '',
NextToken: '',
MaxResults: ''
});
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=AmazonSSM.GetOpsSummary',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
SyncName: '',
Filters: '',
Aggregators: '',
ResultAttributes: '',
NextToken: '',
MaxResults: ''
}
};
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=AmazonSSM.GetOpsSummary';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"SyncName":"","Filters":"","Aggregators":"","ResultAttributes":"","NextToken":"","MaxResults":""}'
};
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 = @{ @"SyncName": @"",
@"Filters": @"",
@"Aggregators": @"",
@"ResultAttributes": @"",
@"NextToken": @"",
@"MaxResults": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsSummary"]
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=AmazonSSM.GetOpsSummary" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"SyncName\": \"\",\n \"Filters\": \"\",\n \"Aggregators\": \"\",\n \"ResultAttributes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsSummary",
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([
'SyncName' => '',
'Filters' => '',
'Aggregators' => '',
'ResultAttributes' => '',
'NextToken' => '',
'MaxResults' => ''
]),
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=AmazonSSM.GetOpsSummary', [
'body' => '{
"SyncName": "",
"Filters": "",
"Aggregators": "",
"ResultAttributes": "",
"NextToken": "",
"MaxResults": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsSummary');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'SyncName' => '',
'Filters' => '',
'Aggregators' => '',
'ResultAttributes' => '',
'NextToken' => '',
'MaxResults' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'SyncName' => '',
'Filters' => '',
'Aggregators' => '',
'ResultAttributes' => '',
'NextToken' => '',
'MaxResults' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsSummary');
$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=AmazonSSM.GetOpsSummary' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SyncName": "",
"Filters": "",
"Aggregators": "",
"ResultAttributes": "",
"NextToken": "",
"MaxResults": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsSummary' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SyncName": "",
"Filters": "",
"Aggregators": "",
"ResultAttributes": "",
"NextToken": "",
"MaxResults": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"SyncName\": \"\",\n \"Filters\": \"\",\n \"Aggregators\": \"\",\n \"ResultAttributes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.GetOpsSummary"
payload = {
"SyncName": "",
"Filters": "",
"Aggregators": "",
"ResultAttributes": "",
"NextToken": "",
"MaxResults": ""
}
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=AmazonSSM.GetOpsSummary"
payload <- "{\n \"SyncName\": \"\",\n \"Filters\": \"\",\n \"Aggregators\": \"\",\n \"ResultAttributes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.GetOpsSummary")
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 \"SyncName\": \"\",\n \"Filters\": \"\",\n \"Aggregators\": \"\",\n \"ResultAttributes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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 \"SyncName\": \"\",\n \"Filters\": \"\",\n \"Aggregators\": \"\",\n \"ResultAttributes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.GetOpsSummary";
let payload = json!({
"SyncName": "",
"Filters": "",
"Aggregators": "",
"ResultAttributes": "",
"NextToken": "",
"MaxResults": ""
});
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=AmazonSSM.GetOpsSummary' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"SyncName": "",
"Filters": "",
"Aggregators": "",
"ResultAttributes": "",
"NextToken": "",
"MaxResults": ""
}'
echo '{
"SyncName": "",
"Filters": "",
"Aggregators": "",
"ResultAttributes": "",
"NextToken": "",
"MaxResults": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsSummary' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "SyncName": "",\n "Filters": "",\n "Aggregators": "",\n "ResultAttributes": "",\n "NextToken": "",\n "MaxResults": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsSummary'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"SyncName": "",
"Filters": "",
"Aggregators": "",
"ResultAttributes": "",
"NextToken": "",
"MaxResults": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetOpsSummary")! 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
GetParameter
{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameter
HEADERS
X-Amz-Target
BODY json
{
"Name": "",
"WithDecryption": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameter");
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 \"WithDecryption\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameter" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Name ""
:WithDecryption ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameter"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Name\": \"\",\n \"WithDecryption\": \"\"\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=AmazonSSM.GetParameter"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Name\": \"\",\n \"WithDecryption\": \"\"\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=AmazonSSM.GetParameter");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Name\": \"\",\n \"WithDecryption\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameter"
payload := strings.NewReader("{\n \"Name\": \"\",\n \"WithDecryption\": \"\"\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
{
"Name": "",
"WithDecryption": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameter")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Name\": \"\",\n \"WithDecryption\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameter"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Name\": \"\",\n \"WithDecryption\": \"\"\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 \"WithDecryption\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameter")
.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=AmazonSSM.GetParameter")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Name\": \"\",\n \"WithDecryption\": \"\"\n}")
.asString();
const data = JSON.stringify({
Name: '',
WithDecryption: ''
});
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=AmazonSSM.GetParameter');
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=AmazonSSM.GetParameter',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Name: '', WithDecryption: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameter';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","WithDecryption":""}'
};
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=AmazonSSM.GetParameter',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Name": "",\n "WithDecryption": ""\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 \"WithDecryption\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameter")
.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: '', WithDecryption: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameter',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Name: '', WithDecryption: ''},
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=AmazonSSM.GetParameter');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Name: '',
WithDecryption: ''
});
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=AmazonSSM.GetParameter',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Name: '', WithDecryption: ''}
};
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=AmazonSSM.GetParameter';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","WithDecryption":""}'
};
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": @"",
@"WithDecryption": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameter"]
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=AmazonSSM.GetParameter" 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 \"WithDecryption\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameter",
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' => '',
'WithDecryption' => ''
]),
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=AmazonSSM.GetParameter', [
'body' => '{
"Name": "",
"WithDecryption": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameter');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Name' => '',
'WithDecryption' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Name' => '',
'WithDecryption' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameter');
$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=AmazonSSM.GetParameter' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"WithDecryption": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameter' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"WithDecryption": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Name\": \"\",\n \"WithDecryption\": \"\"\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=AmazonSSM.GetParameter"
payload = {
"Name": "",
"WithDecryption": ""
}
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=AmazonSSM.GetParameter"
payload <- "{\n \"Name\": \"\",\n \"WithDecryption\": \"\"\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=AmazonSSM.GetParameter")
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 \"WithDecryption\": \"\"\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 \"WithDecryption\": \"\"\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=AmazonSSM.GetParameter";
let payload = json!({
"Name": "",
"WithDecryption": ""
});
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=AmazonSSM.GetParameter' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Name": "",
"WithDecryption": ""
}'
echo '{
"Name": "",
"WithDecryption": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameter' \
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 "WithDecryption": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameter'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Name": "",
"WithDecryption": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameter")! 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
GetParameterHistory
{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameterHistory
HEADERS
X-Amz-Target
BODY json
{
"Name": "",
"WithDecryption": "",
"MaxResults": "",
"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=AmazonSSM.GetParameterHistory");
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 \"WithDecryption\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameterHistory" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Name ""
:WithDecryption ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameterHistory"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Name\": \"\",\n \"WithDecryption\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.GetParameterHistory"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Name\": \"\",\n \"WithDecryption\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.GetParameterHistory");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Name\": \"\",\n \"WithDecryption\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.GetParameterHistory"
payload := strings.NewReader("{\n \"Name\": \"\",\n \"WithDecryption\": \"\",\n \"MaxResults\": \"\",\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: 79
{
"Name": "",
"WithDecryption": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameterHistory")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Name\": \"\",\n \"WithDecryption\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameterHistory"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Name\": \"\",\n \"WithDecryption\": \"\",\n \"MaxResults\": \"\",\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 \"Name\": \"\",\n \"WithDecryption\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameterHistory")
.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=AmazonSSM.GetParameterHistory")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Name\": \"\",\n \"WithDecryption\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
Name: '',
WithDecryption: '',
MaxResults: '',
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=AmazonSSM.GetParameterHistory');
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=AmazonSSM.GetParameterHistory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Name: '', WithDecryption: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameterHistory';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","WithDecryption":"","MaxResults":"","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=AmazonSSM.GetParameterHistory',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Name": "",\n "WithDecryption": "",\n "MaxResults": "",\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 \"Name\": \"\",\n \"WithDecryption\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameterHistory")
.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: '', WithDecryption: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameterHistory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Name: '', WithDecryption: '', MaxResults: '', 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=AmazonSSM.GetParameterHistory');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Name: '',
WithDecryption: '',
MaxResults: '',
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=AmazonSSM.GetParameterHistory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Name: '', WithDecryption: '', MaxResults: '', 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=AmazonSSM.GetParameterHistory';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","WithDecryption":"","MaxResults":"","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 = @{ @"Name": @"",
@"WithDecryption": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameterHistory"]
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=AmazonSSM.GetParameterHistory" 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 \"WithDecryption\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameterHistory",
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' => '',
'WithDecryption' => '',
'MaxResults' => '',
'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=AmazonSSM.GetParameterHistory', [
'body' => '{
"Name": "",
"WithDecryption": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameterHistory');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Name' => '',
'WithDecryption' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Name' => '',
'WithDecryption' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameterHistory');
$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=AmazonSSM.GetParameterHistory' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"WithDecryption": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameterHistory' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"WithDecryption": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Name\": \"\",\n \"WithDecryption\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.GetParameterHistory"
payload = {
"Name": "",
"WithDecryption": "",
"MaxResults": "",
"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=AmazonSSM.GetParameterHistory"
payload <- "{\n \"Name\": \"\",\n \"WithDecryption\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.GetParameterHistory")
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 \"WithDecryption\": \"\",\n \"MaxResults\": \"\",\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 \"Name\": \"\",\n \"WithDecryption\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.GetParameterHistory";
let payload = json!({
"Name": "",
"WithDecryption": "",
"MaxResults": "",
"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=AmazonSSM.GetParameterHistory' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Name": "",
"WithDecryption": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"Name": "",
"WithDecryption": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameterHistory' \
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 "WithDecryption": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameterHistory'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Name": "",
"WithDecryption": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameterHistory")! 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
GetParameters
{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameters
HEADERS
X-Amz-Target
BODY json
{
"Names": "",
"WithDecryption": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameters");
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 \"Names\": \"\",\n \"WithDecryption\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameters" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Names ""
:WithDecryption ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameters"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Names\": \"\",\n \"WithDecryption\": \"\"\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=AmazonSSM.GetParameters"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Names\": \"\",\n \"WithDecryption\": \"\"\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=AmazonSSM.GetParameters");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Names\": \"\",\n \"WithDecryption\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameters"
payload := strings.NewReader("{\n \"Names\": \"\",\n \"WithDecryption\": \"\"\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
{
"Names": "",
"WithDecryption": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameters")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Names\": \"\",\n \"WithDecryption\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameters"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Names\": \"\",\n \"WithDecryption\": \"\"\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 \"Names\": \"\",\n \"WithDecryption\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameters")
.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=AmazonSSM.GetParameters")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Names\": \"\",\n \"WithDecryption\": \"\"\n}")
.asString();
const data = JSON.stringify({
Names: '',
WithDecryption: ''
});
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=AmazonSSM.GetParameters');
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=AmazonSSM.GetParameters',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Names: '', WithDecryption: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameters';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Names":"","WithDecryption":""}'
};
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=AmazonSSM.GetParameters',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Names": "",\n "WithDecryption": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Names\": \"\",\n \"WithDecryption\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameters")
.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({Names: '', WithDecryption: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameters',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Names: '', WithDecryption: ''},
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=AmazonSSM.GetParameters');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Names: '',
WithDecryption: ''
});
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=AmazonSSM.GetParameters',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Names: '', WithDecryption: ''}
};
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=AmazonSSM.GetParameters';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Names":"","WithDecryption":""}'
};
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 = @{ @"Names": @"",
@"WithDecryption": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameters"]
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=AmazonSSM.GetParameters" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Names\": \"\",\n \"WithDecryption\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameters",
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([
'Names' => '',
'WithDecryption' => ''
]),
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=AmazonSSM.GetParameters', [
'body' => '{
"Names": "",
"WithDecryption": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameters');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Names' => '',
'WithDecryption' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Names' => '',
'WithDecryption' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameters');
$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=AmazonSSM.GetParameters' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Names": "",
"WithDecryption": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameters' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Names": "",
"WithDecryption": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Names\": \"\",\n \"WithDecryption\": \"\"\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=AmazonSSM.GetParameters"
payload = {
"Names": "",
"WithDecryption": ""
}
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=AmazonSSM.GetParameters"
payload <- "{\n \"Names\": \"\",\n \"WithDecryption\": \"\"\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=AmazonSSM.GetParameters")
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 \"Names\": \"\",\n \"WithDecryption\": \"\"\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 \"Names\": \"\",\n \"WithDecryption\": \"\"\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=AmazonSSM.GetParameters";
let payload = json!({
"Names": "",
"WithDecryption": ""
});
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=AmazonSSM.GetParameters' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Names": "",
"WithDecryption": ""
}'
echo '{
"Names": "",
"WithDecryption": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameters' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Names": "",\n "WithDecryption": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameters'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Names": "",
"WithDecryption": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParameters")! 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
GetParametersByPath
{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParametersByPath
HEADERS
X-Amz-Target
BODY json
{
"Path": "",
"Recursive": "",
"ParameterFilters": "",
"WithDecryption": "",
"MaxResults": "",
"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=AmazonSSM.GetParametersByPath");
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 \"Path\": \"\",\n \"Recursive\": \"\",\n \"ParameterFilters\": \"\",\n \"WithDecryption\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParametersByPath" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Path ""
:Recursive ""
:ParameterFilters ""
:WithDecryption ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParametersByPath"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Path\": \"\",\n \"Recursive\": \"\",\n \"ParameterFilters\": \"\",\n \"WithDecryption\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.GetParametersByPath"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Path\": \"\",\n \"Recursive\": \"\",\n \"ParameterFilters\": \"\",\n \"WithDecryption\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.GetParametersByPath");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Path\": \"\",\n \"Recursive\": \"\",\n \"ParameterFilters\": \"\",\n \"WithDecryption\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.GetParametersByPath"
payload := strings.NewReader("{\n \"Path\": \"\",\n \"Recursive\": \"\",\n \"ParameterFilters\": \"\",\n \"WithDecryption\": \"\",\n \"MaxResults\": \"\",\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: 124
{
"Path": "",
"Recursive": "",
"ParameterFilters": "",
"WithDecryption": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParametersByPath")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Path\": \"\",\n \"Recursive\": \"\",\n \"ParameterFilters\": \"\",\n \"WithDecryption\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParametersByPath"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Path\": \"\",\n \"Recursive\": \"\",\n \"ParameterFilters\": \"\",\n \"WithDecryption\": \"\",\n \"MaxResults\": \"\",\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 \"Path\": \"\",\n \"Recursive\": \"\",\n \"ParameterFilters\": \"\",\n \"WithDecryption\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParametersByPath")
.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=AmazonSSM.GetParametersByPath")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Path\": \"\",\n \"Recursive\": \"\",\n \"ParameterFilters\": \"\",\n \"WithDecryption\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
Path: '',
Recursive: '',
ParameterFilters: '',
WithDecryption: '',
MaxResults: '',
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=AmazonSSM.GetParametersByPath');
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=AmazonSSM.GetParametersByPath',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Path: '',
Recursive: '',
ParameterFilters: '',
WithDecryption: '',
MaxResults: '',
NextToken: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParametersByPath';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Path":"","Recursive":"","ParameterFilters":"","WithDecryption":"","MaxResults":"","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=AmazonSSM.GetParametersByPath',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Path": "",\n "Recursive": "",\n "ParameterFilters": "",\n "WithDecryption": "",\n "MaxResults": "",\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 \"Path\": \"\",\n \"Recursive\": \"\",\n \"ParameterFilters\": \"\",\n \"WithDecryption\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParametersByPath")
.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({
Path: '',
Recursive: '',
ParameterFilters: '',
WithDecryption: '',
MaxResults: '',
NextToken: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParametersByPath',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
Path: '',
Recursive: '',
ParameterFilters: '',
WithDecryption: '',
MaxResults: '',
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=AmazonSSM.GetParametersByPath');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Path: '',
Recursive: '',
ParameterFilters: '',
WithDecryption: '',
MaxResults: '',
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=AmazonSSM.GetParametersByPath',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Path: '',
Recursive: '',
ParameterFilters: '',
WithDecryption: '',
MaxResults: '',
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=AmazonSSM.GetParametersByPath';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Path":"","Recursive":"","ParameterFilters":"","WithDecryption":"","MaxResults":"","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 = @{ @"Path": @"",
@"Recursive": @"",
@"ParameterFilters": @"",
@"WithDecryption": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParametersByPath"]
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=AmazonSSM.GetParametersByPath" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Path\": \"\",\n \"Recursive\": \"\",\n \"ParameterFilters\": \"\",\n \"WithDecryption\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParametersByPath",
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([
'Path' => '',
'Recursive' => '',
'ParameterFilters' => '',
'WithDecryption' => '',
'MaxResults' => '',
'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=AmazonSSM.GetParametersByPath', [
'body' => '{
"Path": "",
"Recursive": "",
"ParameterFilters": "",
"WithDecryption": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParametersByPath');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Path' => '',
'Recursive' => '',
'ParameterFilters' => '',
'WithDecryption' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Path' => '',
'Recursive' => '',
'ParameterFilters' => '',
'WithDecryption' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParametersByPath');
$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=AmazonSSM.GetParametersByPath' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Path": "",
"Recursive": "",
"ParameterFilters": "",
"WithDecryption": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParametersByPath' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Path": "",
"Recursive": "",
"ParameterFilters": "",
"WithDecryption": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Path\": \"\",\n \"Recursive\": \"\",\n \"ParameterFilters\": \"\",\n \"WithDecryption\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.GetParametersByPath"
payload = {
"Path": "",
"Recursive": "",
"ParameterFilters": "",
"WithDecryption": "",
"MaxResults": "",
"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=AmazonSSM.GetParametersByPath"
payload <- "{\n \"Path\": \"\",\n \"Recursive\": \"\",\n \"ParameterFilters\": \"\",\n \"WithDecryption\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.GetParametersByPath")
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 \"Path\": \"\",\n \"Recursive\": \"\",\n \"ParameterFilters\": \"\",\n \"WithDecryption\": \"\",\n \"MaxResults\": \"\",\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 \"Path\": \"\",\n \"Recursive\": \"\",\n \"ParameterFilters\": \"\",\n \"WithDecryption\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.GetParametersByPath";
let payload = json!({
"Path": "",
"Recursive": "",
"ParameterFilters": "",
"WithDecryption": "",
"MaxResults": "",
"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=AmazonSSM.GetParametersByPath' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Path": "",
"Recursive": "",
"ParameterFilters": "",
"WithDecryption": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"Path": "",
"Recursive": "",
"ParameterFilters": "",
"WithDecryption": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParametersByPath' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Path": "",\n "Recursive": "",\n "ParameterFilters": "",\n "WithDecryption": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParametersByPath'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Path": "",
"Recursive": "",
"ParameterFilters": "",
"WithDecryption": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetParametersByPath")! 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
GetPatchBaseline
{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetPatchBaseline
HEADERS
X-Amz-Target
BODY json
{
"BaselineId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetPatchBaseline");
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 \"BaselineId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetPatchBaseline" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:BaselineId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetPatchBaseline"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"BaselineId\": \"\"\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=AmazonSSM.GetPatchBaseline"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"BaselineId\": \"\"\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=AmazonSSM.GetPatchBaseline");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"BaselineId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetPatchBaseline"
payload := strings.NewReader("{\n \"BaselineId\": \"\"\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
{
"BaselineId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetPatchBaseline")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"BaselineId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetPatchBaseline"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"BaselineId\": \"\"\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 \"BaselineId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetPatchBaseline")
.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=AmazonSSM.GetPatchBaseline")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"BaselineId\": \"\"\n}")
.asString();
const data = JSON.stringify({
BaselineId: ''
});
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=AmazonSSM.GetPatchBaseline');
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=AmazonSSM.GetPatchBaseline',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {BaselineId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetPatchBaseline';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"BaselineId":""}'
};
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=AmazonSSM.GetPatchBaseline',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "BaselineId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"BaselineId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetPatchBaseline")
.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({BaselineId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetPatchBaseline',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {BaselineId: ''},
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=AmazonSSM.GetPatchBaseline');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
BaselineId: ''
});
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=AmazonSSM.GetPatchBaseline',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {BaselineId: ''}
};
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=AmazonSSM.GetPatchBaseline';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"BaselineId":""}'
};
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 = @{ @"BaselineId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetPatchBaseline"]
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=AmazonSSM.GetPatchBaseline" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"BaselineId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetPatchBaseline",
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([
'BaselineId' => ''
]),
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=AmazonSSM.GetPatchBaseline', [
'body' => '{
"BaselineId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetPatchBaseline');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'BaselineId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'BaselineId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetPatchBaseline');
$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=AmazonSSM.GetPatchBaseline' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"BaselineId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetPatchBaseline' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"BaselineId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"BaselineId\": \"\"\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=AmazonSSM.GetPatchBaseline"
payload = { "BaselineId": "" }
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=AmazonSSM.GetPatchBaseline"
payload <- "{\n \"BaselineId\": \"\"\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=AmazonSSM.GetPatchBaseline")
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 \"BaselineId\": \"\"\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 \"BaselineId\": \"\"\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=AmazonSSM.GetPatchBaseline";
let payload = json!({"BaselineId": ""});
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=AmazonSSM.GetPatchBaseline' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"BaselineId": ""
}'
echo '{
"BaselineId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetPatchBaseline' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "BaselineId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetPatchBaseline'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["BaselineId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetPatchBaseline")! 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
GetPatchBaselineForPatchGroup
{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetPatchBaselineForPatchGroup
HEADERS
X-Amz-Target
BODY json
{
"PatchGroup": "",
"OperatingSystem": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetPatchBaselineForPatchGroup");
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 \"PatchGroup\": \"\",\n \"OperatingSystem\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetPatchBaselineForPatchGroup" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:PatchGroup ""
:OperatingSystem ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetPatchBaselineForPatchGroup"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"PatchGroup\": \"\",\n \"OperatingSystem\": \"\"\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=AmazonSSM.GetPatchBaselineForPatchGroup"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"PatchGroup\": \"\",\n \"OperatingSystem\": \"\"\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=AmazonSSM.GetPatchBaselineForPatchGroup");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"PatchGroup\": \"\",\n \"OperatingSystem\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetPatchBaselineForPatchGroup"
payload := strings.NewReader("{\n \"PatchGroup\": \"\",\n \"OperatingSystem\": \"\"\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
{
"PatchGroup": "",
"OperatingSystem": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetPatchBaselineForPatchGroup")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"PatchGroup\": \"\",\n \"OperatingSystem\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetPatchBaselineForPatchGroup"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"PatchGroup\": \"\",\n \"OperatingSystem\": \"\"\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 \"PatchGroup\": \"\",\n \"OperatingSystem\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetPatchBaselineForPatchGroup")
.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=AmazonSSM.GetPatchBaselineForPatchGroup")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"PatchGroup\": \"\",\n \"OperatingSystem\": \"\"\n}")
.asString();
const data = JSON.stringify({
PatchGroup: '',
OperatingSystem: ''
});
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=AmazonSSM.GetPatchBaselineForPatchGroup');
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=AmazonSSM.GetPatchBaselineForPatchGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {PatchGroup: '', OperatingSystem: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetPatchBaselineForPatchGroup';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"PatchGroup":"","OperatingSystem":""}'
};
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=AmazonSSM.GetPatchBaselineForPatchGroup',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "PatchGroup": "",\n "OperatingSystem": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"PatchGroup\": \"\",\n \"OperatingSystem\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetPatchBaselineForPatchGroup")
.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({PatchGroup: '', OperatingSystem: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetPatchBaselineForPatchGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {PatchGroup: '', OperatingSystem: ''},
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=AmazonSSM.GetPatchBaselineForPatchGroup');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
PatchGroup: '',
OperatingSystem: ''
});
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=AmazonSSM.GetPatchBaselineForPatchGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {PatchGroup: '', OperatingSystem: ''}
};
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=AmazonSSM.GetPatchBaselineForPatchGroup';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"PatchGroup":"","OperatingSystem":""}'
};
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 = @{ @"PatchGroup": @"",
@"OperatingSystem": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetPatchBaselineForPatchGroup"]
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=AmazonSSM.GetPatchBaselineForPatchGroup" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"PatchGroup\": \"\",\n \"OperatingSystem\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetPatchBaselineForPatchGroup",
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([
'PatchGroup' => '',
'OperatingSystem' => ''
]),
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=AmazonSSM.GetPatchBaselineForPatchGroup', [
'body' => '{
"PatchGroup": "",
"OperatingSystem": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetPatchBaselineForPatchGroup');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'PatchGroup' => '',
'OperatingSystem' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'PatchGroup' => '',
'OperatingSystem' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetPatchBaselineForPatchGroup');
$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=AmazonSSM.GetPatchBaselineForPatchGroup' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"PatchGroup": "",
"OperatingSystem": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetPatchBaselineForPatchGroup' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"PatchGroup": "",
"OperatingSystem": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"PatchGroup\": \"\",\n \"OperatingSystem\": \"\"\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=AmazonSSM.GetPatchBaselineForPatchGroup"
payload = {
"PatchGroup": "",
"OperatingSystem": ""
}
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=AmazonSSM.GetPatchBaselineForPatchGroup"
payload <- "{\n \"PatchGroup\": \"\",\n \"OperatingSystem\": \"\"\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=AmazonSSM.GetPatchBaselineForPatchGroup")
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 \"PatchGroup\": \"\",\n \"OperatingSystem\": \"\"\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 \"PatchGroup\": \"\",\n \"OperatingSystem\": \"\"\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=AmazonSSM.GetPatchBaselineForPatchGroup";
let payload = json!({
"PatchGroup": "",
"OperatingSystem": ""
});
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=AmazonSSM.GetPatchBaselineForPatchGroup' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"PatchGroup": "",
"OperatingSystem": ""
}'
echo '{
"PatchGroup": "",
"OperatingSystem": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetPatchBaselineForPatchGroup' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "PatchGroup": "",\n "OperatingSystem": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetPatchBaselineForPatchGroup'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"PatchGroup": "",
"OperatingSystem": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetPatchBaselineForPatchGroup")! 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
GetResourcePolicies
{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetResourcePolicies
HEADERS
X-Amz-Target
BODY json
{
"ResourceArn": "",
"NextToken": "",
"MaxResults": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetResourcePolicies");
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 \"ResourceArn\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetResourcePolicies" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ResourceArn ""
:NextToken ""
:MaxResults ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetResourcePolicies"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ResourceArn\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.GetResourcePolicies"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ResourceArn\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.GetResourcePolicies");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ResourceArn\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetResourcePolicies"
payload := strings.NewReader("{\n \"ResourceArn\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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
{
"ResourceArn": "",
"NextToken": "",
"MaxResults": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetResourcePolicies")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ResourceArn\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetResourcePolicies"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ResourceArn\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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 \"ResourceArn\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetResourcePolicies")
.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=AmazonSSM.GetResourcePolicies")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ResourceArn\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.asString();
const data = JSON.stringify({
ResourceArn: '',
NextToken: '',
MaxResults: ''
});
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=AmazonSSM.GetResourcePolicies');
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=AmazonSSM.GetResourcePolicies',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ResourceArn: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetResourcePolicies';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ResourceArn":"","NextToken":"","MaxResults":""}'
};
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=AmazonSSM.GetResourcePolicies',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ResourceArn": "",\n "NextToken": "",\n "MaxResults": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ResourceArn\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetResourcePolicies")
.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({ResourceArn: '', NextToken: '', MaxResults: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetResourcePolicies',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {ResourceArn: '', NextToken: '', MaxResults: ''},
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=AmazonSSM.GetResourcePolicies');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ResourceArn: '',
NextToken: '',
MaxResults: ''
});
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=AmazonSSM.GetResourcePolicies',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ResourceArn: '', NextToken: '', MaxResults: ''}
};
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=AmazonSSM.GetResourcePolicies';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ResourceArn":"","NextToken":"","MaxResults":""}'
};
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 = @{ @"ResourceArn": @"",
@"NextToken": @"",
@"MaxResults": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetResourcePolicies"]
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=AmazonSSM.GetResourcePolicies" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"ResourceArn\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetResourcePolicies",
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([
'ResourceArn' => '',
'NextToken' => '',
'MaxResults' => ''
]),
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=AmazonSSM.GetResourcePolicies', [
'body' => '{
"ResourceArn": "",
"NextToken": "",
"MaxResults": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetResourcePolicies');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ResourceArn' => '',
'NextToken' => '',
'MaxResults' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ResourceArn' => '',
'NextToken' => '',
'MaxResults' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetResourcePolicies');
$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=AmazonSSM.GetResourcePolicies' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ResourceArn": "",
"NextToken": "",
"MaxResults": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetResourcePolicies' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ResourceArn": "",
"NextToken": "",
"MaxResults": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ResourceArn\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.GetResourcePolicies"
payload = {
"ResourceArn": "",
"NextToken": "",
"MaxResults": ""
}
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=AmazonSSM.GetResourcePolicies"
payload <- "{\n \"ResourceArn\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.GetResourcePolicies")
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 \"ResourceArn\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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 \"ResourceArn\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.GetResourcePolicies";
let payload = json!({
"ResourceArn": "",
"NextToken": "",
"MaxResults": ""
});
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=AmazonSSM.GetResourcePolicies' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ResourceArn": "",
"NextToken": "",
"MaxResults": ""
}'
echo '{
"ResourceArn": "",
"NextToken": "",
"MaxResults": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetResourcePolicies' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ResourceArn": "",\n "NextToken": "",\n "MaxResults": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetResourcePolicies'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"ResourceArn": "",
"NextToken": "",
"MaxResults": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetResourcePolicies")! 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
GetServiceSetting
{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetServiceSetting
HEADERS
X-Amz-Target
BODY json
{
"SettingId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetServiceSetting");
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 \"SettingId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetServiceSetting" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:SettingId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetServiceSetting"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"SettingId\": \"\"\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=AmazonSSM.GetServiceSetting"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"SettingId\": \"\"\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=AmazonSSM.GetServiceSetting");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"SettingId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetServiceSetting"
payload := strings.NewReader("{\n \"SettingId\": \"\"\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: 21
{
"SettingId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetServiceSetting")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"SettingId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetServiceSetting"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"SettingId\": \"\"\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 \"SettingId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetServiceSetting")
.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=AmazonSSM.GetServiceSetting")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"SettingId\": \"\"\n}")
.asString();
const data = JSON.stringify({
SettingId: ''
});
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=AmazonSSM.GetServiceSetting');
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=AmazonSSM.GetServiceSetting',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {SettingId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetServiceSetting';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"SettingId":""}'
};
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=AmazonSSM.GetServiceSetting',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "SettingId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"SettingId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetServiceSetting")
.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({SettingId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetServiceSetting',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {SettingId: ''},
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=AmazonSSM.GetServiceSetting');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
SettingId: ''
});
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=AmazonSSM.GetServiceSetting',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {SettingId: ''}
};
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=AmazonSSM.GetServiceSetting';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"SettingId":""}'
};
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 = @{ @"SettingId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetServiceSetting"]
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=AmazonSSM.GetServiceSetting" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"SettingId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetServiceSetting",
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([
'SettingId' => ''
]),
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=AmazonSSM.GetServiceSetting', [
'body' => '{
"SettingId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetServiceSetting');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'SettingId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'SettingId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetServiceSetting');
$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=AmazonSSM.GetServiceSetting' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SettingId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetServiceSetting' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SettingId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"SettingId\": \"\"\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=AmazonSSM.GetServiceSetting"
payload = { "SettingId": "" }
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=AmazonSSM.GetServiceSetting"
payload <- "{\n \"SettingId\": \"\"\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=AmazonSSM.GetServiceSetting")
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 \"SettingId\": \"\"\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 \"SettingId\": \"\"\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=AmazonSSM.GetServiceSetting";
let payload = json!({"SettingId": ""});
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=AmazonSSM.GetServiceSetting' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"SettingId": ""
}'
echo '{
"SettingId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetServiceSetting' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "SettingId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetServiceSetting'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["SettingId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.GetServiceSetting")! 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
LabelParameterVersion
{{baseUrl}}/#X-Amz-Target=AmazonSSM.LabelParameterVersion
HEADERS
X-Amz-Target
BODY json
{
"Name": "",
"ParameterVersion": "",
"Labels": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.LabelParameterVersion");
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 \"ParameterVersion\": \"\",\n \"Labels\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.LabelParameterVersion" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Name ""
:ParameterVersion ""
:Labels ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.LabelParameterVersion"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Name\": \"\",\n \"ParameterVersion\": \"\",\n \"Labels\": \"\"\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=AmazonSSM.LabelParameterVersion"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Name\": \"\",\n \"ParameterVersion\": \"\",\n \"Labels\": \"\"\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=AmazonSSM.LabelParameterVersion");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Name\": \"\",\n \"ParameterVersion\": \"\",\n \"Labels\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.LabelParameterVersion"
payload := strings.NewReader("{\n \"Name\": \"\",\n \"ParameterVersion\": \"\",\n \"Labels\": \"\"\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
{
"Name": "",
"ParameterVersion": "",
"Labels": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.LabelParameterVersion")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Name\": \"\",\n \"ParameterVersion\": \"\",\n \"Labels\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.LabelParameterVersion"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Name\": \"\",\n \"ParameterVersion\": \"\",\n \"Labels\": \"\"\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 \"ParameterVersion\": \"\",\n \"Labels\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.LabelParameterVersion")
.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=AmazonSSM.LabelParameterVersion")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Name\": \"\",\n \"ParameterVersion\": \"\",\n \"Labels\": \"\"\n}")
.asString();
const data = JSON.stringify({
Name: '',
ParameterVersion: '',
Labels: ''
});
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=AmazonSSM.LabelParameterVersion');
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=AmazonSSM.LabelParameterVersion',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Name: '', ParameterVersion: '', Labels: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.LabelParameterVersion';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","ParameterVersion":"","Labels":""}'
};
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=AmazonSSM.LabelParameterVersion',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Name": "",\n "ParameterVersion": "",\n "Labels": ""\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 \"ParameterVersion\": \"\",\n \"Labels\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.LabelParameterVersion")
.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: '', ParameterVersion: '', Labels: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.LabelParameterVersion',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Name: '', ParameterVersion: '', Labels: ''},
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=AmazonSSM.LabelParameterVersion');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Name: '',
ParameterVersion: '',
Labels: ''
});
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=AmazonSSM.LabelParameterVersion',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Name: '', ParameterVersion: '', Labels: ''}
};
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=AmazonSSM.LabelParameterVersion';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","ParameterVersion":"","Labels":""}'
};
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": @"",
@"ParameterVersion": @"",
@"Labels": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.LabelParameterVersion"]
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=AmazonSSM.LabelParameterVersion" 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 \"ParameterVersion\": \"\",\n \"Labels\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.LabelParameterVersion",
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' => '',
'ParameterVersion' => '',
'Labels' => ''
]),
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=AmazonSSM.LabelParameterVersion', [
'body' => '{
"Name": "",
"ParameterVersion": "",
"Labels": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.LabelParameterVersion');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Name' => '',
'ParameterVersion' => '',
'Labels' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Name' => '',
'ParameterVersion' => '',
'Labels' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.LabelParameterVersion');
$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=AmazonSSM.LabelParameterVersion' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"ParameterVersion": "",
"Labels": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.LabelParameterVersion' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"ParameterVersion": "",
"Labels": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Name\": \"\",\n \"ParameterVersion\": \"\",\n \"Labels\": \"\"\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=AmazonSSM.LabelParameterVersion"
payload = {
"Name": "",
"ParameterVersion": "",
"Labels": ""
}
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=AmazonSSM.LabelParameterVersion"
payload <- "{\n \"Name\": \"\",\n \"ParameterVersion\": \"\",\n \"Labels\": \"\"\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=AmazonSSM.LabelParameterVersion")
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 \"ParameterVersion\": \"\",\n \"Labels\": \"\"\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 \"ParameterVersion\": \"\",\n \"Labels\": \"\"\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=AmazonSSM.LabelParameterVersion";
let payload = json!({
"Name": "",
"ParameterVersion": "",
"Labels": ""
});
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=AmazonSSM.LabelParameterVersion' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Name": "",
"ParameterVersion": "",
"Labels": ""
}'
echo '{
"Name": "",
"ParameterVersion": "",
"Labels": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.LabelParameterVersion' \
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 "ParameterVersion": "",\n "Labels": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.LabelParameterVersion'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Name": "",
"ParameterVersion": "",
"Labels": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.LabelParameterVersion")! 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
ListAssociationVersions
{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListAssociationVersions
HEADERS
X-Amz-Target
BODY json
{
"AssociationId": "",
"MaxResults": "",
"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=AmazonSSM.ListAssociationVersions");
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 \"AssociationId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListAssociationVersions" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:AssociationId ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListAssociationVersions"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"AssociationId\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListAssociationVersions"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"AssociationId\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListAssociationVersions");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AssociationId\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListAssociationVersions"
payload := strings.NewReader("{\n \"AssociationId\": \"\",\n \"MaxResults\": \"\",\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: 64
{
"AssociationId": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListAssociationVersions")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"AssociationId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListAssociationVersions"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AssociationId\": \"\",\n \"MaxResults\": \"\",\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 \"AssociationId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListAssociationVersions")
.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=AmazonSSM.ListAssociationVersions")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"AssociationId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
AssociationId: '',
MaxResults: '',
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=AmazonSSM.ListAssociationVersions');
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=AmazonSSM.ListAssociationVersions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AssociationId: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListAssociationVersions';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AssociationId":"","MaxResults":"","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=AmazonSSM.ListAssociationVersions',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "AssociationId": "",\n "MaxResults": "",\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 \"AssociationId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListAssociationVersions")
.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({AssociationId: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListAssociationVersions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {AssociationId: '', MaxResults: '', 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=AmazonSSM.ListAssociationVersions');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
AssociationId: '',
MaxResults: '',
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=AmazonSSM.ListAssociationVersions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AssociationId: '', MaxResults: '', 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=AmazonSSM.ListAssociationVersions';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AssociationId":"","MaxResults":"","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 = @{ @"AssociationId": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListAssociationVersions"]
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=AmazonSSM.ListAssociationVersions" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"AssociationId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListAssociationVersions",
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([
'AssociationId' => '',
'MaxResults' => '',
'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=AmazonSSM.ListAssociationVersions', [
'body' => '{
"AssociationId": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListAssociationVersions');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AssociationId' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AssociationId' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListAssociationVersions');
$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=AmazonSSM.ListAssociationVersions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AssociationId": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListAssociationVersions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AssociationId": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AssociationId\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListAssociationVersions"
payload = {
"AssociationId": "",
"MaxResults": "",
"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=AmazonSSM.ListAssociationVersions"
payload <- "{\n \"AssociationId\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListAssociationVersions")
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 \"AssociationId\": \"\",\n \"MaxResults\": \"\",\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 \"AssociationId\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListAssociationVersions";
let payload = json!({
"AssociationId": "",
"MaxResults": "",
"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=AmazonSSM.ListAssociationVersions' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"AssociationId": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"AssociationId": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListAssociationVersions' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "AssociationId": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListAssociationVersions'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"AssociationId": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListAssociationVersions")! 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
ListAssociations
{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListAssociations
HEADERS
X-Amz-Target
BODY json
{
"AssociationFilterList": "",
"MaxResults": "",
"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=AmazonSSM.ListAssociations");
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 \"AssociationFilterList\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListAssociations" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:AssociationFilterList ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListAssociations"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"AssociationFilterList\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListAssociations"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"AssociationFilterList\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListAssociations");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AssociationFilterList\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListAssociations"
payload := strings.NewReader("{\n \"AssociationFilterList\": \"\",\n \"MaxResults\": \"\",\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: 72
{
"AssociationFilterList": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListAssociations")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"AssociationFilterList\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListAssociations"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AssociationFilterList\": \"\",\n \"MaxResults\": \"\",\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 \"AssociationFilterList\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListAssociations")
.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=AmazonSSM.ListAssociations")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"AssociationFilterList\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
AssociationFilterList: '',
MaxResults: '',
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=AmazonSSM.ListAssociations');
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=AmazonSSM.ListAssociations',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AssociationFilterList: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListAssociations';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AssociationFilterList":"","MaxResults":"","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=AmazonSSM.ListAssociations',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "AssociationFilterList": "",\n "MaxResults": "",\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 \"AssociationFilterList\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListAssociations")
.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({AssociationFilterList: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListAssociations',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {AssociationFilterList: '', MaxResults: '', 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=AmazonSSM.ListAssociations');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
AssociationFilterList: '',
MaxResults: '',
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=AmazonSSM.ListAssociations',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AssociationFilterList: '', MaxResults: '', 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=AmazonSSM.ListAssociations';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AssociationFilterList":"","MaxResults":"","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 = @{ @"AssociationFilterList": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListAssociations"]
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=AmazonSSM.ListAssociations" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"AssociationFilterList\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListAssociations",
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([
'AssociationFilterList' => '',
'MaxResults' => '',
'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=AmazonSSM.ListAssociations', [
'body' => '{
"AssociationFilterList": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListAssociations');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AssociationFilterList' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AssociationFilterList' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListAssociations');
$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=AmazonSSM.ListAssociations' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AssociationFilterList": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListAssociations' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AssociationFilterList": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AssociationFilterList\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListAssociations"
payload = {
"AssociationFilterList": "",
"MaxResults": "",
"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=AmazonSSM.ListAssociations"
payload <- "{\n \"AssociationFilterList\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListAssociations")
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 \"AssociationFilterList\": \"\",\n \"MaxResults\": \"\",\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 \"AssociationFilterList\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListAssociations";
let payload = json!({
"AssociationFilterList": "",
"MaxResults": "",
"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=AmazonSSM.ListAssociations' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"AssociationFilterList": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"AssociationFilterList": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListAssociations' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "AssociationFilterList": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListAssociations'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"AssociationFilterList": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListAssociations")! 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
ListCommandInvocations
{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListCommandInvocations
HEADERS
X-Amz-Target
BODY json
{
"CommandId": "",
"InstanceId": "",
"MaxResults": "",
"NextToken": "",
"Filters": "",
"Details": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListCommandInvocations");
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 \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\",\n \"Details\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListCommandInvocations" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:CommandId ""
:InstanceId ""
:MaxResults ""
:NextToken ""
:Filters ""
:Details ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListCommandInvocations"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\",\n \"Details\": \"\"\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=AmazonSSM.ListCommandInvocations"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\",\n \"Details\": \"\"\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=AmazonSSM.ListCommandInvocations");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\",\n \"Details\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListCommandInvocations"
payload := strings.NewReader("{\n \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\",\n \"Details\": \"\"\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: 114
{
"CommandId": "",
"InstanceId": "",
"MaxResults": "",
"NextToken": "",
"Filters": "",
"Details": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListCommandInvocations")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\",\n \"Details\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListCommandInvocations"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\",\n \"Details\": \"\"\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 \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\",\n \"Details\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListCommandInvocations")
.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=AmazonSSM.ListCommandInvocations")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\",\n \"Details\": \"\"\n}")
.asString();
const data = JSON.stringify({
CommandId: '',
InstanceId: '',
MaxResults: '',
NextToken: '',
Filters: '',
Details: ''
});
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=AmazonSSM.ListCommandInvocations');
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=AmazonSSM.ListCommandInvocations',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
CommandId: '',
InstanceId: '',
MaxResults: '',
NextToken: '',
Filters: '',
Details: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListCommandInvocations';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"CommandId":"","InstanceId":"","MaxResults":"","NextToken":"","Filters":"","Details":""}'
};
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=AmazonSSM.ListCommandInvocations',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "CommandId": "",\n "InstanceId": "",\n "MaxResults": "",\n "NextToken": "",\n "Filters": "",\n "Details": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\",\n \"Details\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListCommandInvocations")
.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({
CommandId: '',
InstanceId: '',
MaxResults: '',
NextToken: '',
Filters: '',
Details: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListCommandInvocations',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
CommandId: '',
InstanceId: '',
MaxResults: '',
NextToken: '',
Filters: '',
Details: ''
},
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=AmazonSSM.ListCommandInvocations');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
CommandId: '',
InstanceId: '',
MaxResults: '',
NextToken: '',
Filters: '',
Details: ''
});
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=AmazonSSM.ListCommandInvocations',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
CommandId: '',
InstanceId: '',
MaxResults: '',
NextToken: '',
Filters: '',
Details: ''
}
};
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=AmazonSSM.ListCommandInvocations';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"CommandId":"","InstanceId":"","MaxResults":"","NextToken":"","Filters":"","Details":""}'
};
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 = @{ @"CommandId": @"",
@"InstanceId": @"",
@"MaxResults": @"",
@"NextToken": @"",
@"Filters": @"",
@"Details": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListCommandInvocations"]
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=AmazonSSM.ListCommandInvocations" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\",\n \"Details\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListCommandInvocations",
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([
'CommandId' => '',
'InstanceId' => '',
'MaxResults' => '',
'NextToken' => '',
'Filters' => '',
'Details' => ''
]),
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=AmazonSSM.ListCommandInvocations', [
'body' => '{
"CommandId": "",
"InstanceId": "",
"MaxResults": "",
"NextToken": "",
"Filters": "",
"Details": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListCommandInvocations');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'CommandId' => '',
'InstanceId' => '',
'MaxResults' => '',
'NextToken' => '',
'Filters' => '',
'Details' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'CommandId' => '',
'InstanceId' => '',
'MaxResults' => '',
'NextToken' => '',
'Filters' => '',
'Details' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListCommandInvocations');
$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=AmazonSSM.ListCommandInvocations' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"CommandId": "",
"InstanceId": "",
"MaxResults": "",
"NextToken": "",
"Filters": "",
"Details": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListCommandInvocations' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"CommandId": "",
"InstanceId": "",
"MaxResults": "",
"NextToken": "",
"Filters": "",
"Details": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\",\n \"Details\": \"\"\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=AmazonSSM.ListCommandInvocations"
payload = {
"CommandId": "",
"InstanceId": "",
"MaxResults": "",
"NextToken": "",
"Filters": "",
"Details": ""
}
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=AmazonSSM.ListCommandInvocations"
payload <- "{\n \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\",\n \"Details\": \"\"\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=AmazonSSM.ListCommandInvocations")
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 \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\",\n \"Details\": \"\"\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 \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\",\n \"Details\": \"\"\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=AmazonSSM.ListCommandInvocations";
let payload = json!({
"CommandId": "",
"InstanceId": "",
"MaxResults": "",
"NextToken": "",
"Filters": "",
"Details": ""
});
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=AmazonSSM.ListCommandInvocations' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"CommandId": "",
"InstanceId": "",
"MaxResults": "",
"NextToken": "",
"Filters": "",
"Details": ""
}'
echo '{
"CommandId": "",
"InstanceId": "",
"MaxResults": "",
"NextToken": "",
"Filters": "",
"Details": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListCommandInvocations' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "CommandId": "",\n "InstanceId": "",\n "MaxResults": "",\n "NextToken": "",\n "Filters": "",\n "Details": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListCommandInvocations'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"CommandId": "",
"InstanceId": "",
"MaxResults": "",
"NextToken": "",
"Filters": "",
"Details": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListCommandInvocations")! 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
ListCommands
{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListCommands
HEADERS
X-Amz-Target
BODY json
{
"CommandId": "",
"InstanceId": "",
"MaxResults": "",
"NextToken": "",
"Filters": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListCommands");
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 \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListCommands" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:CommandId ""
:InstanceId ""
:MaxResults ""
:NextToken ""
:Filters ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListCommands"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\"\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=AmazonSSM.ListCommands"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\"\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=AmazonSSM.ListCommands");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListCommands"
payload := strings.NewReader("{\n \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\"\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: 97
{
"CommandId": "",
"InstanceId": "",
"MaxResults": "",
"NextToken": "",
"Filters": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListCommands")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListCommands"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\"\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 \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListCommands")
.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=AmazonSSM.ListCommands")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\"\n}")
.asString();
const data = JSON.stringify({
CommandId: '',
InstanceId: '',
MaxResults: '',
NextToken: '',
Filters: ''
});
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=AmazonSSM.ListCommands');
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=AmazonSSM.ListCommands',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {CommandId: '', InstanceId: '', MaxResults: '', NextToken: '', Filters: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListCommands';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"CommandId":"","InstanceId":"","MaxResults":"","NextToken":"","Filters":""}'
};
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=AmazonSSM.ListCommands',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "CommandId": "",\n "InstanceId": "",\n "MaxResults": "",\n "NextToken": "",\n "Filters": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListCommands")
.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({CommandId: '', InstanceId: '', MaxResults: '', NextToken: '', Filters: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListCommands',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {CommandId: '', InstanceId: '', MaxResults: '', NextToken: '', Filters: ''},
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=AmazonSSM.ListCommands');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
CommandId: '',
InstanceId: '',
MaxResults: '',
NextToken: '',
Filters: ''
});
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=AmazonSSM.ListCommands',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {CommandId: '', InstanceId: '', MaxResults: '', NextToken: '', Filters: ''}
};
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=AmazonSSM.ListCommands';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"CommandId":"","InstanceId":"","MaxResults":"","NextToken":"","Filters":""}'
};
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 = @{ @"CommandId": @"",
@"InstanceId": @"",
@"MaxResults": @"",
@"NextToken": @"",
@"Filters": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListCommands"]
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=AmazonSSM.ListCommands" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListCommands",
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([
'CommandId' => '',
'InstanceId' => '',
'MaxResults' => '',
'NextToken' => '',
'Filters' => ''
]),
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=AmazonSSM.ListCommands', [
'body' => '{
"CommandId": "",
"InstanceId": "",
"MaxResults": "",
"NextToken": "",
"Filters": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListCommands');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'CommandId' => '',
'InstanceId' => '',
'MaxResults' => '',
'NextToken' => '',
'Filters' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'CommandId' => '',
'InstanceId' => '',
'MaxResults' => '',
'NextToken' => '',
'Filters' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListCommands');
$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=AmazonSSM.ListCommands' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"CommandId": "",
"InstanceId": "",
"MaxResults": "",
"NextToken": "",
"Filters": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListCommands' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"CommandId": "",
"InstanceId": "",
"MaxResults": "",
"NextToken": "",
"Filters": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\"\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=AmazonSSM.ListCommands"
payload = {
"CommandId": "",
"InstanceId": "",
"MaxResults": "",
"NextToken": "",
"Filters": ""
}
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=AmazonSSM.ListCommands"
payload <- "{\n \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\"\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=AmazonSSM.ListCommands")
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 \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\"\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 \"CommandId\": \"\",\n \"InstanceId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\",\n \"Filters\": \"\"\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=AmazonSSM.ListCommands";
let payload = json!({
"CommandId": "",
"InstanceId": "",
"MaxResults": "",
"NextToken": "",
"Filters": ""
});
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=AmazonSSM.ListCommands' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"CommandId": "",
"InstanceId": "",
"MaxResults": "",
"NextToken": "",
"Filters": ""
}'
echo '{
"CommandId": "",
"InstanceId": "",
"MaxResults": "",
"NextToken": "",
"Filters": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListCommands' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "CommandId": "",\n "InstanceId": "",\n "MaxResults": "",\n "NextToken": "",\n "Filters": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListCommands'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"CommandId": "",
"InstanceId": "",
"MaxResults": "",
"NextToken": "",
"Filters": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListCommands")! 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
ListComplianceItems
{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListComplianceItems
HEADERS
X-Amz-Target
BODY json
{
"Filters": "",
"ResourceIds": "",
"ResourceTypes": "",
"NextToken": "",
"MaxResults": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListComplianceItems");
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 \"Filters\": \"\",\n \"ResourceIds\": \"\",\n \"ResourceTypes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListComplianceItems" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Filters ""
:ResourceIds ""
:ResourceTypes ""
:NextToken ""
:MaxResults ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListComplianceItems"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Filters\": \"\",\n \"ResourceIds\": \"\",\n \"ResourceTypes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.ListComplianceItems"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Filters\": \"\",\n \"ResourceIds\": \"\",\n \"ResourceTypes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.ListComplianceItems");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Filters\": \"\",\n \"ResourceIds\": \"\",\n \"ResourceTypes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListComplianceItems"
payload := strings.NewReader("{\n \"Filters\": \"\",\n \"ResourceIds\": \"\",\n \"ResourceTypes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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: 102
{
"Filters": "",
"ResourceIds": "",
"ResourceTypes": "",
"NextToken": "",
"MaxResults": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListComplianceItems")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Filters\": \"\",\n \"ResourceIds\": \"\",\n \"ResourceTypes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListComplianceItems"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Filters\": \"\",\n \"ResourceIds\": \"\",\n \"ResourceTypes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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 \"Filters\": \"\",\n \"ResourceIds\": \"\",\n \"ResourceTypes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListComplianceItems")
.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=AmazonSSM.ListComplianceItems")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Filters\": \"\",\n \"ResourceIds\": \"\",\n \"ResourceTypes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.asString();
const data = JSON.stringify({
Filters: '',
ResourceIds: '',
ResourceTypes: '',
NextToken: '',
MaxResults: ''
});
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=AmazonSSM.ListComplianceItems');
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=AmazonSSM.ListComplianceItems',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Filters: '', ResourceIds: '', ResourceTypes: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListComplianceItems';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Filters":"","ResourceIds":"","ResourceTypes":"","NextToken":"","MaxResults":""}'
};
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=AmazonSSM.ListComplianceItems',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Filters": "",\n "ResourceIds": "",\n "ResourceTypes": "",\n "NextToken": "",\n "MaxResults": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Filters\": \"\",\n \"ResourceIds\": \"\",\n \"ResourceTypes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListComplianceItems")
.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({Filters: '', ResourceIds: '', ResourceTypes: '', NextToken: '', MaxResults: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListComplianceItems',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Filters: '', ResourceIds: '', ResourceTypes: '', NextToken: '', MaxResults: ''},
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=AmazonSSM.ListComplianceItems');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Filters: '',
ResourceIds: '',
ResourceTypes: '',
NextToken: '',
MaxResults: ''
});
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=AmazonSSM.ListComplianceItems',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Filters: '', ResourceIds: '', ResourceTypes: '', NextToken: '', MaxResults: ''}
};
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=AmazonSSM.ListComplianceItems';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Filters":"","ResourceIds":"","ResourceTypes":"","NextToken":"","MaxResults":""}'
};
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 = @{ @"Filters": @"",
@"ResourceIds": @"",
@"ResourceTypes": @"",
@"NextToken": @"",
@"MaxResults": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListComplianceItems"]
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=AmazonSSM.ListComplianceItems" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Filters\": \"\",\n \"ResourceIds\": \"\",\n \"ResourceTypes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListComplianceItems",
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([
'Filters' => '',
'ResourceIds' => '',
'ResourceTypes' => '',
'NextToken' => '',
'MaxResults' => ''
]),
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=AmazonSSM.ListComplianceItems', [
'body' => '{
"Filters": "",
"ResourceIds": "",
"ResourceTypes": "",
"NextToken": "",
"MaxResults": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListComplianceItems');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Filters' => '',
'ResourceIds' => '',
'ResourceTypes' => '',
'NextToken' => '',
'MaxResults' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Filters' => '',
'ResourceIds' => '',
'ResourceTypes' => '',
'NextToken' => '',
'MaxResults' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListComplianceItems');
$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=AmazonSSM.ListComplianceItems' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Filters": "",
"ResourceIds": "",
"ResourceTypes": "",
"NextToken": "",
"MaxResults": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListComplianceItems' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Filters": "",
"ResourceIds": "",
"ResourceTypes": "",
"NextToken": "",
"MaxResults": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Filters\": \"\",\n \"ResourceIds\": \"\",\n \"ResourceTypes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.ListComplianceItems"
payload = {
"Filters": "",
"ResourceIds": "",
"ResourceTypes": "",
"NextToken": "",
"MaxResults": ""
}
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=AmazonSSM.ListComplianceItems"
payload <- "{\n \"Filters\": \"\",\n \"ResourceIds\": \"\",\n \"ResourceTypes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.ListComplianceItems")
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 \"Filters\": \"\",\n \"ResourceIds\": \"\",\n \"ResourceTypes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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 \"Filters\": \"\",\n \"ResourceIds\": \"\",\n \"ResourceTypes\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.ListComplianceItems";
let payload = json!({
"Filters": "",
"ResourceIds": "",
"ResourceTypes": "",
"NextToken": "",
"MaxResults": ""
});
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=AmazonSSM.ListComplianceItems' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Filters": "",
"ResourceIds": "",
"ResourceTypes": "",
"NextToken": "",
"MaxResults": ""
}'
echo '{
"Filters": "",
"ResourceIds": "",
"ResourceTypes": "",
"NextToken": "",
"MaxResults": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListComplianceItems' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Filters": "",\n "ResourceIds": "",\n "ResourceTypes": "",\n "NextToken": "",\n "MaxResults": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListComplianceItems'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Filters": "",
"ResourceIds": "",
"ResourceTypes": "",
"NextToken": "",
"MaxResults": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListComplianceItems")! 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
ListComplianceSummaries
{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListComplianceSummaries
HEADERS
X-Amz-Target
BODY json
{
"Filters": "",
"NextToken": "",
"MaxResults": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListComplianceSummaries");
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 \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListComplianceSummaries" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Filters ""
:NextToken ""
:MaxResults ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListComplianceSummaries"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.ListComplianceSummaries"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.ListComplianceSummaries");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListComplianceSummaries"
payload := strings.NewReader("{\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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
{
"Filters": "",
"NextToken": "",
"MaxResults": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListComplianceSummaries")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListComplianceSummaries"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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 \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListComplianceSummaries")
.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=AmazonSSM.ListComplianceSummaries")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.asString();
const data = JSON.stringify({
Filters: '',
NextToken: '',
MaxResults: ''
});
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=AmazonSSM.ListComplianceSummaries');
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=AmazonSSM.ListComplianceSummaries',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Filters: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListComplianceSummaries';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Filters":"","NextToken":"","MaxResults":""}'
};
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=AmazonSSM.ListComplianceSummaries',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Filters": "",\n "NextToken": "",\n "MaxResults": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListComplianceSummaries")
.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({Filters: '', NextToken: '', MaxResults: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListComplianceSummaries',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Filters: '', NextToken: '', MaxResults: ''},
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=AmazonSSM.ListComplianceSummaries');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Filters: '',
NextToken: '',
MaxResults: ''
});
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=AmazonSSM.ListComplianceSummaries',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Filters: '', NextToken: '', MaxResults: ''}
};
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=AmazonSSM.ListComplianceSummaries';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Filters":"","NextToken":"","MaxResults":""}'
};
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 = @{ @"Filters": @"",
@"NextToken": @"",
@"MaxResults": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListComplianceSummaries"]
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=AmazonSSM.ListComplianceSummaries" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListComplianceSummaries",
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([
'Filters' => '',
'NextToken' => '',
'MaxResults' => ''
]),
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=AmazonSSM.ListComplianceSummaries', [
'body' => '{
"Filters": "",
"NextToken": "",
"MaxResults": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListComplianceSummaries');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Filters' => '',
'NextToken' => '',
'MaxResults' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Filters' => '',
'NextToken' => '',
'MaxResults' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListComplianceSummaries');
$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=AmazonSSM.ListComplianceSummaries' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Filters": "",
"NextToken": "",
"MaxResults": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListComplianceSummaries' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Filters": "",
"NextToken": "",
"MaxResults": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.ListComplianceSummaries"
payload = {
"Filters": "",
"NextToken": "",
"MaxResults": ""
}
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=AmazonSSM.ListComplianceSummaries"
payload <- "{\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.ListComplianceSummaries")
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 \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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 \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.ListComplianceSummaries";
let payload = json!({
"Filters": "",
"NextToken": "",
"MaxResults": ""
});
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=AmazonSSM.ListComplianceSummaries' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Filters": "",
"NextToken": "",
"MaxResults": ""
}'
echo '{
"Filters": "",
"NextToken": "",
"MaxResults": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListComplianceSummaries' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Filters": "",\n "NextToken": "",\n "MaxResults": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListComplianceSummaries'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Filters": "",
"NextToken": "",
"MaxResults": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListComplianceSummaries")! 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
ListDocumentMetadataHistory
{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocumentMetadataHistory
HEADERS
X-Amz-Target
BODY json
{
"Name": "",
"DocumentVersion": "",
"Metadata": "",
"NextToken": "",
"MaxResults": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocumentMetadataHistory");
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 \"DocumentVersion\": \"\",\n \"Metadata\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocumentMetadataHistory" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Name ""
:DocumentVersion ""
:Metadata ""
:NextToken ""
:MaxResults ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocumentMetadataHistory"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"Metadata\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.ListDocumentMetadataHistory"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"Metadata\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.ListDocumentMetadataHistory");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"Metadata\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocumentMetadataHistory"
payload := strings.NewReader("{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"Metadata\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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: 98
{
"Name": "",
"DocumentVersion": "",
"Metadata": "",
"NextToken": "",
"MaxResults": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocumentMetadataHistory")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"Metadata\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocumentMetadataHistory"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"Metadata\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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 \"DocumentVersion\": \"\",\n \"Metadata\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocumentMetadataHistory")
.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=AmazonSSM.ListDocumentMetadataHistory")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"Metadata\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.asString();
const data = JSON.stringify({
Name: '',
DocumentVersion: '',
Metadata: '',
NextToken: '',
MaxResults: ''
});
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=AmazonSSM.ListDocumentMetadataHistory');
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=AmazonSSM.ListDocumentMetadataHistory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Name: '', DocumentVersion: '', Metadata: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocumentMetadataHistory';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","DocumentVersion":"","Metadata":"","NextToken":"","MaxResults":""}'
};
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=AmazonSSM.ListDocumentMetadataHistory',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Name": "",\n "DocumentVersion": "",\n "Metadata": "",\n "NextToken": "",\n "MaxResults": ""\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 \"DocumentVersion\": \"\",\n \"Metadata\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocumentMetadataHistory")
.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: '', DocumentVersion: '', Metadata: '', NextToken: '', MaxResults: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocumentMetadataHistory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Name: '', DocumentVersion: '', Metadata: '', NextToken: '', MaxResults: ''},
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=AmazonSSM.ListDocumentMetadataHistory');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Name: '',
DocumentVersion: '',
Metadata: '',
NextToken: '',
MaxResults: ''
});
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=AmazonSSM.ListDocumentMetadataHistory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Name: '', DocumentVersion: '', Metadata: '', NextToken: '', MaxResults: ''}
};
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=AmazonSSM.ListDocumentMetadataHistory';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","DocumentVersion":"","Metadata":"","NextToken":"","MaxResults":""}'
};
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": @"",
@"DocumentVersion": @"",
@"Metadata": @"",
@"NextToken": @"",
@"MaxResults": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocumentMetadataHistory"]
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=AmazonSSM.ListDocumentMetadataHistory" 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 \"DocumentVersion\": \"\",\n \"Metadata\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocumentMetadataHistory",
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' => '',
'DocumentVersion' => '',
'Metadata' => '',
'NextToken' => '',
'MaxResults' => ''
]),
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=AmazonSSM.ListDocumentMetadataHistory', [
'body' => '{
"Name": "",
"DocumentVersion": "",
"Metadata": "",
"NextToken": "",
"MaxResults": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocumentMetadataHistory');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Name' => '',
'DocumentVersion' => '',
'Metadata' => '',
'NextToken' => '',
'MaxResults' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Name' => '',
'DocumentVersion' => '',
'Metadata' => '',
'NextToken' => '',
'MaxResults' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocumentMetadataHistory');
$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=AmazonSSM.ListDocumentMetadataHistory' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"DocumentVersion": "",
"Metadata": "",
"NextToken": "",
"MaxResults": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocumentMetadataHistory' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"DocumentVersion": "",
"Metadata": "",
"NextToken": "",
"MaxResults": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"Metadata\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.ListDocumentMetadataHistory"
payload = {
"Name": "",
"DocumentVersion": "",
"Metadata": "",
"NextToken": "",
"MaxResults": ""
}
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=AmazonSSM.ListDocumentMetadataHistory"
payload <- "{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"Metadata\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.ListDocumentMetadataHistory")
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 \"DocumentVersion\": \"\",\n \"Metadata\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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 \"DocumentVersion\": \"\",\n \"Metadata\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.ListDocumentMetadataHistory";
let payload = json!({
"Name": "",
"DocumentVersion": "",
"Metadata": "",
"NextToken": "",
"MaxResults": ""
});
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=AmazonSSM.ListDocumentMetadataHistory' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Name": "",
"DocumentVersion": "",
"Metadata": "",
"NextToken": "",
"MaxResults": ""
}'
echo '{
"Name": "",
"DocumentVersion": "",
"Metadata": "",
"NextToken": "",
"MaxResults": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocumentMetadataHistory' \
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 "DocumentVersion": "",\n "Metadata": "",\n "NextToken": "",\n "MaxResults": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocumentMetadataHistory'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Name": "",
"DocumentVersion": "",
"Metadata": "",
"NextToken": "",
"MaxResults": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocumentMetadataHistory")! 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
ListDocumentVersions
{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocumentVersions
HEADERS
X-Amz-Target
BODY json
{
"Name": "",
"MaxResults": "",
"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=AmazonSSM.ListDocumentVersions");
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 \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocumentVersions" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Name ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocumentVersions"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Name\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListDocumentVersions"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Name\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListDocumentVersions");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Name\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListDocumentVersions"
payload := strings.NewReader("{\n \"Name\": \"\",\n \"MaxResults\": \"\",\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: 55
{
"Name": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocumentVersions")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Name\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocumentVersions"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Name\": \"\",\n \"MaxResults\": \"\",\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 \"Name\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocumentVersions")
.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=AmazonSSM.ListDocumentVersions")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Name\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
Name: '',
MaxResults: '',
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=AmazonSSM.ListDocumentVersions');
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=AmazonSSM.ListDocumentVersions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Name: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocumentVersions';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","MaxResults":"","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=AmazonSSM.ListDocumentVersions',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Name": "",\n "MaxResults": "",\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 \"Name\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocumentVersions")
.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: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocumentVersions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Name: '', MaxResults: '', 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=AmazonSSM.ListDocumentVersions');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Name: '',
MaxResults: '',
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=AmazonSSM.ListDocumentVersions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Name: '', MaxResults: '', 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=AmazonSSM.ListDocumentVersions';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","MaxResults":"","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 = @{ @"Name": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocumentVersions"]
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=AmazonSSM.ListDocumentVersions" 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 \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocumentVersions",
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' => '',
'MaxResults' => '',
'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=AmazonSSM.ListDocumentVersions', [
'body' => '{
"Name": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocumentVersions');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Name' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Name' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocumentVersions');
$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=AmazonSSM.ListDocumentVersions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocumentVersions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Name\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListDocumentVersions"
payload = {
"Name": "",
"MaxResults": "",
"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=AmazonSSM.ListDocumentVersions"
payload <- "{\n \"Name\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListDocumentVersions")
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 \"MaxResults\": \"\",\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 \"Name\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListDocumentVersions";
let payload = json!({
"Name": "",
"MaxResults": "",
"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=AmazonSSM.ListDocumentVersions' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Name": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"Name": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocumentVersions' \
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 "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocumentVersions'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Name": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocumentVersions")! 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
ListDocuments
{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocuments
HEADERS
X-Amz-Target
BODY json
{
"DocumentFilterList": "",
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.ListDocuments");
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 \"DocumentFilterList\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocuments" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DocumentFilterList ""
:Filters ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocuments"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DocumentFilterList\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListDocuments"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DocumentFilterList\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListDocuments");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DocumentFilterList\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListDocuments"
payload := strings.NewReader("{\n \"DocumentFilterList\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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: 86
{
"DocumentFilterList": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocuments")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DocumentFilterList\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocuments"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DocumentFilterList\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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 \"DocumentFilterList\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocuments")
.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=AmazonSSM.ListDocuments")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DocumentFilterList\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
DocumentFilterList: '',
Filters: '',
MaxResults: '',
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=AmazonSSM.ListDocuments');
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=AmazonSSM.ListDocuments',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DocumentFilterList: '', Filters: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocuments';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DocumentFilterList":"","Filters":"","MaxResults":"","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=AmazonSSM.ListDocuments',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DocumentFilterList": "",\n "Filters": "",\n "MaxResults": "",\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 \"DocumentFilterList\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocuments")
.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({DocumentFilterList: '', Filters: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocuments',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DocumentFilterList: '', Filters: '', MaxResults: '', 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=AmazonSSM.ListDocuments');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DocumentFilterList: '',
Filters: '',
MaxResults: '',
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=AmazonSSM.ListDocuments',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DocumentFilterList: '', Filters: '', MaxResults: '', 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=AmazonSSM.ListDocuments';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DocumentFilterList":"","Filters":"","MaxResults":"","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 = @{ @"DocumentFilterList": @"",
@"Filters": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocuments"]
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=AmazonSSM.ListDocuments" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DocumentFilterList\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocuments",
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([
'DocumentFilterList' => '',
'Filters' => '',
'MaxResults' => '',
'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=AmazonSSM.ListDocuments', [
'body' => '{
"DocumentFilterList": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocuments');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DocumentFilterList' => '',
'Filters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DocumentFilterList' => '',
'Filters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocuments');
$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=AmazonSSM.ListDocuments' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DocumentFilterList": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocuments' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DocumentFilterList": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DocumentFilterList\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListDocuments"
payload = {
"DocumentFilterList": "",
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.ListDocuments"
payload <- "{\n \"DocumentFilterList\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListDocuments")
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 \"DocumentFilterList\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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 \"DocumentFilterList\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListDocuments";
let payload = json!({
"DocumentFilterList": "",
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.ListDocuments' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DocumentFilterList": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"DocumentFilterList": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocuments' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DocumentFilterList": "",\n "Filters": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocuments'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DocumentFilterList": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListDocuments")! 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
ListInventoryEntries
{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListInventoryEntries
HEADERS
X-Amz-Target
BODY json
{
"InstanceId": "",
"TypeName": "",
"Filters": "",
"NextToken": "",
"MaxResults": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListInventoryEntries");
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 \"InstanceId\": \"\",\n \"TypeName\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListInventoryEntries" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:InstanceId ""
:TypeName ""
:Filters ""
:NextToken ""
:MaxResults ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListInventoryEntries"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"InstanceId\": \"\",\n \"TypeName\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.ListInventoryEntries"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"InstanceId\": \"\",\n \"TypeName\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.ListInventoryEntries");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"InstanceId\": \"\",\n \"TypeName\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListInventoryEntries"
payload := strings.NewReader("{\n \"InstanceId\": \"\",\n \"TypeName\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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: 96
{
"InstanceId": "",
"TypeName": "",
"Filters": "",
"NextToken": "",
"MaxResults": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListInventoryEntries")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"InstanceId\": \"\",\n \"TypeName\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListInventoryEntries"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"InstanceId\": \"\",\n \"TypeName\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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 \"InstanceId\": \"\",\n \"TypeName\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListInventoryEntries")
.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=AmazonSSM.ListInventoryEntries")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"InstanceId\": \"\",\n \"TypeName\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.asString();
const data = JSON.stringify({
InstanceId: '',
TypeName: '',
Filters: '',
NextToken: '',
MaxResults: ''
});
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=AmazonSSM.ListInventoryEntries');
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=AmazonSSM.ListInventoryEntries',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: '', TypeName: '', Filters: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListInventoryEntries';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":"","TypeName":"","Filters":"","NextToken":"","MaxResults":""}'
};
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=AmazonSSM.ListInventoryEntries',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "InstanceId": "",\n "TypeName": "",\n "Filters": "",\n "NextToken": "",\n "MaxResults": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"InstanceId\": \"\",\n \"TypeName\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListInventoryEntries")
.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({InstanceId: '', TypeName: '', Filters: '', NextToken: '', MaxResults: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListInventoryEntries',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {InstanceId: '', TypeName: '', Filters: '', NextToken: '', MaxResults: ''},
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=AmazonSSM.ListInventoryEntries');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
InstanceId: '',
TypeName: '',
Filters: '',
NextToken: '',
MaxResults: ''
});
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=AmazonSSM.ListInventoryEntries',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: '', TypeName: '', Filters: '', NextToken: '', MaxResults: ''}
};
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=AmazonSSM.ListInventoryEntries';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":"","TypeName":"","Filters":"","NextToken":"","MaxResults":""}'
};
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 = @{ @"InstanceId": @"",
@"TypeName": @"",
@"Filters": @"",
@"NextToken": @"",
@"MaxResults": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListInventoryEntries"]
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=AmazonSSM.ListInventoryEntries" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"InstanceId\": \"\",\n \"TypeName\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListInventoryEntries",
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([
'InstanceId' => '',
'TypeName' => '',
'Filters' => '',
'NextToken' => '',
'MaxResults' => ''
]),
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=AmazonSSM.ListInventoryEntries', [
'body' => '{
"InstanceId": "",
"TypeName": "",
"Filters": "",
"NextToken": "",
"MaxResults": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListInventoryEntries');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'InstanceId' => '',
'TypeName' => '',
'Filters' => '',
'NextToken' => '',
'MaxResults' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'InstanceId' => '',
'TypeName' => '',
'Filters' => '',
'NextToken' => '',
'MaxResults' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListInventoryEntries');
$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=AmazonSSM.ListInventoryEntries' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": "",
"TypeName": "",
"Filters": "",
"NextToken": "",
"MaxResults": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListInventoryEntries' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": "",
"TypeName": "",
"Filters": "",
"NextToken": "",
"MaxResults": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"InstanceId\": \"\",\n \"TypeName\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.ListInventoryEntries"
payload = {
"InstanceId": "",
"TypeName": "",
"Filters": "",
"NextToken": "",
"MaxResults": ""
}
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=AmazonSSM.ListInventoryEntries"
payload <- "{\n \"InstanceId\": \"\",\n \"TypeName\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.ListInventoryEntries")
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 \"InstanceId\": \"\",\n \"TypeName\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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 \"InstanceId\": \"\",\n \"TypeName\": \"\",\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.ListInventoryEntries";
let payload = json!({
"InstanceId": "",
"TypeName": "",
"Filters": "",
"NextToken": "",
"MaxResults": ""
});
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=AmazonSSM.ListInventoryEntries' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"InstanceId": "",
"TypeName": "",
"Filters": "",
"NextToken": "",
"MaxResults": ""
}'
echo '{
"InstanceId": "",
"TypeName": "",
"Filters": "",
"NextToken": "",
"MaxResults": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListInventoryEntries' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "InstanceId": "",\n "TypeName": "",\n "Filters": "",\n "NextToken": "",\n "MaxResults": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListInventoryEntries'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"InstanceId": "",
"TypeName": "",
"Filters": "",
"NextToken": "",
"MaxResults": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListInventoryEntries")! 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
ListOpsItemEvents
{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsItemEvents
HEADERS
X-Amz-Target
BODY json
{
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.ListOpsItemEvents");
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 \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsItemEvents" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Filters ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsItemEvents"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListOpsItemEvents"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListOpsItemEvents");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListOpsItemEvents"
payload := strings.NewReader("{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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
{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsItemEvents")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsItemEvents"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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 \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsItemEvents")
.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=AmazonSSM.ListOpsItemEvents")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
Filters: '',
MaxResults: '',
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=AmazonSSM.ListOpsItemEvents');
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=AmazonSSM.ListOpsItemEvents',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Filters: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsItemEvents';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Filters":"","MaxResults":"","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=AmazonSSM.ListOpsItemEvents',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Filters": "",\n "MaxResults": "",\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 \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsItemEvents")
.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({Filters: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsItemEvents',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Filters: '', MaxResults: '', 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=AmazonSSM.ListOpsItemEvents');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Filters: '',
MaxResults: '',
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=AmazonSSM.ListOpsItemEvents',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Filters: '', MaxResults: '', 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=AmazonSSM.ListOpsItemEvents';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Filters":"","MaxResults":"","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 = @{ @"Filters": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsItemEvents"]
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=AmazonSSM.ListOpsItemEvents" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsItemEvents",
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([
'Filters' => '',
'MaxResults' => '',
'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=AmazonSSM.ListOpsItemEvents', [
'body' => '{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsItemEvents');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Filters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Filters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsItemEvents');
$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=AmazonSSM.ListOpsItemEvents' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsItemEvents' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListOpsItemEvents"
payload = {
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.ListOpsItemEvents"
payload <- "{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListOpsItemEvents")
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 \"Filters\": \"\",\n \"MaxResults\": \"\",\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 \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListOpsItemEvents";
let payload = json!({
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.ListOpsItemEvents' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsItemEvents' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Filters": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsItemEvents'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Filters": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsItemEvents")! 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=AmazonSSM.ListOpsItemRelatedItems");
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 \"OpsItemId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsItemRelatedItems" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OpsItemId ""
:Filters ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsItemRelatedItems"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OpsItemId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListOpsItemRelatedItems"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OpsItemId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListOpsItemRelatedItems");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OpsItemId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListOpsItemRelatedItems"
payload := strings.NewReader("{\n \"OpsItemId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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: 77
{
"OpsItemId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsItemRelatedItems")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OpsItemId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsItemRelatedItems"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OpsItemId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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 \"OpsItemId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsItemRelatedItems")
.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=AmazonSSM.ListOpsItemRelatedItems")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OpsItemId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
OpsItemId: '',
Filters: '',
MaxResults: '',
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=AmazonSSM.ListOpsItemRelatedItems');
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=AmazonSSM.ListOpsItemRelatedItems',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OpsItemId: '', Filters: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsItemRelatedItems';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OpsItemId":"","Filters":"","MaxResults":"","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=AmazonSSM.ListOpsItemRelatedItems',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OpsItemId": "",\n "Filters": "",\n "MaxResults": "",\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 \"OpsItemId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsItemRelatedItems")
.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({OpsItemId: '', Filters: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsItemRelatedItems',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OpsItemId: '', Filters: '', MaxResults: '', 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=AmazonSSM.ListOpsItemRelatedItems');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OpsItemId: '',
Filters: '',
MaxResults: '',
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=AmazonSSM.ListOpsItemRelatedItems',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OpsItemId: '', Filters: '', MaxResults: '', 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=AmazonSSM.ListOpsItemRelatedItems';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OpsItemId":"","Filters":"","MaxResults":"","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 = @{ @"OpsItemId": @"",
@"Filters": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsItemRelatedItems"]
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=AmazonSSM.ListOpsItemRelatedItems" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OpsItemId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsItemRelatedItems",
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([
'OpsItemId' => '',
'Filters' => '',
'MaxResults' => '',
'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=AmazonSSM.ListOpsItemRelatedItems', [
'body' => '{
"OpsItemId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsItemRelatedItems');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OpsItemId' => '',
'Filters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OpsItemId' => '',
'Filters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsItemRelatedItems');
$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=AmazonSSM.ListOpsItemRelatedItems' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OpsItemId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsItemRelatedItems' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OpsItemId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OpsItemId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListOpsItemRelatedItems"
payload = {
"OpsItemId": "",
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.ListOpsItemRelatedItems"
payload <- "{\n \"OpsItemId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListOpsItemRelatedItems")
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 \"OpsItemId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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 \"OpsItemId\": \"\",\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListOpsItemRelatedItems";
let payload = json!({
"OpsItemId": "",
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.ListOpsItemRelatedItems' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OpsItemId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"OpsItemId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsItemRelatedItems' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OpsItemId": "",\n "Filters": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsItemRelatedItems'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OpsItemId": "",
"Filters": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsItemRelatedItems")! 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
ListOpsMetadata
{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsMetadata
HEADERS
X-Amz-Target
BODY json
{
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.ListOpsMetadata");
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 \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsMetadata" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Filters ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsMetadata"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListOpsMetadata"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListOpsMetadata");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListOpsMetadata"
payload := strings.NewReader("{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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
{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsMetadata")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsMetadata"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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 \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsMetadata")
.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=AmazonSSM.ListOpsMetadata")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
Filters: '',
MaxResults: '',
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=AmazonSSM.ListOpsMetadata');
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=AmazonSSM.ListOpsMetadata',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Filters: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsMetadata';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Filters":"","MaxResults":"","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=AmazonSSM.ListOpsMetadata',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Filters": "",\n "MaxResults": "",\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 \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsMetadata")
.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({Filters: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsMetadata',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Filters: '', MaxResults: '', 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=AmazonSSM.ListOpsMetadata');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Filters: '',
MaxResults: '',
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=AmazonSSM.ListOpsMetadata',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Filters: '', MaxResults: '', 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=AmazonSSM.ListOpsMetadata';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Filters":"","MaxResults":"","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 = @{ @"Filters": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsMetadata"]
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=AmazonSSM.ListOpsMetadata" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsMetadata",
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([
'Filters' => '',
'MaxResults' => '',
'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=AmazonSSM.ListOpsMetadata', [
'body' => '{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsMetadata');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Filters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Filters' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsMetadata');
$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=AmazonSSM.ListOpsMetadata' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsMetadata' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListOpsMetadata"
payload = {
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.ListOpsMetadata"
payload <- "{\n \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListOpsMetadata")
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 \"Filters\": \"\",\n \"MaxResults\": \"\",\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 \"Filters\": \"\",\n \"MaxResults\": \"\",\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=AmazonSSM.ListOpsMetadata";
let payload = json!({
"Filters": "",
"MaxResults": "",
"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=AmazonSSM.ListOpsMetadata' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"Filters": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsMetadata' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Filters": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsMetadata'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Filters": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListOpsMetadata")! 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
ListResourceComplianceSummaries
{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListResourceComplianceSummaries
HEADERS
X-Amz-Target
BODY json
{
"Filters": "",
"NextToken": "",
"MaxResults": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListResourceComplianceSummaries");
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 \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListResourceComplianceSummaries" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Filters ""
:NextToken ""
:MaxResults ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListResourceComplianceSummaries"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.ListResourceComplianceSummaries"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.ListResourceComplianceSummaries");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListResourceComplianceSummaries"
payload := strings.NewReader("{\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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
{
"Filters": "",
"NextToken": "",
"MaxResults": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListResourceComplianceSummaries")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListResourceComplianceSummaries"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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 \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListResourceComplianceSummaries")
.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=AmazonSSM.ListResourceComplianceSummaries")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.asString();
const data = JSON.stringify({
Filters: '',
NextToken: '',
MaxResults: ''
});
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=AmazonSSM.ListResourceComplianceSummaries');
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=AmazonSSM.ListResourceComplianceSummaries',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Filters: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListResourceComplianceSummaries';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Filters":"","NextToken":"","MaxResults":""}'
};
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=AmazonSSM.ListResourceComplianceSummaries',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Filters": "",\n "NextToken": "",\n "MaxResults": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListResourceComplianceSummaries")
.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({Filters: '', NextToken: '', MaxResults: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListResourceComplianceSummaries',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Filters: '', NextToken: '', MaxResults: ''},
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=AmazonSSM.ListResourceComplianceSummaries');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Filters: '',
NextToken: '',
MaxResults: ''
});
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=AmazonSSM.ListResourceComplianceSummaries',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Filters: '', NextToken: '', MaxResults: ''}
};
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=AmazonSSM.ListResourceComplianceSummaries';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Filters":"","NextToken":"","MaxResults":""}'
};
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 = @{ @"Filters": @"",
@"NextToken": @"",
@"MaxResults": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListResourceComplianceSummaries"]
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=AmazonSSM.ListResourceComplianceSummaries" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListResourceComplianceSummaries",
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([
'Filters' => '',
'NextToken' => '',
'MaxResults' => ''
]),
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=AmazonSSM.ListResourceComplianceSummaries', [
'body' => '{
"Filters": "",
"NextToken": "",
"MaxResults": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListResourceComplianceSummaries');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Filters' => '',
'NextToken' => '',
'MaxResults' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Filters' => '',
'NextToken' => '',
'MaxResults' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListResourceComplianceSummaries');
$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=AmazonSSM.ListResourceComplianceSummaries' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Filters": "",
"NextToken": "",
"MaxResults": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListResourceComplianceSummaries' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Filters": "",
"NextToken": "",
"MaxResults": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.ListResourceComplianceSummaries"
payload = {
"Filters": "",
"NextToken": "",
"MaxResults": ""
}
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=AmazonSSM.ListResourceComplianceSummaries"
payload <- "{\n \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.ListResourceComplianceSummaries")
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 \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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 \"Filters\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.ListResourceComplianceSummaries";
let payload = json!({
"Filters": "",
"NextToken": "",
"MaxResults": ""
});
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=AmazonSSM.ListResourceComplianceSummaries' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Filters": "",
"NextToken": "",
"MaxResults": ""
}'
echo '{
"Filters": "",
"NextToken": "",
"MaxResults": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListResourceComplianceSummaries' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Filters": "",\n "NextToken": "",\n "MaxResults": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListResourceComplianceSummaries'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Filters": "",
"NextToken": "",
"MaxResults": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListResourceComplianceSummaries")! 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
ListResourceDataSync
{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListResourceDataSync
HEADERS
X-Amz-Target
BODY json
{
"SyncType": "",
"NextToken": "",
"MaxResults": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListResourceDataSync");
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 \"SyncType\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListResourceDataSync" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:SyncType ""
:NextToken ""
:MaxResults ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListResourceDataSync"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"SyncType\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.ListResourceDataSync"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"SyncType\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.ListResourceDataSync");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"SyncType\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListResourceDataSync"
payload := strings.NewReader("{\n \"SyncType\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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
{
"SyncType": "",
"NextToken": "",
"MaxResults": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListResourceDataSync")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"SyncType\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListResourceDataSync"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"SyncType\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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 \"SyncType\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListResourceDataSync")
.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=AmazonSSM.ListResourceDataSync")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"SyncType\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.asString();
const data = JSON.stringify({
SyncType: '',
NextToken: '',
MaxResults: ''
});
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=AmazonSSM.ListResourceDataSync');
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=AmazonSSM.ListResourceDataSync',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {SyncType: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListResourceDataSync';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"SyncType":"","NextToken":"","MaxResults":""}'
};
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=AmazonSSM.ListResourceDataSync',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "SyncType": "",\n "NextToken": "",\n "MaxResults": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"SyncType\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListResourceDataSync")
.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({SyncType: '', NextToken: '', MaxResults: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListResourceDataSync',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {SyncType: '', NextToken: '', MaxResults: ''},
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=AmazonSSM.ListResourceDataSync');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
SyncType: '',
NextToken: '',
MaxResults: ''
});
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=AmazonSSM.ListResourceDataSync',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {SyncType: '', NextToken: '', MaxResults: ''}
};
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=AmazonSSM.ListResourceDataSync';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"SyncType":"","NextToken":"","MaxResults":""}'
};
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 = @{ @"SyncType": @"",
@"NextToken": @"",
@"MaxResults": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListResourceDataSync"]
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=AmazonSSM.ListResourceDataSync" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"SyncType\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListResourceDataSync",
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([
'SyncType' => '',
'NextToken' => '',
'MaxResults' => ''
]),
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=AmazonSSM.ListResourceDataSync', [
'body' => '{
"SyncType": "",
"NextToken": "",
"MaxResults": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListResourceDataSync');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'SyncType' => '',
'NextToken' => '',
'MaxResults' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'SyncType' => '',
'NextToken' => '',
'MaxResults' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListResourceDataSync');
$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=AmazonSSM.ListResourceDataSync' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SyncType": "",
"NextToken": "",
"MaxResults": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListResourceDataSync' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SyncType": "",
"NextToken": "",
"MaxResults": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"SyncType\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.ListResourceDataSync"
payload = {
"SyncType": "",
"NextToken": "",
"MaxResults": ""
}
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=AmazonSSM.ListResourceDataSync"
payload <- "{\n \"SyncType\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.ListResourceDataSync")
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 \"SyncType\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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 \"SyncType\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\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=AmazonSSM.ListResourceDataSync";
let payload = json!({
"SyncType": "",
"NextToken": "",
"MaxResults": ""
});
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=AmazonSSM.ListResourceDataSync' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"SyncType": "",
"NextToken": "",
"MaxResults": ""
}'
echo '{
"SyncType": "",
"NextToken": "",
"MaxResults": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListResourceDataSync' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "SyncType": "",\n "NextToken": "",\n "MaxResults": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListResourceDataSync'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"SyncType": "",
"NextToken": "",
"MaxResults": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListResourceDataSync")! 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=AmazonSSM.ListTagsForResource
HEADERS
X-Amz-Target
BODY json
{
"ResourceType": "",
"ResourceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.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 \"ResourceType\": \"\",\n \"ResourceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListTagsForResource" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ResourceType ""
:ResourceId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListTagsForResource"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ResourceType\": \"\",\n \"ResourceId\": \"\"\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=AmazonSSM.ListTagsForResource"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ResourceType\": \"\",\n \"ResourceId\": \"\"\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=AmazonSSM.ListTagsForResource");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ResourceType\": \"\",\n \"ResourceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListTagsForResource"
payload := strings.NewReader("{\n \"ResourceType\": \"\",\n \"ResourceId\": \"\"\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: 44
{
"ResourceType": "",
"ResourceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListTagsForResource")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ResourceType\": \"\",\n \"ResourceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListTagsForResource"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ResourceType\": \"\",\n \"ResourceId\": \"\"\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 \"ResourceType\": \"\",\n \"ResourceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.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=AmazonSSM.ListTagsForResource")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ResourceType\": \"\",\n \"ResourceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
ResourceType: '',
ResourceId: ''
});
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=AmazonSSM.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=AmazonSSM.ListTagsForResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ResourceType: '', ResourceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListTagsForResource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ResourceType":"","ResourceId":""}'
};
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=AmazonSSM.ListTagsForResource',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ResourceType": "",\n "ResourceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ResourceType\": \"\",\n \"ResourceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.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({ResourceType: '', ResourceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListTagsForResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {ResourceType: '', ResourceId: ''},
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=AmazonSSM.ListTagsForResource');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ResourceType: '',
ResourceId: ''
});
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=AmazonSSM.ListTagsForResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ResourceType: '', ResourceId: ''}
};
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=AmazonSSM.ListTagsForResource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ResourceType":"","ResourceId":""}'
};
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 = @{ @"ResourceType": @"",
@"ResourceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.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=AmazonSSM.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 \"ResourceType\": \"\",\n \"ResourceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.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([
'ResourceType' => '',
'ResourceId' => ''
]),
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=AmazonSSM.ListTagsForResource', [
'body' => '{
"ResourceType": "",
"ResourceId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListTagsForResource');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ResourceType' => '',
'ResourceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ResourceType' => '',
'ResourceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.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=AmazonSSM.ListTagsForResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ResourceType": "",
"ResourceId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListTagsForResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ResourceType": "",
"ResourceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ResourceType\": \"\",\n \"ResourceId\": \"\"\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=AmazonSSM.ListTagsForResource"
payload = {
"ResourceType": "",
"ResourceId": ""
}
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=AmazonSSM.ListTagsForResource"
payload <- "{\n \"ResourceType\": \"\",\n \"ResourceId\": \"\"\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=AmazonSSM.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 \"ResourceType\": \"\",\n \"ResourceId\": \"\"\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 \"ResourceType\": \"\",\n \"ResourceId\": \"\"\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=AmazonSSM.ListTagsForResource";
let payload = json!({
"ResourceType": "",
"ResourceId": ""
});
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=AmazonSSM.ListTagsForResource' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ResourceType": "",
"ResourceId": ""
}'
echo '{
"ResourceType": "",
"ResourceId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListTagsForResource' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ResourceType": "",\n "ResourceId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ListTagsForResource'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"ResourceType": "",
"ResourceId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.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
ModifyDocumentPermission
{{baseUrl}}/#X-Amz-Target=AmazonSSM.ModifyDocumentPermission
HEADERS
X-Amz-Target
BODY json
{
"Name": "",
"PermissionType": "",
"AccountIdsToAdd": "",
"AccountIdsToRemove": "",
"SharedDocumentVersion": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ModifyDocumentPermission");
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 \"PermissionType\": \"\",\n \"AccountIdsToAdd\": \"\",\n \"AccountIdsToRemove\": \"\",\n \"SharedDocumentVersion\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ModifyDocumentPermission" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Name ""
:PermissionType ""
:AccountIdsToAdd ""
:AccountIdsToRemove ""
:SharedDocumentVersion ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ModifyDocumentPermission"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Name\": \"\",\n \"PermissionType\": \"\",\n \"AccountIdsToAdd\": \"\",\n \"AccountIdsToRemove\": \"\",\n \"SharedDocumentVersion\": \"\"\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=AmazonSSM.ModifyDocumentPermission"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Name\": \"\",\n \"PermissionType\": \"\",\n \"AccountIdsToAdd\": \"\",\n \"AccountIdsToRemove\": \"\",\n \"SharedDocumentVersion\": \"\"\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=AmazonSSM.ModifyDocumentPermission");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Name\": \"\",\n \"PermissionType\": \"\",\n \"AccountIdsToAdd\": \"\",\n \"AccountIdsToRemove\": \"\",\n \"SharedDocumentVersion\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ModifyDocumentPermission"
payload := strings.NewReader("{\n \"Name\": \"\",\n \"PermissionType\": \"\",\n \"AccountIdsToAdd\": \"\",\n \"AccountIdsToRemove\": \"\",\n \"SharedDocumentVersion\": \"\"\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: 124
{
"Name": "",
"PermissionType": "",
"AccountIdsToAdd": "",
"AccountIdsToRemove": "",
"SharedDocumentVersion": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ModifyDocumentPermission")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Name\": \"\",\n \"PermissionType\": \"\",\n \"AccountIdsToAdd\": \"\",\n \"AccountIdsToRemove\": \"\",\n \"SharedDocumentVersion\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ModifyDocumentPermission"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Name\": \"\",\n \"PermissionType\": \"\",\n \"AccountIdsToAdd\": \"\",\n \"AccountIdsToRemove\": \"\",\n \"SharedDocumentVersion\": \"\"\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 \"PermissionType\": \"\",\n \"AccountIdsToAdd\": \"\",\n \"AccountIdsToRemove\": \"\",\n \"SharedDocumentVersion\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ModifyDocumentPermission")
.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=AmazonSSM.ModifyDocumentPermission")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Name\": \"\",\n \"PermissionType\": \"\",\n \"AccountIdsToAdd\": \"\",\n \"AccountIdsToRemove\": \"\",\n \"SharedDocumentVersion\": \"\"\n}")
.asString();
const data = JSON.stringify({
Name: '',
PermissionType: '',
AccountIdsToAdd: '',
AccountIdsToRemove: '',
SharedDocumentVersion: ''
});
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=AmazonSSM.ModifyDocumentPermission');
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=AmazonSSM.ModifyDocumentPermission',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Name: '',
PermissionType: '',
AccountIdsToAdd: '',
AccountIdsToRemove: '',
SharedDocumentVersion: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ModifyDocumentPermission';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","PermissionType":"","AccountIdsToAdd":"","AccountIdsToRemove":"","SharedDocumentVersion":""}'
};
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=AmazonSSM.ModifyDocumentPermission',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Name": "",\n "PermissionType": "",\n "AccountIdsToAdd": "",\n "AccountIdsToRemove": "",\n "SharedDocumentVersion": ""\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 \"PermissionType\": \"\",\n \"AccountIdsToAdd\": \"\",\n \"AccountIdsToRemove\": \"\",\n \"SharedDocumentVersion\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ModifyDocumentPermission")
.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: '',
PermissionType: '',
AccountIdsToAdd: '',
AccountIdsToRemove: '',
SharedDocumentVersion: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ModifyDocumentPermission',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
Name: '',
PermissionType: '',
AccountIdsToAdd: '',
AccountIdsToRemove: '',
SharedDocumentVersion: ''
},
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=AmazonSSM.ModifyDocumentPermission');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Name: '',
PermissionType: '',
AccountIdsToAdd: '',
AccountIdsToRemove: '',
SharedDocumentVersion: ''
});
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=AmazonSSM.ModifyDocumentPermission',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Name: '',
PermissionType: '',
AccountIdsToAdd: '',
AccountIdsToRemove: '',
SharedDocumentVersion: ''
}
};
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=AmazonSSM.ModifyDocumentPermission';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","PermissionType":"","AccountIdsToAdd":"","AccountIdsToRemove":"","SharedDocumentVersion":""}'
};
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": @"",
@"PermissionType": @"",
@"AccountIdsToAdd": @"",
@"AccountIdsToRemove": @"",
@"SharedDocumentVersion": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.ModifyDocumentPermission"]
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=AmazonSSM.ModifyDocumentPermission" 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 \"PermissionType\": \"\",\n \"AccountIdsToAdd\": \"\",\n \"AccountIdsToRemove\": \"\",\n \"SharedDocumentVersion\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.ModifyDocumentPermission",
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' => '',
'PermissionType' => '',
'AccountIdsToAdd' => '',
'AccountIdsToRemove' => '',
'SharedDocumentVersion' => ''
]),
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=AmazonSSM.ModifyDocumentPermission', [
'body' => '{
"Name": "",
"PermissionType": "",
"AccountIdsToAdd": "",
"AccountIdsToRemove": "",
"SharedDocumentVersion": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.ModifyDocumentPermission');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Name' => '',
'PermissionType' => '',
'AccountIdsToAdd' => '',
'AccountIdsToRemove' => '',
'SharedDocumentVersion' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Name' => '',
'PermissionType' => '',
'AccountIdsToAdd' => '',
'AccountIdsToRemove' => '',
'SharedDocumentVersion' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.ModifyDocumentPermission');
$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=AmazonSSM.ModifyDocumentPermission' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"PermissionType": "",
"AccountIdsToAdd": "",
"AccountIdsToRemove": "",
"SharedDocumentVersion": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ModifyDocumentPermission' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"PermissionType": "",
"AccountIdsToAdd": "",
"AccountIdsToRemove": "",
"SharedDocumentVersion": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Name\": \"\",\n \"PermissionType\": \"\",\n \"AccountIdsToAdd\": \"\",\n \"AccountIdsToRemove\": \"\",\n \"SharedDocumentVersion\": \"\"\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=AmazonSSM.ModifyDocumentPermission"
payload = {
"Name": "",
"PermissionType": "",
"AccountIdsToAdd": "",
"AccountIdsToRemove": "",
"SharedDocumentVersion": ""
}
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=AmazonSSM.ModifyDocumentPermission"
payload <- "{\n \"Name\": \"\",\n \"PermissionType\": \"\",\n \"AccountIdsToAdd\": \"\",\n \"AccountIdsToRemove\": \"\",\n \"SharedDocumentVersion\": \"\"\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=AmazonSSM.ModifyDocumentPermission")
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 \"PermissionType\": \"\",\n \"AccountIdsToAdd\": \"\",\n \"AccountIdsToRemove\": \"\",\n \"SharedDocumentVersion\": \"\"\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 \"PermissionType\": \"\",\n \"AccountIdsToAdd\": \"\",\n \"AccountIdsToRemove\": \"\",\n \"SharedDocumentVersion\": \"\"\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=AmazonSSM.ModifyDocumentPermission";
let payload = json!({
"Name": "",
"PermissionType": "",
"AccountIdsToAdd": "",
"AccountIdsToRemove": "",
"SharedDocumentVersion": ""
});
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=AmazonSSM.ModifyDocumentPermission' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Name": "",
"PermissionType": "",
"AccountIdsToAdd": "",
"AccountIdsToRemove": "",
"SharedDocumentVersion": ""
}'
echo '{
"Name": "",
"PermissionType": "",
"AccountIdsToAdd": "",
"AccountIdsToRemove": "",
"SharedDocumentVersion": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ModifyDocumentPermission' \
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 "PermissionType": "",\n "AccountIdsToAdd": "",\n "AccountIdsToRemove": "",\n "SharedDocumentVersion": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ModifyDocumentPermission'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Name": "",
"PermissionType": "",
"AccountIdsToAdd": "",
"AccountIdsToRemove": "",
"SharedDocumentVersion": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ModifyDocumentPermission")! 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
PutComplianceItems
{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutComplianceItems
HEADERS
X-Amz-Target
BODY json
{
"ResourceId": "",
"ResourceType": "",
"ComplianceType": "",
"ExecutionSummary": "",
"Items": "",
"ItemContentHash": "",
"UploadType": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutComplianceItems");
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 \"ResourceType\": \"\",\n \"ComplianceType\": \"\",\n \"ExecutionSummary\": \"\",\n \"Items\": \"\",\n \"ItemContentHash\": \"\",\n \"UploadType\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutComplianceItems" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ResourceId ""
:ResourceType ""
:ComplianceType ""
:ExecutionSummary ""
:Items ""
:ItemContentHash ""
:UploadType ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutComplianceItems"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ResourceId\": \"\",\n \"ResourceType\": \"\",\n \"ComplianceType\": \"\",\n \"ExecutionSummary\": \"\",\n \"Items\": \"\",\n \"ItemContentHash\": \"\",\n \"UploadType\": \"\"\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=AmazonSSM.PutComplianceItems"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ResourceId\": \"\",\n \"ResourceType\": \"\",\n \"ComplianceType\": \"\",\n \"ExecutionSummary\": \"\",\n \"Items\": \"\",\n \"ItemContentHash\": \"\",\n \"UploadType\": \"\"\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=AmazonSSM.PutComplianceItems");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ResourceId\": \"\",\n \"ResourceType\": \"\",\n \"ComplianceType\": \"\",\n \"ExecutionSummary\": \"\",\n \"Items\": \"\",\n \"ItemContentHash\": \"\",\n \"UploadType\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutComplianceItems"
payload := strings.NewReader("{\n \"ResourceId\": \"\",\n \"ResourceType\": \"\",\n \"ComplianceType\": \"\",\n \"ExecutionSummary\": \"\",\n \"Items\": \"\",\n \"ItemContentHash\": \"\",\n \"UploadType\": \"\"\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: 154
{
"ResourceId": "",
"ResourceType": "",
"ComplianceType": "",
"ExecutionSummary": "",
"Items": "",
"ItemContentHash": "",
"UploadType": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutComplianceItems")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ResourceId\": \"\",\n \"ResourceType\": \"\",\n \"ComplianceType\": \"\",\n \"ExecutionSummary\": \"\",\n \"Items\": \"\",\n \"ItemContentHash\": \"\",\n \"UploadType\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutComplianceItems"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ResourceId\": \"\",\n \"ResourceType\": \"\",\n \"ComplianceType\": \"\",\n \"ExecutionSummary\": \"\",\n \"Items\": \"\",\n \"ItemContentHash\": \"\",\n \"UploadType\": \"\"\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 \"ResourceType\": \"\",\n \"ComplianceType\": \"\",\n \"ExecutionSummary\": \"\",\n \"Items\": \"\",\n \"ItemContentHash\": \"\",\n \"UploadType\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutComplianceItems")
.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=AmazonSSM.PutComplianceItems")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ResourceId\": \"\",\n \"ResourceType\": \"\",\n \"ComplianceType\": \"\",\n \"ExecutionSummary\": \"\",\n \"Items\": \"\",\n \"ItemContentHash\": \"\",\n \"UploadType\": \"\"\n}")
.asString();
const data = JSON.stringify({
ResourceId: '',
ResourceType: '',
ComplianceType: '',
ExecutionSummary: '',
Items: '',
ItemContentHash: '',
UploadType: ''
});
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=AmazonSSM.PutComplianceItems');
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=AmazonSSM.PutComplianceItems',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
ResourceId: '',
ResourceType: '',
ComplianceType: '',
ExecutionSummary: '',
Items: '',
ItemContentHash: '',
UploadType: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutComplianceItems';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ResourceId":"","ResourceType":"","ComplianceType":"","ExecutionSummary":"","Items":"","ItemContentHash":"","UploadType":""}'
};
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=AmazonSSM.PutComplianceItems',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ResourceId": "",\n "ResourceType": "",\n "ComplianceType": "",\n "ExecutionSummary": "",\n "Items": "",\n "ItemContentHash": "",\n "UploadType": ""\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 \"ResourceType\": \"\",\n \"ComplianceType\": \"\",\n \"ExecutionSummary\": \"\",\n \"Items\": \"\",\n \"ItemContentHash\": \"\",\n \"UploadType\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutComplianceItems")
.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: '',
ResourceType: '',
ComplianceType: '',
ExecutionSummary: '',
Items: '',
ItemContentHash: '',
UploadType: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutComplianceItems',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
ResourceId: '',
ResourceType: '',
ComplianceType: '',
ExecutionSummary: '',
Items: '',
ItemContentHash: '',
UploadType: ''
},
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=AmazonSSM.PutComplianceItems');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ResourceId: '',
ResourceType: '',
ComplianceType: '',
ExecutionSummary: '',
Items: '',
ItemContentHash: '',
UploadType: ''
});
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=AmazonSSM.PutComplianceItems',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
ResourceId: '',
ResourceType: '',
ComplianceType: '',
ExecutionSummary: '',
Items: '',
ItemContentHash: '',
UploadType: ''
}
};
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=AmazonSSM.PutComplianceItems';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ResourceId":"","ResourceType":"","ComplianceType":"","ExecutionSummary":"","Items":"","ItemContentHash":"","UploadType":""}'
};
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": @"",
@"ResourceType": @"",
@"ComplianceType": @"",
@"ExecutionSummary": @"",
@"Items": @"",
@"ItemContentHash": @"",
@"UploadType": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutComplianceItems"]
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=AmazonSSM.PutComplianceItems" 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 \"ResourceType\": \"\",\n \"ComplianceType\": \"\",\n \"ExecutionSummary\": \"\",\n \"Items\": \"\",\n \"ItemContentHash\": \"\",\n \"UploadType\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutComplianceItems",
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' => '',
'ResourceType' => '',
'ComplianceType' => '',
'ExecutionSummary' => '',
'Items' => '',
'ItemContentHash' => '',
'UploadType' => ''
]),
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=AmazonSSM.PutComplianceItems', [
'body' => '{
"ResourceId": "",
"ResourceType": "",
"ComplianceType": "",
"ExecutionSummary": "",
"Items": "",
"ItemContentHash": "",
"UploadType": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutComplianceItems');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ResourceId' => '',
'ResourceType' => '',
'ComplianceType' => '',
'ExecutionSummary' => '',
'Items' => '',
'ItemContentHash' => '',
'UploadType' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ResourceId' => '',
'ResourceType' => '',
'ComplianceType' => '',
'ExecutionSummary' => '',
'Items' => '',
'ItemContentHash' => '',
'UploadType' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutComplianceItems');
$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=AmazonSSM.PutComplianceItems' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ResourceId": "",
"ResourceType": "",
"ComplianceType": "",
"ExecutionSummary": "",
"Items": "",
"ItemContentHash": "",
"UploadType": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutComplianceItems' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ResourceId": "",
"ResourceType": "",
"ComplianceType": "",
"ExecutionSummary": "",
"Items": "",
"ItemContentHash": "",
"UploadType": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ResourceId\": \"\",\n \"ResourceType\": \"\",\n \"ComplianceType\": \"\",\n \"ExecutionSummary\": \"\",\n \"Items\": \"\",\n \"ItemContentHash\": \"\",\n \"UploadType\": \"\"\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=AmazonSSM.PutComplianceItems"
payload = {
"ResourceId": "",
"ResourceType": "",
"ComplianceType": "",
"ExecutionSummary": "",
"Items": "",
"ItemContentHash": "",
"UploadType": ""
}
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=AmazonSSM.PutComplianceItems"
payload <- "{\n \"ResourceId\": \"\",\n \"ResourceType\": \"\",\n \"ComplianceType\": \"\",\n \"ExecutionSummary\": \"\",\n \"Items\": \"\",\n \"ItemContentHash\": \"\",\n \"UploadType\": \"\"\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=AmazonSSM.PutComplianceItems")
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 \"ResourceType\": \"\",\n \"ComplianceType\": \"\",\n \"ExecutionSummary\": \"\",\n \"Items\": \"\",\n \"ItemContentHash\": \"\",\n \"UploadType\": \"\"\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 \"ResourceType\": \"\",\n \"ComplianceType\": \"\",\n \"ExecutionSummary\": \"\",\n \"Items\": \"\",\n \"ItemContentHash\": \"\",\n \"UploadType\": \"\"\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=AmazonSSM.PutComplianceItems";
let payload = json!({
"ResourceId": "",
"ResourceType": "",
"ComplianceType": "",
"ExecutionSummary": "",
"Items": "",
"ItemContentHash": "",
"UploadType": ""
});
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=AmazonSSM.PutComplianceItems' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ResourceId": "",
"ResourceType": "",
"ComplianceType": "",
"ExecutionSummary": "",
"Items": "",
"ItemContentHash": "",
"UploadType": ""
}'
echo '{
"ResourceId": "",
"ResourceType": "",
"ComplianceType": "",
"ExecutionSummary": "",
"Items": "",
"ItemContentHash": "",
"UploadType": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutComplianceItems' \
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 "ResourceType": "",\n "ComplianceType": "",\n "ExecutionSummary": "",\n "Items": "",\n "ItemContentHash": "",\n "UploadType": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutComplianceItems'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"ResourceId": "",
"ResourceType": "",
"ComplianceType": "",
"ExecutionSummary": "",
"Items": "",
"ItemContentHash": "",
"UploadType": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutComplianceItems")! 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
PutInventory
{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutInventory
HEADERS
X-Amz-Target
BODY json
{
"InstanceId": "",
"Items": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutInventory");
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 \"InstanceId\": \"\",\n \"Items\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutInventory" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:InstanceId ""
:Items ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutInventory"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"InstanceId\": \"\",\n \"Items\": \"\"\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=AmazonSSM.PutInventory"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"InstanceId\": \"\",\n \"Items\": \"\"\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=AmazonSSM.PutInventory");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"InstanceId\": \"\",\n \"Items\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutInventory"
payload := strings.NewReader("{\n \"InstanceId\": \"\",\n \"Items\": \"\"\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
{
"InstanceId": "",
"Items": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutInventory")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"InstanceId\": \"\",\n \"Items\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutInventory"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"InstanceId\": \"\",\n \"Items\": \"\"\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 \"InstanceId\": \"\",\n \"Items\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutInventory")
.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=AmazonSSM.PutInventory")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"InstanceId\": \"\",\n \"Items\": \"\"\n}")
.asString();
const data = JSON.stringify({
InstanceId: '',
Items: ''
});
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=AmazonSSM.PutInventory');
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=AmazonSSM.PutInventory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: '', Items: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutInventory';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":"","Items":""}'
};
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=AmazonSSM.PutInventory',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "InstanceId": "",\n "Items": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"InstanceId\": \"\",\n \"Items\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutInventory")
.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({InstanceId: '', Items: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutInventory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {InstanceId: '', Items: ''},
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=AmazonSSM.PutInventory');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
InstanceId: '',
Items: ''
});
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=AmazonSSM.PutInventory',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: '', Items: ''}
};
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=AmazonSSM.PutInventory';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":"","Items":""}'
};
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 = @{ @"InstanceId": @"",
@"Items": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutInventory"]
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=AmazonSSM.PutInventory" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"InstanceId\": \"\",\n \"Items\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutInventory",
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([
'InstanceId' => '',
'Items' => ''
]),
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=AmazonSSM.PutInventory', [
'body' => '{
"InstanceId": "",
"Items": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutInventory');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'InstanceId' => '',
'Items' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'InstanceId' => '',
'Items' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutInventory');
$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=AmazonSSM.PutInventory' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": "",
"Items": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutInventory' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": "",
"Items": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"InstanceId\": \"\",\n \"Items\": \"\"\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=AmazonSSM.PutInventory"
payload = {
"InstanceId": "",
"Items": ""
}
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=AmazonSSM.PutInventory"
payload <- "{\n \"InstanceId\": \"\",\n \"Items\": \"\"\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=AmazonSSM.PutInventory")
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 \"InstanceId\": \"\",\n \"Items\": \"\"\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 \"InstanceId\": \"\",\n \"Items\": \"\"\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=AmazonSSM.PutInventory";
let payload = json!({
"InstanceId": "",
"Items": ""
});
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=AmazonSSM.PutInventory' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"InstanceId": "",
"Items": ""
}'
echo '{
"InstanceId": "",
"Items": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutInventory' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "InstanceId": "",\n "Items": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutInventory'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"InstanceId": "",
"Items": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutInventory")! 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
PutParameter
{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutParameter
HEADERS
X-Amz-Target
BODY json
{
"Name": "",
"Description": "",
"Value": "",
"Type": "",
"KeyId": "",
"Overwrite": "",
"AllowedPattern": "",
"Tags": "",
"Tier": "",
"Policies": "",
"DataType": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutParameter");
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 \"Description\": \"\",\n \"Value\": \"\",\n \"Type\": \"\",\n \"KeyId\": \"\",\n \"Overwrite\": \"\",\n \"AllowedPattern\": \"\",\n \"Tags\": \"\",\n \"Tier\": \"\",\n \"Policies\": \"\",\n \"DataType\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutParameter" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Name ""
:Description ""
:Value ""
:Type ""
:KeyId ""
:Overwrite ""
:AllowedPattern ""
:Tags ""
:Tier ""
:Policies ""
:DataType ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutParameter"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Name\": \"\",\n \"Description\": \"\",\n \"Value\": \"\",\n \"Type\": \"\",\n \"KeyId\": \"\",\n \"Overwrite\": \"\",\n \"AllowedPattern\": \"\",\n \"Tags\": \"\",\n \"Tier\": \"\",\n \"Policies\": \"\",\n \"DataType\": \"\"\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=AmazonSSM.PutParameter"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Name\": \"\",\n \"Description\": \"\",\n \"Value\": \"\",\n \"Type\": \"\",\n \"KeyId\": \"\",\n \"Overwrite\": \"\",\n \"AllowedPattern\": \"\",\n \"Tags\": \"\",\n \"Tier\": \"\",\n \"Policies\": \"\",\n \"DataType\": \"\"\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=AmazonSSM.PutParameter");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Name\": \"\",\n \"Description\": \"\",\n \"Value\": \"\",\n \"Type\": \"\",\n \"KeyId\": \"\",\n \"Overwrite\": \"\",\n \"AllowedPattern\": \"\",\n \"Tags\": \"\",\n \"Tier\": \"\",\n \"Policies\": \"\",\n \"DataType\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutParameter"
payload := strings.NewReader("{\n \"Name\": \"\",\n \"Description\": \"\",\n \"Value\": \"\",\n \"Type\": \"\",\n \"KeyId\": \"\",\n \"Overwrite\": \"\",\n \"AllowedPattern\": \"\",\n \"Tags\": \"\",\n \"Tier\": \"\",\n \"Policies\": \"\",\n \"DataType\": \"\"\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: 188
{
"Name": "",
"Description": "",
"Value": "",
"Type": "",
"KeyId": "",
"Overwrite": "",
"AllowedPattern": "",
"Tags": "",
"Tier": "",
"Policies": "",
"DataType": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutParameter")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Name\": \"\",\n \"Description\": \"\",\n \"Value\": \"\",\n \"Type\": \"\",\n \"KeyId\": \"\",\n \"Overwrite\": \"\",\n \"AllowedPattern\": \"\",\n \"Tags\": \"\",\n \"Tier\": \"\",\n \"Policies\": \"\",\n \"DataType\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutParameter"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Name\": \"\",\n \"Description\": \"\",\n \"Value\": \"\",\n \"Type\": \"\",\n \"KeyId\": \"\",\n \"Overwrite\": \"\",\n \"AllowedPattern\": \"\",\n \"Tags\": \"\",\n \"Tier\": \"\",\n \"Policies\": \"\",\n \"DataType\": \"\"\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 \"Description\": \"\",\n \"Value\": \"\",\n \"Type\": \"\",\n \"KeyId\": \"\",\n \"Overwrite\": \"\",\n \"AllowedPattern\": \"\",\n \"Tags\": \"\",\n \"Tier\": \"\",\n \"Policies\": \"\",\n \"DataType\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutParameter")
.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=AmazonSSM.PutParameter")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Name\": \"\",\n \"Description\": \"\",\n \"Value\": \"\",\n \"Type\": \"\",\n \"KeyId\": \"\",\n \"Overwrite\": \"\",\n \"AllowedPattern\": \"\",\n \"Tags\": \"\",\n \"Tier\": \"\",\n \"Policies\": \"\",\n \"DataType\": \"\"\n}")
.asString();
const data = JSON.stringify({
Name: '',
Description: '',
Value: '',
Type: '',
KeyId: '',
Overwrite: '',
AllowedPattern: '',
Tags: '',
Tier: '',
Policies: '',
DataType: ''
});
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=AmazonSSM.PutParameter');
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=AmazonSSM.PutParameter',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Name: '',
Description: '',
Value: '',
Type: '',
KeyId: '',
Overwrite: '',
AllowedPattern: '',
Tags: '',
Tier: '',
Policies: '',
DataType: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutParameter';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","Description":"","Value":"","Type":"","KeyId":"","Overwrite":"","AllowedPattern":"","Tags":"","Tier":"","Policies":"","DataType":""}'
};
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=AmazonSSM.PutParameter',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Name": "",\n "Description": "",\n "Value": "",\n "Type": "",\n "KeyId": "",\n "Overwrite": "",\n "AllowedPattern": "",\n "Tags": "",\n "Tier": "",\n "Policies": "",\n "DataType": ""\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 \"Description\": \"\",\n \"Value\": \"\",\n \"Type\": \"\",\n \"KeyId\": \"\",\n \"Overwrite\": \"\",\n \"AllowedPattern\": \"\",\n \"Tags\": \"\",\n \"Tier\": \"\",\n \"Policies\": \"\",\n \"DataType\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutParameter")
.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: '',
Description: '',
Value: '',
Type: '',
KeyId: '',
Overwrite: '',
AllowedPattern: '',
Tags: '',
Tier: '',
Policies: '',
DataType: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutParameter',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
Name: '',
Description: '',
Value: '',
Type: '',
KeyId: '',
Overwrite: '',
AllowedPattern: '',
Tags: '',
Tier: '',
Policies: '',
DataType: ''
},
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=AmazonSSM.PutParameter');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Name: '',
Description: '',
Value: '',
Type: '',
KeyId: '',
Overwrite: '',
AllowedPattern: '',
Tags: '',
Tier: '',
Policies: '',
DataType: ''
});
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=AmazonSSM.PutParameter',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Name: '',
Description: '',
Value: '',
Type: '',
KeyId: '',
Overwrite: '',
AllowedPattern: '',
Tags: '',
Tier: '',
Policies: '',
DataType: ''
}
};
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=AmazonSSM.PutParameter';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","Description":"","Value":"","Type":"","KeyId":"","Overwrite":"","AllowedPattern":"","Tags":"","Tier":"","Policies":"","DataType":""}'
};
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": @"",
@"Description": @"",
@"Value": @"",
@"Type": @"",
@"KeyId": @"",
@"Overwrite": @"",
@"AllowedPattern": @"",
@"Tags": @"",
@"Tier": @"",
@"Policies": @"",
@"DataType": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutParameter"]
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=AmazonSSM.PutParameter" 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 \"Description\": \"\",\n \"Value\": \"\",\n \"Type\": \"\",\n \"KeyId\": \"\",\n \"Overwrite\": \"\",\n \"AllowedPattern\": \"\",\n \"Tags\": \"\",\n \"Tier\": \"\",\n \"Policies\": \"\",\n \"DataType\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutParameter",
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' => '',
'Description' => '',
'Value' => '',
'Type' => '',
'KeyId' => '',
'Overwrite' => '',
'AllowedPattern' => '',
'Tags' => '',
'Tier' => '',
'Policies' => '',
'DataType' => ''
]),
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=AmazonSSM.PutParameter', [
'body' => '{
"Name": "",
"Description": "",
"Value": "",
"Type": "",
"KeyId": "",
"Overwrite": "",
"AllowedPattern": "",
"Tags": "",
"Tier": "",
"Policies": "",
"DataType": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutParameter');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Name' => '',
'Description' => '',
'Value' => '',
'Type' => '',
'KeyId' => '',
'Overwrite' => '',
'AllowedPattern' => '',
'Tags' => '',
'Tier' => '',
'Policies' => '',
'DataType' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Name' => '',
'Description' => '',
'Value' => '',
'Type' => '',
'KeyId' => '',
'Overwrite' => '',
'AllowedPattern' => '',
'Tags' => '',
'Tier' => '',
'Policies' => '',
'DataType' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutParameter');
$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=AmazonSSM.PutParameter' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"Description": "",
"Value": "",
"Type": "",
"KeyId": "",
"Overwrite": "",
"AllowedPattern": "",
"Tags": "",
"Tier": "",
"Policies": "",
"DataType": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutParameter' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"Description": "",
"Value": "",
"Type": "",
"KeyId": "",
"Overwrite": "",
"AllowedPattern": "",
"Tags": "",
"Tier": "",
"Policies": "",
"DataType": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Name\": \"\",\n \"Description\": \"\",\n \"Value\": \"\",\n \"Type\": \"\",\n \"KeyId\": \"\",\n \"Overwrite\": \"\",\n \"AllowedPattern\": \"\",\n \"Tags\": \"\",\n \"Tier\": \"\",\n \"Policies\": \"\",\n \"DataType\": \"\"\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=AmazonSSM.PutParameter"
payload = {
"Name": "",
"Description": "",
"Value": "",
"Type": "",
"KeyId": "",
"Overwrite": "",
"AllowedPattern": "",
"Tags": "",
"Tier": "",
"Policies": "",
"DataType": ""
}
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=AmazonSSM.PutParameter"
payload <- "{\n \"Name\": \"\",\n \"Description\": \"\",\n \"Value\": \"\",\n \"Type\": \"\",\n \"KeyId\": \"\",\n \"Overwrite\": \"\",\n \"AllowedPattern\": \"\",\n \"Tags\": \"\",\n \"Tier\": \"\",\n \"Policies\": \"\",\n \"DataType\": \"\"\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=AmazonSSM.PutParameter")
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 \"Description\": \"\",\n \"Value\": \"\",\n \"Type\": \"\",\n \"KeyId\": \"\",\n \"Overwrite\": \"\",\n \"AllowedPattern\": \"\",\n \"Tags\": \"\",\n \"Tier\": \"\",\n \"Policies\": \"\",\n \"DataType\": \"\"\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 \"Description\": \"\",\n \"Value\": \"\",\n \"Type\": \"\",\n \"KeyId\": \"\",\n \"Overwrite\": \"\",\n \"AllowedPattern\": \"\",\n \"Tags\": \"\",\n \"Tier\": \"\",\n \"Policies\": \"\",\n \"DataType\": \"\"\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=AmazonSSM.PutParameter";
let payload = json!({
"Name": "",
"Description": "",
"Value": "",
"Type": "",
"KeyId": "",
"Overwrite": "",
"AllowedPattern": "",
"Tags": "",
"Tier": "",
"Policies": "",
"DataType": ""
});
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=AmazonSSM.PutParameter' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Name": "",
"Description": "",
"Value": "",
"Type": "",
"KeyId": "",
"Overwrite": "",
"AllowedPattern": "",
"Tags": "",
"Tier": "",
"Policies": "",
"DataType": ""
}'
echo '{
"Name": "",
"Description": "",
"Value": "",
"Type": "",
"KeyId": "",
"Overwrite": "",
"AllowedPattern": "",
"Tags": "",
"Tier": "",
"Policies": "",
"DataType": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutParameter' \
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 "Description": "",\n "Value": "",\n "Type": "",\n "KeyId": "",\n "Overwrite": "",\n "AllowedPattern": "",\n "Tags": "",\n "Tier": "",\n "Policies": "",\n "DataType": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutParameter'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Name": "",
"Description": "",
"Value": "",
"Type": "",
"KeyId": "",
"Overwrite": "",
"AllowedPattern": "",
"Tags": "",
"Tier": "",
"Policies": "",
"DataType": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutParameter")! 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
PutResourcePolicy
{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutResourcePolicy
HEADERS
X-Amz-Target
BODY json
{
"ResourceArn": "",
"Policy": "",
"PolicyId": "",
"PolicyHash": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutResourcePolicy");
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 \"ResourceArn\": \"\",\n \"Policy\": \"\",\n \"PolicyId\": \"\",\n \"PolicyHash\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutResourcePolicy" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ResourceArn ""
:Policy ""
:PolicyId ""
:PolicyHash ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutResourcePolicy"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ResourceArn\": \"\",\n \"Policy\": \"\",\n \"PolicyId\": \"\",\n \"PolicyHash\": \"\"\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=AmazonSSM.PutResourcePolicy"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ResourceArn\": \"\",\n \"Policy\": \"\",\n \"PolicyId\": \"\",\n \"PolicyHash\": \"\"\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=AmazonSSM.PutResourcePolicy");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ResourceArn\": \"\",\n \"Policy\": \"\",\n \"PolicyId\": \"\",\n \"PolicyHash\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutResourcePolicy"
payload := strings.NewReader("{\n \"ResourceArn\": \"\",\n \"Policy\": \"\",\n \"PolicyId\": \"\",\n \"PolicyHash\": \"\"\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: 77
{
"ResourceArn": "",
"Policy": "",
"PolicyId": "",
"PolicyHash": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutResourcePolicy")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ResourceArn\": \"\",\n \"Policy\": \"\",\n \"PolicyId\": \"\",\n \"PolicyHash\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutResourcePolicy"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ResourceArn\": \"\",\n \"Policy\": \"\",\n \"PolicyId\": \"\",\n \"PolicyHash\": \"\"\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 \"ResourceArn\": \"\",\n \"Policy\": \"\",\n \"PolicyId\": \"\",\n \"PolicyHash\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutResourcePolicy")
.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=AmazonSSM.PutResourcePolicy")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ResourceArn\": \"\",\n \"Policy\": \"\",\n \"PolicyId\": \"\",\n \"PolicyHash\": \"\"\n}")
.asString();
const data = JSON.stringify({
ResourceArn: '',
Policy: '',
PolicyId: '',
PolicyHash: ''
});
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=AmazonSSM.PutResourcePolicy');
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=AmazonSSM.PutResourcePolicy',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ResourceArn: '', Policy: '', PolicyId: '', PolicyHash: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutResourcePolicy';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ResourceArn":"","Policy":"","PolicyId":"","PolicyHash":""}'
};
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=AmazonSSM.PutResourcePolicy',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ResourceArn": "",\n "Policy": "",\n "PolicyId": "",\n "PolicyHash": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ResourceArn\": \"\",\n \"Policy\": \"\",\n \"PolicyId\": \"\",\n \"PolicyHash\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutResourcePolicy")
.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({ResourceArn: '', Policy: '', PolicyId: '', PolicyHash: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutResourcePolicy',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {ResourceArn: '', Policy: '', PolicyId: '', PolicyHash: ''},
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=AmazonSSM.PutResourcePolicy');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ResourceArn: '',
Policy: '',
PolicyId: '',
PolicyHash: ''
});
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=AmazonSSM.PutResourcePolicy',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ResourceArn: '', Policy: '', PolicyId: '', PolicyHash: ''}
};
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=AmazonSSM.PutResourcePolicy';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ResourceArn":"","Policy":"","PolicyId":"","PolicyHash":""}'
};
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 = @{ @"ResourceArn": @"",
@"Policy": @"",
@"PolicyId": @"",
@"PolicyHash": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutResourcePolicy"]
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=AmazonSSM.PutResourcePolicy" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"ResourceArn\": \"\",\n \"Policy\": \"\",\n \"PolicyId\": \"\",\n \"PolicyHash\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutResourcePolicy",
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([
'ResourceArn' => '',
'Policy' => '',
'PolicyId' => '',
'PolicyHash' => ''
]),
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=AmazonSSM.PutResourcePolicy', [
'body' => '{
"ResourceArn": "",
"Policy": "",
"PolicyId": "",
"PolicyHash": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutResourcePolicy');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ResourceArn' => '',
'Policy' => '',
'PolicyId' => '',
'PolicyHash' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ResourceArn' => '',
'Policy' => '',
'PolicyId' => '',
'PolicyHash' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutResourcePolicy');
$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=AmazonSSM.PutResourcePolicy' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ResourceArn": "",
"Policy": "",
"PolicyId": "",
"PolicyHash": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutResourcePolicy' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ResourceArn": "",
"Policy": "",
"PolicyId": "",
"PolicyHash": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ResourceArn\": \"\",\n \"Policy\": \"\",\n \"PolicyId\": \"\",\n \"PolicyHash\": \"\"\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=AmazonSSM.PutResourcePolicy"
payload = {
"ResourceArn": "",
"Policy": "",
"PolicyId": "",
"PolicyHash": ""
}
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=AmazonSSM.PutResourcePolicy"
payload <- "{\n \"ResourceArn\": \"\",\n \"Policy\": \"\",\n \"PolicyId\": \"\",\n \"PolicyHash\": \"\"\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=AmazonSSM.PutResourcePolicy")
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 \"ResourceArn\": \"\",\n \"Policy\": \"\",\n \"PolicyId\": \"\",\n \"PolicyHash\": \"\"\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 \"ResourceArn\": \"\",\n \"Policy\": \"\",\n \"PolicyId\": \"\",\n \"PolicyHash\": \"\"\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=AmazonSSM.PutResourcePolicy";
let payload = json!({
"ResourceArn": "",
"Policy": "",
"PolicyId": "",
"PolicyHash": ""
});
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=AmazonSSM.PutResourcePolicy' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ResourceArn": "",
"Policy": "",
"PolicyId": "",
"PolicyHash": ""
}'
echo '{
"ResourceArn": "",
"Policy": "",
"PolicyId": "",
"PolicyHash": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutResourcePolicy' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ResourceArn": "",\n "Policy": "",\n "PolicyId": "",\n "PolicyHash": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutResourcePolicy'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"ResourceArn": "",
"Policy": "",
"PolicyId": "",
"PolicyHash": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.PutResourcePolicy")! 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
RegisterDefaultPatchBaseline
{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterDefaultPatchBaseline
HEADERS
X-Amz-Target
BODY json
{
"BaselineId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterDefaultPatchBaseline");
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 \"BaselineId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterDefaultPatchBaseline" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:BaselineId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterDefaultPatchBaseline"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"BaselineId\": \"\"\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=AmazonSSM.RegisterDefaultPatchBaseline"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"BaselineId\": \"\"\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=AmazonSSM.RegisterDefaultPatchBaseline");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"BaselineId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterDefaultPatchBaseline"
payload := strings.NewReader("{\n \"BaselineId\": \"\"\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
{
"BaselineId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterDefaultPatchBaseline")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"BaselineId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterDefaultPatchBaseline"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"BaselineId\": \"\"\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 \"BaselineId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterDefaultPatchBaseline")
.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=AmazonSSM.RegisterDefaultPatchBaseline")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"BaselineId\": \"\"\n}")
.asString();
const data = JSON.stringify({
BaselineId: ''
});
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=AmazonSSM.RegisterDefaultPatchBaseline');
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=AmazonSSM.RegisterDefaultPatchBaseline',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {BaselineId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterDefaultPatchBaseline';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"BaselineId":""}'
};
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=AmazonSSM.RegisterDefaultPatchBaseline',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "BaselineId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"BaselineId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterDefaultPatchBaseline")
.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({BaselineId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterDefaultPatchBaseline',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {BaselineId: ''},
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=AmazonSSM.RegisterDefaultPatchBaseline');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
BaselineId: ''
});
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=AmazonSSM.RegisterDefaultPatchBaseline',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {BaselineId: ''}
};
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=AmazonSSM.RegisterDefaultPatchBaseline';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"BaselineId":""}'
};
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 = @{ @"BaselineId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterDefaultPatchBaseline"]
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=AmazonSSM.RegisterDefaultPatchBaseline" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"BaselineId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterDefaultPatchBaseline",
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([
'BaselineId' => ''
]),
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=AmazonSSM.RegisterDefaultPatchBaseline', [
'body' => '{
"BaselineId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterDefaultPatchBaseline');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'BaselineId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'BaselineId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterDefaultPatchBaseline');
$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=AmazonSSM.RegisterDefaultPatchBaseline' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"BaselineId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterDefaultPatchBaseline' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"BaselineId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"BaselineId\": \"\"\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=AmazonSSM.RegisterDefaultPatchBaseline"
payload = { "BaselineId": "" }
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=AmazonSSM.RegisterDefaultPatchBaseline"
payload <- "{\n \"BaselineId\": \"\"\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=AmazonSSM.RegisterDefaultPatchBaseline")
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 \"BaselineId\": \"\"\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 \"BaselineId\": \"\"\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=AmazonSSM.RegisterDefaultPatchBaseline";
let payload = json!({"BaselineId": ""});
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=AmazonSSM.RegisterDefaultPatchBaseline' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"BaselineId": ""
}'
echo '{
"BaselineId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterDefaultPatchBaseline' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "BaselineId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterDefaultPatchBaseline'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["BaselineId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterDefaultPatchBaseline")! 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
RegisterPatchBaselineForPatchGroup
{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterPatchBaselineForPatchGroup
HEADERS
X-Amz-Target
BODY json
{
"BaselineId": "",
"PatchGroup": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterPatchBaselineForPatchGroup");
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 \"BaselineId\": \"\",\n \"PatchGroup\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterPatchBaselineForPatchGroup" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:BaselineId ""
:PatchGroup ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterPatchBaselineForPatchGroup"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"BaselineId\": \"\",\n \"PatchGroup\": \"\"\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=AmazonSSM.RegisterPatchBaselineForPatchGroup"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"BaselineId\": \"\",\n \"PatchGroup\": \"\"\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=AmazonSSM.RegisterPatchBaselineForPatchGroup");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"BaselineId\": \"\",\n \"PatchGroup\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterPatchBaselineForPatchGroup"
payload := strings.NewReader("{\n \"BaselineId\": \"\",\n \"PatchGroup\": \"\"\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
{
"BaselineId": "",
"PatchGroup": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterPatchBaselineForPatchGroup")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"BaselineId\": \"\",\n \"PatchGroup\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterPatchBaselineForPatchGroup"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"BaselineId\": \"\",\n \"PatchGroup\": \"\"\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 \"BaselineId\": \"\",\n \"PatchGroup\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterPatchBaselineForPatchGroup")
.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=AmazonSSM.RegisterPatchBaselineForPatchGroup")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"BaselineId\": \"\",\n \"PatchGroup\": \"\"\n}")
.asString();
const data = JSON.stringify({
BaselineId: '',
PatchGroup: ''
});
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=AmazonSSM.RegisterPatchBaselineForPatchGroup');
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=AmazonSSM.RegisterPatchBaselineForPatchGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {BaselineId: '', PatchGroup: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterPatchBaselineForPatchGroup';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"BaselineId":"","PatchGroup":""}'
};
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=AmazonSSM.RegisterPatchBaselineForPatchGroup',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "BaselineId": "",\n "PatchGroup": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"BaselineId\": \"\",\n \"PatchGroup\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterPatchBaselineForPatchGroup")
.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({BaselineId: '', PatchGroup: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterPatchBaselineForPatchGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {BaselineId: '', PatchGroup: ''},
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=AmazonSSM.RegisterPatchBaselineForPatchGroup');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
BaselineId: '',
PatchGroup: ''
});
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=AmazonSSM.RegisterPatchBaselineForPatchGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {BaselineId: '', PatchGroup: ''}
};
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=AmazonSSM.RegisterPatchBaselineForPatchGroup';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"BaselineId":"","PatchGroup":""}'
};
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 = @{ @"BaselineId": @"",
@"PatchGroup": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterPatchBaselineForPatchGroup"]
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=AmazonSSM.RegisterPatchBaselineForPatchGroup" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"BaselineId\": \"\",\n \"PatchGroup\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterPatchBaselineForPatchGroup",
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([
'BaselineId' => '',
'PatchGroup' => ''
]),
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=AmazonSSM.RegisterPatchBaselineForPatchGroup', [
'body' => '{
"BaselineId": "",
"PatchGroup": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterPatchBaselineForPatchGroup');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'BaselineId' => '',
'PatchGroup' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'BaselineId' => '',
'PatchGroup' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterPatchBaselineForPatchGroup');
$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=AmazonSSM.RegisterPatchBaselineForPatchGroup' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"BaselineId": "",
"PatchGroup": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterPatchBaselineForPatchGroup' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"BaselineId": "",
"PatchGroup": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"BaselineId\": \"\",\n \"PatchGroup\": \"\"\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=AmazonSSM.RegisterPatchBaselineForPatchGroup"
payload = {
"BaselineId": "",
"PatchGroup": ""
}
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=AmazonSSM.RegisterPatchBaselineForPatchGroup"
payload <- "{\n \"BaselineId\": \"\",\n \"PatchGroup\": \"\"\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=AmazonSSM.RegisterPatchBaselineForPatchGroup")
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 \"BaselineId\": \"\",\n \"PatchGroup\": \"\"\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 \"BaselineId\": \"\",\n \"PatchGroup\": \"\"\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=AmazonSSM.RegisterPatchBaselineForPatchGroup";
let payload = json!({
"BaselineId": "",
"PatchGroup": ""
});
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=AmazonSSM.RegisterPatchBaselineForPatchGroup' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"BaselineId": "",
"PatchGroup": ""
}'
echo '{
"BaselineId": "",
"PatchGroup": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterPatchBaselineForPatchGroup' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "BaselineId": "",\n "PatchGroup": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterPatchBaselineForPatchGroup'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"BaselineId": "",
"PatchGroup": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterPatchBaselineForPatchGroup")! 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
RegisterTargetWithMaintenanceWindow
{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterTargetWithMaintenanceWindow
HEADERS
X-Amz-Target
BODY json
{
"WindowId": "",
"ResourceType": "",
"Targets": "",
"OwnerInformation": "",
"Name": "",
"Description": "",
"ClientToken": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterTargetWithMaintenanceWindow");
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 \"WindowId\": \"\",\n \"ResourceType\": \"\",\n \"Targets\": \"\",\n \"OwnerInformation\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterTargetWithMaintenanceWindow" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:WindowId ""
:ResourceType ""
:Targets ""
:OwnerInformation ""
:Name ""
:Description ""
:ClientToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterTargetWithMaintenanceWindow"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"WindowId\": \"\",\n \"ResourceType\": \"\",\n \"Targets\": \"\",\n \"OwnerInformation\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\"\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=AmazonSSM.RegisterTargetWithMaintenanceWindow"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"WindowId\": \"\",\n \"ResourceType\": \"\",\n \"Targets\": \"\",\n \"OwnerInformation\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\"\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=AmazonSSM.RegisterTargetWithMaintenanceWindow");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"WindowId\": \"\",\n \"ResourceType\": \"\",\n \"Targets\": \"\",\n \"OwnerInformation\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterTargetWithMaintenanceWindow"
payload := strings.NewReader("{\n \"WindowId\": \"\",\n \"ResourceType\": \"\",\n \"Targets\": \"\",\n \"OwnerInformation\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\"\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: 141
{
"WindowId": "",
"ResourceType": "",
"Targets": "",
"OwnerInformation": "",
"Name": "",
"Description": "",
"ClientToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterTargetWithMaintenanceWindow")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"WindowId\": \"\",\n \"ResourceType\": \"\",\n \"Targets\": \"\",\n \"OwnerInformation\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterTargetWithMaintenanceWindow"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"WindowId\": \"\",\n \"ResourceType\": \"\",\n \"Targets\": \"\",\n \"OwnerInformation\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\"\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 \"WindowId\": \"\",\n \"ResourceType\": \"\",\n \"Targets\": \"\",\n \"OwnerInformation\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterTargetWithMaintenanceWindow")
.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=AmazonSSM.RegisterTargetWithMaintenanceWindow")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"WindowId\": \"\",\n \"ResourceType\": \"\",\n \"Targets\": \"\",\n \"OwnerInformation\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
WindowId: '',
ResourceType: '',
Targets: '',
OwnerInformation: '',
Name: '',
Description: '',
ClientToken: ''
});
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=AmazonSSM.RegisterTargetWithMaintenanceWindow');
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=AmazonSSM.RegisterTargetWithMaintenanceWindow',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
WindowId: '',
ResourceType: '',
Targets: '',
OwnerInformation: '',
Name: '',
Description: '',
ClientToken: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterTargetWithMaintenanceWindow';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowId":"","ResourceType":"","Targets":"","OwnerInformation":"","Name":"","Description":"","ClientToken":""}'
};
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=AmazonSSM.RegisterTargetWithMaintenanceWindow',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "WindowId": "",\n "ResourceType": "",\n "Targets": "",\n "OwnerInformation": "",\n "Name": "",\n "Description": "",\n "ClientToken": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"WindowId\": \"\",\n \"ResourceType\": \"\",\n \"Targets\": \"\",\n \"OwnerInformation\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterTargetWithMaintenanceWindow")
.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({
WindowId: '',
ResourceType: '',
Targets: '',
OwnerInformation: '',
Name: '',
Description: '',
ClientToken: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterTargetWithMaintenanceWindow',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
WindowId: '',
ResourceType: '',
Targets: '',
OwnerInformation: '',
Name: '',
Description: '',
ClientToken: ''
},
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=AmazonSSM.RegisterTargetWithMaintenanceWindow');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
WindowId: '',
ResourceType: '',
Targets: '',
OwnerInformation: '',
Name: '',
Description: '',
ClientToken: ''
});
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=AmazonSSM.RegisterTargetWithMaintenanceWindow',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
WindowId: '',
ResourceType: '',
Targets: '',
OwnerInformation: '',
Name: '',
Description: '',
ClientToken: ''
}
};
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=AmazonSSM.RegisterTargetWithMaintenanceWindow';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowId":"","ResourceType":"","Targets":"","OwnerInformation":"","Name":"","Description":"","ClientToken":""}'
};
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 = @{ @"WindowId": @"",
@"ResourceType": @"",
@"Targets": @"",
@"OwnerInformation": @"",
@"Name": @"",
@"Description": @"",
@"ClientToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterTargetWithMaintenanceWindow"]
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=AmazonSSM.RegisterTargetWithMaintenanceWindow" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"WindowId\": \"\",\n \"ResourceType\": \"\",\n \"Targets\": \"\",\n \"OwnerInformation\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterTargetWithMaintenanceWindow",
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([
'WindowId' => '',
'ResourceType' => '',
'Targets' => '',
'OwnerInformation' => '',
'Name' => '',
'Description' => '',
'ClientToken' => ''
]),
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=AmazonSSM.RegisterTargetWithMaintenanceWindow', [
'body' => '{
"WindowId": "",
"ResourceType": "",
"Targets": "",
"OwnerInformation": "",
"Name": "",
"Description": "",
"ClientToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterTargetWithMaintenanceWindow');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'WindowId' => '',
'ResourceType' => '',
'Targets' => '',
'OwnerInformation' => '',
'Name' => '',
'Description' => '',
'ClientToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'WindowId' => '',
'ResourceType' => '',
'Targets' => '',
'OwnerInformation' => '',
'Name' => '',
'Description' => '',
'ClientToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterTargetWithMaintenanceWindow');
$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=AmazonSSM.RegisterTargetWithMaintenanceWindow' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowId": "",
"ResourceType": "",
"Targets": "",
"OwnerInformation": "",
"Name": "",
"Description": "",
"ClientToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterTargetWithMaintenanceWindow' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowId": "",
"ResourceType": "",
"Targets": "",
"OwnerInformation": "",
"Name": "",
"Description": "",
"ClientToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"WindowId\": \"\",\n \"ResourceType\": \"\",\n \"Targets\": \"\",\n \"OwnerInformation\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\"\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=AmazonSSM.RegisterTargetWithMaintenanceWindow"
payload = {
"WindowId": "",
"ResourceType": "",
"Targets": "",
"OwnerInformation": "",
"Name": "",
"Description": "",
"ClientToken": ""
}
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=AmazonSSM.RegisterTargetWithMaintenanceWindow"
payload <- "{\n \"WindowId\": \"\",\n \"ResourceType\": \"\",\n \"Targets\": \"\",\n \"OwnerInformation\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\"\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=AmazonSSM.RegisterTargetWithMaintenanceWindow")
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 \"WindowId\": \"\",\n \"ResourceType\": \"\",\n \"Targets\": \"\",\n \"OwnerInformation\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\"\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 \"WindowId\": \"\",\n \"ResourceType\": \"\",\n \"Targets\": \"\",\n \"OwnerInformation\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\"\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=AmazonSSM.RegisterTargetWithMaintenanceWindow";
let payload = json!({
"WindowId": "",
"ResourceType": "",
"Targets": "",
"OwnerInformation": "",
"Name": "",
"Description": "",
"ClientToken": ""
});
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=AmazonSSM.RegisterTargetWithMaintenanceWindow' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"WindowId": "",
"ResourceType": "",
"Targets": "",
"OwnerInformation": "",
"Name": "",
"Description": "",
"ClientToken": ""
}'
echo '{
"WindowId": "",
"ResourceType": "",
"Targets": "",
"OwnerInformation": "",
"Name": "",
"Description": "",
"ClientToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterTargetWithMaintenanceWindow' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "WindowId": "",\n "ResourceType": "",\n "Targets": "",\n "OwnerInformation": "",\n "Name": "",\n "Description": "",\n "ClientToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterTargetWithMaintenanceWindow'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"WindowId": "",
"ResourceType": "",
"Targets": "",
"OwnerInformation": "",
"Name": "",
"Description": "",
"ClientToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterTargetWithMaintenanceWindow")! 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
RegisterTaskWithMaintenanceWindow
{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterTaskWithMaintenanceWindow
HEADERS
X-Amz-Target
BODY json
{
"WindowId": "",
"Targets": "",
"TaskArn": "",
"ServiceRoleArn": "",
"TaskType": "",
"TaskParameters": "",
"TaskInvocationParameters": "",
"Priority": "",
"MaxConcurrency": "",
"MaxErrors": "",
"LoggingInfo": "",
"Name": "",
"Description": "",
"ClientToken": "",
"CutoffBehavior": "",
"AlarmConfiguration": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterTaskWithMaintenanceWindow");
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 \"WindowId\": \"\",\n \"Targets\": \"\",\n \"TaskArn\": \"\",\n \"ServiceRoleArn\": \"\",\n \"TaskType\": \"\",\n \"TaskParameters\": \"\",\n \"TaskInvocationParameters\": \"\",\n \"Priority\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"LoggingInfo\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"CutoffBehavior\": \"\",\n \"AlarmConfiguration\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterTaskWithMaintenanceWindow" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:WindowId ""
:Targets ""
:TaskArn ""
:ServiceRoleArn ""
:TaskType ""
:TaskParameters ""
:TaskInvocationParameters ""
:Priority ""
:MaxConcurrency ""
:MaxErrors ""
:LoggingInfo ""
:Name ""
:Description ""
:ClientToken ""
:CutoffBehavior ""
:AlarmConfiguration ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterTaskWithMaintenanceWindow"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"WindowId\": \"\",\n \"Targets\": \"\",\n \"TaskArn\": \"\",\n \"ServiceRoleArn\": \"\",\n \"TaskType\": \"\",\n \"TaskParameters\": \"\",\n \"TaskInvocationParameters\": \"\",\n \"Priority\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"LoggingInfo\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"CutoffBehavior\": \"\",\n \"AlarmConfiguration\": \"\"\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=AmazonSSM.RegisterTaskWithMaintenanceWindow"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"WindowId\": \"\",\n \"Targets\": \"\",\n \"TaskArn\": \"\",\n \"ServiceRoleArn\": \"\",\n \"TaskType\": \"\",\n \"TaskParameters\": \"\",\n \"TaskInvocationParameters\": \"\",\n \"Priority\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"LoggingInfo\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"CutoffBehavior\": \"\",\n \"AlarmConfiguration\": \"\"\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=AmazonSSM.RegisterTaskWithMaintenanceWindow");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"WindowId\": \"\",\n \"Targets\": \"\",\n \"TaskArn\": \"\",\n \"ServiceRoleArn\": \"\",\n \"TaskType\": \"\",\n \"TaskParameters\": \"\",\n \"TaskInvocationParameters\": \"\",\n \"Priority\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"LoggingInfo\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"CutoffBehavior\": \"\",\n \"AlarmConfiguration\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterTaskWithMaintenanceWindow"
payload := strings.NewReader("{\n \"WindowId\": \"\",\n \"Targets\": \"\",\n \"TaskArn\": \"\",\n \"ServiceRoleArn\": \"\",\n \"TaskType\": \"\",\n \"TaskParameters\": \"\",\n \"TaskInvocationParameters\": \"\",\n \"Priority\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"LoggingInfo\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"CutoffBehavior\": \"\",\n \"AlarmConfiguration\": \"\"\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: 344
{
"WindowId": "",
"Targets": "",
"TaskArn": "",
"ServiceRoleArn": "",
"TaskType": "",
"TaskParameters": "",
"TaskInvocationParameters": "",
"Priority": "",
"MaxConcurrency": "",
"MaxErrors": "",
"LoggingInfo": "",
"Name": "",
"Description": "",
"ClientToken": "",
"CutoffBehavior": "",
"AlarmConfiguration": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterTaskWithMaintenanceWindow")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"WindowId\": \"\",\n \"Targets\": \"\",\n \"TaskArn\": \"\",\n \"ServiceRoleArn\": \"\",\n \"TaskType\": \"\",\n \"TaskParameters\": \"\",\n \"TaskInvocationParameters\": \"\",\n \"Priority\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"LoggingInfo\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"CutoffBehavior\": \"\",\n \"AlarmConfiguration\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterTaskWithMaintenanceWindow"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"WindowId\": \"\",\n \"Targets\": \"\",\n \"TaskArn\": \"\",\n \"ServiceRoleArn\": \"\",\n \"TaskType\": \"\",\n \"TaskParameters\": \"\",\n \"TaskInvocationParameters\": \"\",\n \"Priority\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"LoggingInfo\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"CutoffBehavior\": \"\",\n \"AlarmConfiguration\": \"\"\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 \"WindowId\": \"\",\n \"Targets\": \"\",\n \"TaskArn\": \"\",\n \"ServiceRoleArn\": \"\",\n \"TaskType\": \"\",\n \"TaskParameters\": \"\",\n \"TaskInvocationParameters\": \"\",\n \"Priority\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"LoggingInfo\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"CutoffBehavior\": \"\",\n \"AlarmConfiguration\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterTaskWithMaintenanceWindow")
.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=AmazonSSM.RegisterTaskWithMaintenanceWindow")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"WindowId\": \"\",\n \"Targets\": \"\",\n \"TaskArn\": \"\",\n \"ServiceRoleArn\": \"\",\n \"TaskType\": \"\",\n \"TaskParameters\": \"\",\n \"TaskInvocationParameters\": \"\",\n \"Priority\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"LoggingInfo\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"CutoffBehavior\": \"\",\n \"AlarmConfiguration\": \"\"\n}")
.asString();
const data = JSON.stringify({
WindowId: '',
Targets: '',
TaskArn: '',
ServiceRoleArn: '',
TaskType: '',
TaskParameters: '',
TaskInvocationParameters: '',
Priority: '',
MaxConcurrency: '',
MaxErrors: '',
LoggingInfo: '',
Name: '',
Description: '',
ClientToken: '',
CutoffBehavior: '',
AlarmConfiguration: ''
});
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=AmazonSSM.RegisterTaskWithMaintenanceWindow');
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=AmazonSSM.RegisterTaskWithMaintenanceWindow',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
WindowId: '',
Targets: '',
TaskArn: '',
ServiceRoleArn: '',
TaskType: '',
TaskParameters: '',
TaskInvocationParameters: '',
Priority: '',
MaxConcurrency: '',
MaxErrors: '',
LoggingInfo: '',
Name: '',
Description: '',
ClientToken: '',
CutoffBehavior: '',
AlarmConfiguration: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterTaskWithMaintenanceWindow';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowId":"","Targets":"","TaskArn":"","ServiceRoleArn":"","TaskType":"","TaskParameters":"","TaskInvocationParameters":"","Priority":"","MaxConcurrency":"","MaxErrors":"","LoggingInfo":"","Name":"","Description":"","ClientToken":"","CutoffBehavior":"","AlarmConfiguration":""}'
};
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=AmazonSSM.RegisterTaskWithMaintenanceWindow',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "WindowId": "",\n "Targets": "",\n "TaskArn": "",\n "ServiceRoleArn": "",\n "TaskType": "",\n "TaskParameters": "",\n "TaskInvocationParameters": "",\n "Priority": "",\n "MaxConcurrency": "",\n "MaxErrors": "",\n "LoggingInfo": "",\n "Name": "",\n "Description": "",\n "ClientToken": "",\n "CutoffBehavior": "",\n "AlarmConfiguration": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"WindowId\": \"\",\n \"Targets\": \"\",\n \"TaskArn\": \"\",\n \"ServiceRoleArn\": \"\",\n \"TaskType\": \"\",\n \"TaskParameters\": \"\",\n \"TaskInvocationParameters\": \"\",\n \"Priority\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"LoggingInfo\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"CutoffBehavior\": \"\",\n \"AlarmConfiguration\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterTaskWithMaintenanceWindow")
.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({
WindowId: '',
Targets: '',
TaskArn: '',
ServiceRoleArn: '',
TaskType: '',
TaskParameters: '',
TaskInvocationParameters: '',
Priority: '',
MaxConcurrency: '',
MaxErrors: '',
LoggingInfo: '',
Name: '',
Description: '',
ClientToken: '',
CutoffBehavior: '',
AlarmConfiguration: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterTaskWithMaintenanceWindow',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
WindowId: '',
Targets: '',
TaskArn: '',
ServiceRoleArn: '',
TaskType: '',
TaskParameters: '',
TaskInvocationParameters: '',
Priority: '',
MaxConcurrency: '',
MaxErrors: '',
LoggingInfo: '',
Name: '',
Description: '',
ClientToken: '',
CutoffBehavior: '',
AlarmConfiguration: ''
},
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=AmazonSSM.RegisterTaskWithMaintenanceWindow');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
WindowId: '',
Targets: '',
TaskArn: '',
ServiceRoleArn: '',
TaskType: '',
TaskParameters: '',
TaskInvocationParameters: '',
Priority: '',
MaxConcurrency: '',
MaxErrors: '',
LoggingInfo: '',
Name: '',
Description: '',
ClientToken: '',
CutoffBehavior: '',
AlarmConfiguration: ''
});
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=AmazonSSM.RegisterTaskWithMaintenanceWindow',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
WindowId: '',
Targets: '',
TaskArn: '',
ServiceRoleArn: '',
TaskType: '',
TaskParameters: '',
TaskInvocationParameters: '',
Priority: '',
MaxConcurrency: '',
MaxErrors: '',
LoggingInfo: '',
Name: '',
Description: '',
ClientToken: '',
CutoffBehavior: '',
AlarmConfiguration: ''
}
};
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=AmazonSSM.RegisterTaskWithMaintenanceWindow';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowId":"","Targets":"","TaskArn":"","ServiceRoleArn":"","TaskType":"","TaskParameters":"","TaskInvocationParameters":"","Priority":"","MaxConcurrency":"","MaxErrors":"","LoggingInfo":"","Name":"","Description":"","ClientToken":"","CutoffBehavior":"","AlarmConfiguration":""}'
};
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 = @{ @"WindowId": @"",
@"Targets": @"",
@"TaskArn": @"",
@"ServiceRoleArn": @"",
@"TaskType": @"",
@"TaskParameters": @"",
@"TaskInvocationParameters": @"",
@"Priority": @"",
@"MaxConcurrency": @"",
@"MaxErrors": @"",
@"LoggingInfo": @"",
@"Name": @"",
@"Description": @"",
@"ClientToken": @"",
@"CutoffBehavior": @"",
@"AlarmConfiguration": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterTaskWithMaintenanceWindow"]
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=AmazonSSM.RegisterTaskWithMaintenanceWindow" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"WindowId\": \"\",\n \"Targets\": \"\",\n \"TaskArn\": \"\",\n \"ServiceRoleArn\": \"\",\n \"TaskType\": \"\",\n \"TaskParameters\": \"\",\n \"TaskInvocationParameters\": \"\",\n \"Priority\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"LoggingInfo\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"CutoffBehavior\": \"\",\n \"AlarmConfiguration\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterTaskWithMaintenanceWindow",
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([
'WindowId' => '',
'Targets' => '',
'TaskArn' => '',
'ServiceRoleArn' => '',
'TaskType' => '',
'TaskParameters' => '',
'TaskInvocationParameters' => '',
'Priority' => '',
'MaxConcurrency' => '',
'MaxErrors' => '',
'LoggingInfo' => '',
'Name' => '',
'Description' => '',
'ClientToken' => '',
'CutoffBehavior' => '',
'AlarmConfiguration' => ''
]),
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=AmazonSSM.RegisterTaskWithMaintenanceWindow', [
'body' => '{
"WindowId": "",
"Targets": "",
"TaskArn": "",
"ServiceRoleArn": "",
"TaskType": "",
"TaskParameters": "",
"TaskInvocationParameters": "",
"Priority": "",
"MaxConcurrency": "",
"MaxErrors": "",
"LoggingInfo": "",
"Name": "",
"Description": "",
"ClientToken": "",
"CutoffBehavior": "",
"AlarmConfiguration": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterTaskWithMaintenanceWindow');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'WindowId' => '',
'Targets' => '',
'TaskArn' => '',
'ServiceRoleArn' => '',
'TaskType' => '',
'TaskParameters' => '',
'TaskInvocationParameters' => '',
'Priority' => '',
'MaxConcurrency' => '',
'MaxErrors' => '',
'LoggingInfo' => '',
'Name' => '',
'Description' => '',
'ClientToken' => '',
'CutoffBehavior' => '',
'AlarmConfiguration' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'WindowId' => '',
'Targets' => '',
'TaskArn' => '',
'ServiceRoleArn' => '',
'TaskType' => '',
'TaskParameters' => '',
'TaskInvocationParameters' => '',
'Priority' => '',
'MaxConcurrency' => '',
'MaxErrors' => '',
'LoggingInfo' => '',
'Name' => '',
'Description' => '',
'ClientToken' => '',
'CutoffBehavior' => '',
'AlarmConfiguration' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterTaskWithMaintenanceWindow');
$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=AmazonSSM.RegisterTaskWithMaintenanceWindow' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowId": "",
"Targets": "",
"TaskArn": "",
"ServiceRoleArn": "",
"TaskType": "",
"TaskParameters": "",
"TaskInvocationParameters": "",
"Priority": "",
"MaxConcurrency": "",
"MaxErrors": "",
"LoggingInfo": "",
"Name": "",
"Description": "",
"ClientToken": "",
"CutoffBehavior": "",
"AlarmConfiguration": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterTaskWithMaintenanceWindow' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowId": "",
"Targets": "",
"TaskArn": "",
"ServiceRoleArn": "",
"TaskType": "",
"TaskParameters": "",
"TaskInvocationParameters": "",
"Priority": "",
"MaxConcurrency": "",
"MaxErrors": "",
"LoggingInfo": "",
"Name": "",
"Description": "",
"ClientToken": "",
"CutoffBehavior": "",
"AlarmConfiguration": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"WindowId\": \"\",\n \"Targets\": \"\",\n \"TaskArn\": \"\",\n \"ServiceRoleArn\": \"\",\n \"TaskType\": \"\",\n \"TaskParameters\": \"\",\n \"TaskInvocationParameters\": \"\",\n \"Priority\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"LoggingInfo\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"CutoffBehavior\": \"\",\n \"AlarmConfiguration\": \"\"\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=AmazonSSM.RegisterTaskWithMaintenanceWindow"
payload = {
"WindowId": "",
"Targets": "",
"TaskArn": "",
"ServiceRoleArn": "",
"TaskType": "",
"TaskParameters": "",
"TaskInvocationParameters": "",
"Priority": "",
"MaxConcurrency": "",
"MaxErrors": "",
"LoggingInfo": "",
"Name": "",
"Description": "",
"ClientToken": "",
"CutoffBehavior": "",
"AlarmConfiguration": ""
}
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=AmazonSSM.RegisterTaskWithMaintenanceWindow"
payload <- "{\n \"WindowId\": \"\",\n \"Targets\": \"\",\n \"TaskArn\": \"\",\n \"ServiceRoleArn\": \"\",\n \"TaskType\": \"\",\n \"TaskParameters\": \"\",\n \"TaskInvocationParameters\": \"\",\n \"Priority\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"LoggingInfo\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"CutoffBehavior\": \"\",\n \"AlarmConfiguration\": \"\"\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=AmazonSSM.RegisterTaskWithMaintenanceWindow")
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 \"WindowId\": \"\",\n \"Targets\": \"\",\n \"TaskArn\": \"\",\n \"ServiceRoleArn\": \"\",\n \"TaskType\": \"\",\n \"TaskParameters\": \"\",\n \"TaskInvocationParameters\": \"\",\n \"Priority\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"LoggingInfo\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"CutoffBehavior\": \"\",\n \"AlarmConfiguration\": \"\"\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 \"WindowId\": \"\",\n \"Targets\": \"\",\n \"TaskArn\": \"\",\n \"ServiceRoleArn\": \"\",\n \"TaskType\": \"\",\n \"TaskParameters\": \"\",\n \"TaskInvocationParameters\": \"\",\n \"Priority\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"LoggingInfo\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"CutoffBehavior\": \"\",\n \"AlarmConfiguration\": \"\"\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=AmazonSSM.RegisterTaskWithMaintenanceWindow";
let payload = json!({
"WindowId": "",
"Targets": "",
"TaskArn": "",
"ServiceRoleArn": "",
"TaskType": "",
"TaskParameters": "",
"TaskInvocationParameters": "",
"Priority": "",
"MaxConcurrency": "",
"MaxErrors": "",
"LoggingInfo": "",
"Name": "",
"Description": "",
"ClientToken": "",
"CutoffBehavior": "",
"AlarmConfiguration": ""
});
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=AmazonSSM.RegisterTaskWithMaintenanceWindow' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"WindowId": "",
"Targets": "",
"TaskArn": "",
"ServiceRoleArn": "",
"TaskType": "",
"TaskParameters": "",
"TaskInvocationParameters": "",
"Priority": "",
"MaxConcurrency": "",
"MaxErrors": "",
"LoggingInfo": "",
"Name": "",
"Description": "",
"ClientToken": "",
"CutoffBehavior": "",
"AlarmConfiguration": ""
}'
echo '{
"WindowId": "",
"Targets": "",
"TaskArn": "",
"ServiceRoleArn": "",
"TaskType": "",
"TaskParameters": "",
"TaskInvocationParameters": "",
"Priority": "",
"MaxConcurrency": "",
"MaxErrors": "",
"LoggingInfo": "",
"Name": "",
"Description": "",
"ClientToken": "",
"CutoffBehavior": "",
"AlarmConfiguration": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterTaskWithMaintenanceWindow' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "WindowId": "",\n "Targets": "",\n "TaskArn": "",\n "ServiceRoleArn": "",\n "TaskType": "",\n "TaskParameters": "",\n "TaskInvocationParameters": "",\n "Priority": "",\n "MaxConcurrency": "",\n "MaxErrors": "",\n "LoggingInfo": "",\n "Name": "",\n "Description": "",\n "ClientToken": "",\n "CutoffBehavior": "",\n "AlarmConfiguration": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterTaskWithMaintenanceWindow'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"WindowId": "",
"Targets": "",
"TaskArn": "",
"ServiceRoleArn": "",
"TaskType": "",
"TaskParameters": "",
"TaskInvocationParameters": "",
"Priority": "",
"MaxConcurrency": "",
"MaxErrors": "",
"LoggingInfo": "",
"Name": "",
"Description": "",
"ClientToken": "",
"CutoffBehavior": "",
"AlarmConfiguration": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.RegisterTaskWithMaintenanceWindow")! 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=AmazonSSM.RemoveTagsFromResource
HEADERS
X-Amz-Target
BODY json
{
"ResourceType": "",
"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=AmazonSSM.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 \"ResourceType\": \"\",\n \"ResourceId\": \"\",\n \"TagKeys\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.RemoveTagsFromResource" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ResourceType ""
:ResourceId ""
:TagKeys ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.RemoveTagsFromResource"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ResourceType\": \"\",\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=AmazonSSM.RemoveTagsFromResource"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ResourceType\": \"\",\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=AmazonSSM.RemoveTagsFromResource");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ResourceType\": \"\",\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=AmazonSSM.RemoveTagsFromResource"
payload := strings.NewReader("{\n \"ResourceType\": \"\",\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: 61
{
"ResourceType": "",
"ResourceId": "",
"TagKeys": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.RemoveTagsFromResource")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ResourceType\": \"\",\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=AmazonSSM.RemoveTagsFromResource"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ResourceType\": \"\",\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 \"ResourceType\": \"\",\n \"ResourceId\": \"\",\n \"TagKeys\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.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=AmazonSSM.RemoveTagsFromResource")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ResourceType\": \"\",\n \"ResourceId\": \"\",\n \"TagKeys\": \"\"\n}")
.asString();
const data = JSON.stringify({
ResourceType: '',
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=AmazonSSM.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=AmazonSSM.RemoveTagsFromResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ResourceType: '', ResourceId: '', TagKeys: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.RemoveTagsFromResource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ResourceType":"","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=AmazonSSM.RemoveTagsFromResource',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ResourceType": "",\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 \"ResourceType\": \"\",\n \"ResourceId\": \"\",\n \"TagKeys\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.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({ResourceType: '', ResourceId: '', TagKeys: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.RemoveTagsFromResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {ResourceType: '', 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=AmazonSSM.RemoveTagsFromResource');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ResourceType: '',
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=AmazonSSM.RemoveTagsFromResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ResourceType: '', 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=AmazonSSM.RemoveTagsFromResource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ResourceType":"","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 = @{ @"ResourceType": @"",
@"ResourceId": @"",
@"TagKeys": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.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=AmazonSSM.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 \"ResourceType\": \"\",\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=AmazonSSM.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([
'ResourceType' => '',
'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=AmazonSSM.RemoveTagsFromResource', [
'body' => '{
"ResourceType": "",
"ResourceId": "",
"TagKeys": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.RemoveTagsFromResource');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ResourceType' => '',
'ResourceId' => '',
'TagKeys' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ResourceType' => '',
'ResourceId' => '',
'TagKeys' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.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=AmazonSSM.RemoveTagsFromResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ResourceType": "",
"ResourceId": "",
"TagKeys": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.RemoveTagsFromResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ResourceType": "",
"ResourceId": "",
"TagKeys": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ResourceType\": \"\",\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=AmazonSSM.RemoveTagsFromResource"
payload = {
"ResourceType": "",
"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=AmazonSSM.RemoveTagsFromResource"
payload <- "{\n \"ResourceType\": \"\",\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=AmazonSSM.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 \"ResourceType\": \"\",\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 \"ResourceType\": \"\",\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=AmazonSSM.RemoveTagsFromResource";
let payload = json!({
"ResourceType": "",
"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=AmazonSSM.RemoveTagsFromResource' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ResourceType": "",
"ResourceId": "",
"TagKeys": ""
}'
echo '{
"ResourceType": "",
"ResourceId": "",
"TagKeys": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.RemoveTagsFromResource' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ResourceType": "",\n "ResourceId": "",\n "TagKeys": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.RemoveTagsFromResource'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"ResourceType": "",
"ResourceId": "",
"TagKeys": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.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
ResetServiceSetting
{{baseUrl}}/#X-Amz-Target=AmazonSSM.ResetServiceSetting
HEADERS
X-Amz-Target
BODY json
{
"SettingId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ResetServiceSetting");
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 \"SettingId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ResetServiceSetting" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:SettingId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ResetServiceSetting"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"SettingId\": \"\"\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=AmazonSSM.ResetServiceSetting"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"SettingId\": \"\"\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=AmazonSSM.ResetServiceSetting");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"SettingId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ResetServiceSetting"
payload := strings.NewReader("{\n \"SettingId\": \"\"\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: 21
{
"SettingId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ResetServiceSetting")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"SettingId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ResetServiceSetting"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"SettingId\": \"\"\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 \"SettingId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ResetServiceSetting")
.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=AmazonSSM.ResetServiceSetting")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"SettingId\": \"\"\n}")
.asString();
const data = JSON.stringify({
SettingId: ''
});
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=AmazonSSM.ResetServiceSetting');
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=AmazonSSM.ResetServiceSetting',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {SettingId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ResetServiceSetting';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"SettingId":""}'
};
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=AmazonSSM.ResetServiceSetting',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "SettingId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"SettingId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ResetServiceSetting")
.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({SettingId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ResetServiceSetting',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {SettingId: ''},
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=AmazonSSM.ResetServiceSetting');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
SettingId: ''
});
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=AmazonSSM.ResetServiceSetting',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {SettingId: ''}
};
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=AmazonSSM.ResetServiceSetting';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"SettingId":""}'
};
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 = @{ @"SettingId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.ResetServiceSetting"]
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=AmazonSSM.ResetServiceSetting" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"SettingId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.ResetServiceSetting",
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([
'SettingId' => ''
]),
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=AmazonSSM.ResetServiceSetting', [
'body' => '{
"SettingId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.ResetServiceSetting');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'SettingId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'SettingId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.ResetServiceSetting');
$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=AmazonSSM.ResetServiceSetting' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SettingId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ResetServiceSetting' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SettingId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"SettingId\": \"\"\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=AmazonSSM.ResetServiceSetting"
payload = { "SettingId": "" }
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=AmazonSSM.ResetServiceSetting"
payload <- "{\n \"SettingId\": \"\"\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=AmazonSSM.ResetServiceSetting")
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 \"SettingId\": \"\"\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 \"SettingId\": \"\"\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=AmazonSSM.ResetServiceSetting";
let payload = json!({"SettingId": ""});
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=AmazonSSM.ResetServiceSetting' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"SettingId": ""
}'
echo '{
"SettingId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ResetServiceSetting' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "SettingId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ResetServiceSetting'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["SettingId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ResetServiceSetting")! 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
ResumeSession
{{baseUrl}}/#X-Amz-Target=AmazonSSM.ResumeSession
HEADERS
X-Amz-Target
BODY json
{
"SessionId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ResumeSession");
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 \"SessionId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ResumeSession" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:SessionId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ResumeSession"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"SessionId\": \"\"\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=AmazonSSM.ResumeSession"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"SessionId\": \"\"\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=AmazonSSM.ResumeSession");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"SessionId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ResumeSession"
payload := strings.NewReader("{\n \"SessionId\": \"\"\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: 21
{
"SessionId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ResumeSession")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"SessionId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ResumeSession"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"SessionId\": \"\"\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 \"SessionId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ResumeSession")
.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=AmazonSSM.ResumeSession")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"SessionId\": \"\"\n}")
.asString();
const data = JSON.stringify({
SessionId: ''
});
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=AmazonSSM.ResumeSession');
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=AmazonSSM.ResumeSession',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {SessionId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ResumeSession';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"SessionId":""}'
};
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=AmazonSSM.ResumeSession',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "SessionId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"SessionId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.ResumeSession")
.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({SessionId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ResumeSession',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {SessionId: ''},
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=AmazonSSM.ResumeSession');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
SessionId: ''
});
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=AmazonSSM.ResumeSession',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {SessionId: ''}
};
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=AmazonSSM.ResumeSession';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"SessionId":""}'
};
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 = @{ @"SessionId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.ResumeSession"]
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=AmazonSSM.ResumeSession" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"SessionId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.ResumeSession",
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([
'SessionId' => ''
]),
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=AmazonSSM.ResumeSession', [
'body' => '{
"SessionId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.ResumeSession');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'SessionId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'SessionId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.ResumeSession');
$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=AmazonSSM.ResumeSession' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SessionId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ResumeSession' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SessionId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"SessionId\": \"\"\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=AmazonSSM.ResumeSession"
payload = { "SessionId": "" }
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=AmazonSSM.ResumeSession"
payload <- "{\n \"SessionId\": \"\"\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=AmazonSSM.ResumeSession")
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 \"SessionId\": \"\"\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 \"SessionId\": \"\"\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=AmazonSSM.ResumeSession";
let payload = json!({"SessionId": ""});
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=AmazonSSM.ResumeSession' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"SessionId": ""
}'
echo '{
"SessionId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ResumeSession' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "SessionId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.ResumeSession'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["SessionId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.ResumeSession")! 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
SendAutomationSignal
{{baseUrl}}/#X-Amz-Target=AmazonSSM.SendAutomationSignal
HEADERS
X-Amz-Target
BODY json
{
"AutomationExecutionId": "",
"SignalType": "",
"Payload": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.SendAutomationSignal");
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 \"AutomationExecutionId\": \"\",\n \"SignalType\": \"\",\n \"Payload\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.SendAutomationSignal" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:AutomationExecutionId ""
:SignalType ""
:Payload ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.SendAutomationSignal"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"AutomationExecutionId\": \"\",\n \"SignalType\": \"\",\n \"Payload\": \"\"\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=AmazonSSM.SendAutomationSignal"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"AutomationExecutionId\": \"\",\n \"SignalType\": \"\",\n \"Payload\": \"\"\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=AmazonSSM.SendAutomationSignal");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AutomationExecutionId\": \"\",\n \"SignalType\": \"\",\n \"Payload\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.SendAutomationSignal"
payload := strings.NewReader("{\n \"AutomationExecutionId\": \"\",\n \"SignalType\": \"\",\n \"Payload\": \"\"\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: 70
{
"AutomationExecutionId": "",
"SignalType": "",
"Payload": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.SendAutomationSignal")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"AutomationExecutionId\": \"\",\n \"SignalType\": \"\",\n \"Payload\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.SendAutomationSignal"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AutomationExecutionId\": \"\",\n \"SignalType\": \"\",\n \"Payload\": \"\"\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 \"AutomationExecutionId\": \"\",\n \"SignalType\": \"\",\n \"Payload\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.SendAutomationSignal")
.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=AmazonSSM.SendAutomationSignal")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"AutomationExecutionId\": \"\",\n \"SignalType\": \"\",\n \"Payload\": \"\"\n}")
.asString();
const data = JSON.stringify({
AutomationExecutionId: '',
SignalType: '',
Payload: ''
});
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=AmazonSSM.SendAutomationSignal');
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=AmazonSSM.SendAutomationSignal',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AutomationExecutionId: '', SignalType: '', Payload: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.SendAutomationSignal';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AutomationExecutionId":"","SignalType":"","Payload":""}'
};
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=AmazonSSM.SendAutomationSignal',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "AutomationExecutionId": "",\n "SignalType": "",\n "Payload": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AutomationExecutionId\": \"\",\n \"SignalType\": \"\",\n \"Payload\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.SendAutomationSignal")
.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({AutomationExecutionId: '', SignalType: '', Payload: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.SendAutomationSignal',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {AutomationExecutionId: '', SignalType: '', Payload: ''},
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=AmazonSSM.SendAutomationSignal');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
AutomationExecutionId: '',
SignalType: '',
Payload: ''
});
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=AmazonSSM.SendAutomationSignal',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AutomationExecutionId: '', SignalType: '', Payload: ''}
};
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=AmazonSSM.SendAutomationSignal';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AutomationExecutionId":"","SignalType":"","Payload":""}'
};
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 = @{ @"AutomationExecutionId": @"",
@"SignalType": @"",
@"Payload": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.SendAutomationSignal"]
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=AmazonSSM.SendAutomationSignal" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"AutomationExecutionId\": \"\",\n \"SignalType\": \"\",\n \"Payload\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.SendAutomationSignal",
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([
'AutomationExecutionId' => '',
'SignalType' => '',
'Payload' => ''
]),
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=AmazonSSM.SendAutomationSignal', [
'body' => '{
"AutomationExecutionId": "",
"SignalType": "",
"Payload": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.SendAutomationSignal');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AutomationExecutionId' => '',
'SignalType' => '',
'Payload' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AutomationExecutionId' => '',
'SignalType' => '',
'Payload' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.SendAutomationSignal');
$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=AmazonSSM.SendAutomationSignal' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AutomationExecutionId": "",
"SignalType": "",
"Payload": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.SendAutomationSignal' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AutomationExecutionId": "",
"SignalType": "",
"Payload": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AutomationExecutionId\": \"\",\n \"SignalType\": \"\",\n \"Payload\": \"\"\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=AmazonSSM.SendAutomationSignal"
payload = {
"AutomationExecutionId": "",
"SignalType": "",
"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=AmazonSSM.SendAutomationSignal"
payload <- "{\n \"AutomationExecutionId\": \"\",\n \"SignalType\": \"\",\n \"Payload\": \"\"\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=AmazonSSM.SendAutomationSignal")
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 \"AutomationExecutionId\": \"\",\n \"SignalType\": \"\",\n \"Payload\": \"\"\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 \"AutomationExecutionId\": \"\",\n \"SignalType\": \"\",\n \"Payload\": \"\"\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=AmazonSSM.SendAutomationSignal";
let payload = json!({
"AutomationExecutionId": "",
"SignalType": "",
"Payload": ""
});
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=AmazonSSM.SendAutomationSignal' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"AutomationExecutionId": "",
"SignalType": "",
"Payload": ""
}'
echo '{
"AutomationExecutionId": "",
"SignalType": "",
"Payload": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.SendAutomationSignal' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "AutomationExecutionId": "",\n "SignalType": "",\n "Payload": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.SendAutomationSignal'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"AutomationExecutionId": "",
"SignalType": "",
"Payload": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.SendAutomationSignal")! 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
SendCommand
{{baseUrl}}/#X-Amz-Target=AmazonSSM.SendCommand
HEADERS
X-Amz-Target
BODY json
{
"InstanceIds": "",
"Targets": "",
"DocumentName": "",
"DocumentVersion": "",
"DocumentHash": "",
"DocumentHashType": "",
"TimeoutSeconds": "",
"Comment": "",
"Parameters": "",
"OutputS3Region": "",
"OutputS3BucketName": "",
"OutputS3KeyPrefix": "",
"MaxConcurrency": "",
"MaxErrors": "",
"ServiceRoleArn": "",
"NotificationConfig": "",
"CloudWatchOutputConfig": "",
"AlarmConfiguration": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.SendCommand");
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 \"InstanceIds\": \"\",\n \"Targets\": \"\",\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentHash\": \"\",\n \"DocumentHashType\": \"\",\n \"TimeoutSeconds\": \"\",\n \"Comment\": \"\",\n \"Parameters\": \"\",\n \"OutputS3Region\": \"\",\n \"OutputS3BucketName\": \"\",\n \"OutputS3KeyPrefix\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"ServiceRoleArn\": \"\",\n \"NotificationConfig\": \"\",\n \"CloudWatchOutputConfig\": \"\",\n \"AlarmConfiguration\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.SendCommand" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:InstanceIds ""
:Targets ""
:DocumentName ""
:DocumentVersion ""
:DocumentHash ""
:DocumentHashType ""
:TimeoutSeconds ""
:Comment ""
:Parameters ""
:OutputS3Region ""
:OutputS3BucketName ""
:OutputS3KeyPrefix ""
:MaxConcurrency ""
:MaxErrors ""
:ServiceRoleArn ""
:NotificationConfig ""
:CloudWatchOutputConfig ""
:AlarmConfiguration ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.SendCommand"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"InstanceIds\": \"\",\n \"Targets\": \"\",\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentHash\": \"\",\n \"DocumentHashType\": \"\",\n \"TimeoutSeconds\": \"\",\n \"Comment\": \"\",\n \"Parameters\": \"\",\n \"OutputS3Region\": \"\",\n \"OutputS3BucketName\": \"\",\n \"OutputS3KeyPrefix\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"ServiceRoleArn\": \"\",\n \"NotificationConfig\": \"\",\n \"CloudWatchOutputConfig\": \"\",\n \"AlarmConfiguration\": \"\"\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=AmazonSSM.SendCommand"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"InstanceIds\": \"\",\n \"Targets\": \"\",\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentHash\": \"\",\n \"DocumentHashType\": \"\",\n \"TimeoutSeconds\": \"\",\n \"Comment\": \"\",\n \"Parameters\": \"\",\n \"OutputS3Region\": \"\",\n \"OutputS3BucketName\": \"\",\n \"OutputS3KeyPrefix\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"ServiceRoleArn\": \"\",\n \"NotificationConfig\": \"\",\n \"CloudWatchOutputConfig\": \"\",\n \"AlarmConfiguration\": \"\"\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=AmazonSSM.SendCommand");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"InstanceIds\": \"\",\n \"Targets\": \"\",\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentHash\": \"\",\n \"DocumentHashType\": \"\",\n \"TimeoutSeconds\": \"\",\n \"Comment\": \"\",\n \"Parameters\": \"\",\n \"OutputS3Region\": \"\",\n \"OutputS3BucketName\": \"\",\n \"OutputS3KeyPrefix\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"ServiceRoleArn\": \"\",\n \"NotificationConfig\": \"\",\n \"CloudWatchOutputConfig\": \"\",\n \"AlarmConfiguration\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.SendCommand"
payload := strings.NewReader("{\n \"InstanceIds\": \"\",\n \"Targets\": \"\",\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentHash\": \"\",\n \"DocumentHashType\": \"\",\n \"TimeoutSeconds\": \"\",\n \"Comment\": \"\",\n \"Parameters\": \"\",\n \"OutputS3Region\": \"\",\n \"OutputS3BucketName\": \"\",\n \"OutputS3KeyPrefix\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"ServiceRoleArn\": \"\",\n \"NotificationConfig\": \"\",\n \"CloudWatchOutputConfig\": \"\",\n \"AlarmConfiguration\": \"\"\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: 430
{
"InstanceIds": "",
"Targets": "",
"DocumentName": "",
"DocumentVersion": "",
"DocumentHash": "",
"DocumentHashType": "",
"TimeoutSeconds": "",
"Comment": "",
"Parameters": "",
"OutputS3Region": "",
"OutputS3BucketName": "",
"OutputS3KeyPrefix": "",
"MaxConcurrency": "",
"MaxErrors": "",
"ServiceRoleArn": "",
"NotificationConfig": "",
"CloudWatchOutputConfig": "",
"AlarmConfiguration": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.SendCommand")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"InstanceIds\": \"\",\n \"Targets\": \"\",\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentHash\": \"\",\n \"DocumentHashType\": \"\",\n \"TimeoutSeconds\": \"\",\n \"Comment\": \"\",\n \"Parameters\": \"\",\n \"OutputS3Region\": \"\",\n \"OutputS3BucketName\": \"\",\n \"OutputS3KeyPrefix\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"ServiceRoleArn\": \"\",\n \"NotificationConfig\": \"\",\n \"CloudWatchOutputConfig\": \"\",\n \"AlarmConfiguration\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.SendCommand"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"InstanceIds\": \"\",\n \"Targets\": \"\",\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentHash\": \"\",\n \"DocumentHashType\": \"\",\n \"TimeoutSeconds\": \"\",\n \"Comment\": \"\",\n \"Parameters\": \"\",\n \"OutputS3Region\": \"\",\n \"OutputS3BucketName\": \"\",\n \"OutputS3KeyPrefix\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"ServiceRoleArn\": \"\",\n \"NotificationConfig\": \"\",\n \"CloudWatchOutputConfig\": \"\",\n \"AlarmConfiguration\": \"\"\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 \"InstanceIds\": \"\",\n \"Targets\": \"\",\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentHash\": \"\",\n \"DocumentHashType\": \"\",\n \"TimeoutSeconds\": \"\",\n \"Comment\": \"\",\n \"Parameters\": \"\",\n \"OutputS3Region\": \"\",\n \"OutputS3BucketName\": \"\",\n \"OutputS3KeyPrefix\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"ServiceRoleArn\": \"\",\n \"NotificationConfig\": \"\",\n \"CloudWatchOutputConfig\": \"\",\n \"AlarmConfiguration\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.SendCommand")
.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=AmazonSSM.SendCommand")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"InstanceIds\": \"\",\n \"Targets\": \"\",\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentHash\": \"\",\n \"DocumentHashType\": \"\",\n \"TimeoutSeconds\": \"\",\n \"Comment\": \"\",\n \"Parameters\": \"\",\n \"OutputS3Region\": \"\",\n \"OutputS3BucketName\": \"\",\n \"OutputS3KeyPrefix\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"ServiceRoleArn\": \"\",\n \"NotificationConfig\": \"\",\n \"CloudWatchOutputConfig\": \"\",\n \"AlarmConfiguration\": \"\"\n}")
.asString();
const data = JSON.stringify({
InstanceIds: '',
Targets: '',
DocumentName: '',
DocumentVersion: '',
DocumentHash: '',
DocumentHashType: '',
TimeoutSeconds: '',
Comment: '',
Parameters: '',
OutputS3Region: '',
OutputS3BucketName: '',
OutputS3KeyPrefix: '',
MaxConcurrency: '',
MaxErrors: '',
ServiceRoleArn: '',
NotificationConfig: '',
CloudWatchOutputConfig: '',
AlarmConfiguration: ''
});
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=AmazonSSM.SendCommand');
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=AmazonSSM.SendCommand',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
InstanceIds: '',
Targets: '',
DocumentName: '',
DocumentVersion: '',
DocumentHash: '',
DocumentHashType: '',
TimeoutSeconds: '',
Comment: '',
Parameters: '',
OutputS3Region: '',
OutputS3BucketName: '',
OutputS3KeyPrefix: '',
MaxConcurrency: '',
MaxErrors: '',
ServiceRoleArn: '',
NotificationConfig: '',
CloudWatchOutputConfig: '',
AlarmConfiguration: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.SendCommand';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceIds":"","Targets":"","DocumentName":"","DocumentVersion":"","DocumentHash":"","DocumentHashType":"","TimeoutSeconds":"","Comment":"","Parameters":"","OutputS3Region":"","OutputS3BucketName":"","OutputS3KeyPrefix":"","MaxConcurrency":"","MaxErrors":"","ServiceRoleArn":"","NotificationConfig":"","CloudWatchOutputConfig":"","AlarmConfiguration":""}'
};
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=AmazonSSM.SendCommand',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "InstanceIds": "",\n "Targets": "",\n "DocumentName": "",\n "DocumentVersion": "",\n "DocumentHash": "",\n "DocumentHashType": "",\n "TimeoutSeconds": "",\n "Comment": "",\n "Parameters": "",\n "OutputS3Region": "",\n "OutputS3BucketName": "",\n "OutputS3KeyPrefix": "",\n "MaxConcurrency": "",\n "MaxErrors": "",\n "ServiceRoleArn": "",\n "NotificationConfig": "",\n "CloudWatchOutputConfig": "",\n "AlarmConfiguration": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"InstanceIds\": \"\",\n \"Targets\": \"\",\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentHash\": \"\",\n \"DocumentHashType\": \"\",\n \"TimeoutSeconds\": \"\",\n \"Comment\": \"\",\n \"Parameters\": \"\",\n \"OutputS3Region\": \"\",\n \"OutputS3BucketName\": \"\",\n \"OutputS3KeyPrefix\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"ServiceRoleArn\": \"\",\n \"NotificationConfig\": \"\",\n \"CloudWatchOutputConfig\": \"\",\n \"AlarmConfiguration\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.SendCommand")
.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({
InstanceIds: '',
Targets: '',
DocumentName: '',
DocumentVersion: '',
DocumentHash: '',
DocumentHashType: '',
TimeoutSeconds: '',
Comment: '',
Parameters: '',
OutputS3Region: '',
OutputS3BucketName: '',
OutputS3KeyPrefix: '',
MaxConcurrency: '',
MaxErrors: '',
ServiceRoleArn: '',
NotificationConfig: '',
CloudWatchOutputConfig: '',
AlarmConfiguration: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.SendCommand',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
InstanceIds: '',
Targets: '',
DocumentName: '',
DocumentVersion: '',
DocumentHash: '',
DocumentHashType: '',
TimeoutSeconds: '',
Comment: '',
Parameters: '',
OutputS3Region: '',
OutputS3BucketName: '',
OutputS3KeyPrefix: '',
MaxConcurrency: '',
MaxErrors: '',
ServiceRoleArn: '',
NotificationConfig: '',
CloudWatchOutputConfig: '',
AlarmConfiguration: ''
},
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=AmazonSSM.SendCommand');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
InstanceIds: '',
Targets: '',
DocumentName: '',
DocumentVersion: '',
DocumentHash: '',
DocumentHashType: '',
TimeoutSeconds: '',
Comment: '',
Parameters: '',
OutputS3Region: '',
OutputS3BucketName: '',
OutputS3KeyPrefix: '',
MaxConcurrency: '',
MaxErrors: '',
ServiceRoleArn: '',
NotificationConfig: '',
CloudWatchOutputConfig: '',
AlarmConfiguration: ''
});
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=AmazonSSM.SendCommand',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
InstanceIds: '',
Targets: '',
DocumentName: '',
DocumentVersion: '',
DocumentHash: '',
DocumentHashType: '',
TimeoutSeconds: '',
Comment: '',
Parameters: '',
OutputS3Region: '',
OutputS3BucketName: '',
OutputS3KeyPrefix: '',
MaxConcurrency: '',
MaxErrors: '',
ServiceRoleArn: '',
NotificationConfig: '',
CloudWatchOutputConfig: '',
AlarmConfiguration: ''
}
};
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=AmazonSSM.SendCommand';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceIds":"","Targets":"","DocumentName":"","DocumentVersion":"","DocumentHash":"","DocumentHashType":"","TimeoutSeconds":"","Comment":"","Parameters":"","OutputS3Region":"","OutputS3BucketName":"","OutputS3KeyPrefix":"","MaxConcurrency":"","MaxErrors":"","ServiceRoleArn":"","NotificationConfig":"","CloudWatchOutputConfig":"","AlarmConfiguration":""}'
};
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 = @{ @"InstanceIds": @"",
@"Targets": @"",
@"DocumentName": @"",
@"DocumentVersion": @"",
@"DocumentHash": @"",
@"DocumentHashType": @"",
@"TimeoutSeconds": @"",
@"Comment": @"",
@"Parameters": @"",
@"OutputS3Region": @"",
@"OutputS3BucketName": @"",
@"OutputS3KeyPrefix": @"",
@"MaxConcurrency": @"",
@"MaxErrors": @"",
@"ServiceRoleArn": @"",
@"NotificationConfig": @"",
@"CloudWatchOutputConfig": @"",
@"AlarmConfiguration": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.SendCommand"]
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=AmazonSSM.SendCommand" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"InstanceIds\": \"\",\n \"Targets\": \"\",\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentHash\": \"\",\n \"DocumentHashType\": \"\",\n \"TimeoutSeconds\": \"\",\n \"Comment\": \"\",\n \"Parameters\": \"\",\n \"OutputS3Region\": \"\",\n \"OutputS3BucketName\": \"\",\n \"OutputS3KeyPrefix\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"ServiceRoleArn\": \"\",\n \"NotificationConfig\": \"\",\n \"CloudWatchOutputConfig\": \"\",\n \"AlarmConfiguration\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.SendCommand",
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([
'InstanceIds' => '',
'Targets' => '',
'DocumentName' => '',
'DocumentVersion' => '',
'DocumentHash' => '',
'DocumentHashType' => '',
'TimeoutSeconds' => '',
'Comment' => '',
'Parameters' => '',
'OutputS3Region' => '',
'OutputS3BucketName' => '',
'OutputS3KeyPrefix' => '',
'MaxConcurrency' => '',
'MaxErrors' => '',
'ServiceRoleArn' => '',
'NotificationConfig' => '',
'CloudWatchOutputConfig' => '',
'AlarmConfiguration' => ''
]),
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=AmazonSSM.SendCommand', [
'body' => '{
"InstanceIds": "",
"Targets": "",
"DocumentName": "",
"DocumentVersion": "",
"DocumentHash": "",
"DocumentHashType": "",
"TimeoutSeconds": "",
"Comment": "",
"Parameters": "",
"OutputS3Region": "",
"OutputS3BucketName": "",
"OutputS3KeyPrefix": "",
"MaxConcurrency": "",
"MaxErrors": "",
"ServiceRoleArn": "",
"NotificationConfig": "",
"CloudWatchOutputConfig": "",
"AlarmConfiguration": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.SendCommand');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'InstanceIds' => '',
'Targets' => '',
'DocumentName' => '',
'DocumentVersion' => '',
'DocumentHash' => '',
'DocumentHashType' => '',
'TimeoutSeconds' => '',
'Comment' => '',
'Parameters' => '',
'OutputS3Region' => '',
'OutputS3BucketName' => '',
'OutputS3KeyPrefix' => '',
'MaxConcurrency' => '',
'MaxErrors' => '',
'ServiceRoleArn' => '',
'NotificationConfig' => '',
'CloudWatchOutputConfig' => '',
'AlarmConfiguration' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'InstanceIds' => '',
'Targets' => '',
'DocumentName' => '',
'DocumentVersion' => '',
'DocumentHash' => '',
'DocumentHashType' => '',
'TimeoutSeconds' => '',
'Comment' => '',
'Parameters' => '',
'OutputS3Region' => '',
'OutputS3BucketName' => '',
'OutputS3KeyPrefix' => '',
'MaxConcurrency' => '',
'MaxErrors' => '',
'ServiceRoleArn' => '',
'NotificationConfig' => '',
'CloudWatchOutputConfig' => '',
'AlarmConfiguration' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.SendCommand');
$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=AmazonSSM.SendCommand' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceIds": "",
"Targets": "",
"DocumentName": "",
"DocumentVersion": "",
"DocumentHash": "",
"DocumentHashType": "",
"TimeoutSeconds": "",
"Comment": "",
"Parameters": "",
"OutputS3Region": "",
"OutputS3BucketName": "",
"OutputS3KeyPrefix": "",
"MaxConcurrency": "",
"MaxErrors": "",
"ServiceRoleArn": "",
"NotificationConfig": "",
"CloudWatchOutputConfig": "",
"AlarmConfiguration": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.SendCommand' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceIds": "",
"Targets": "",
"DocumentName": "",
"DocumentVersion": "",
"DocumentHash": "",
"DocumentHashType": "",
"TimeoutSeconds": "",
"Comment": "",
"Parameters": "",
"OutputS3Region": "",
"OutputS3BucketName": "",
"OutputS3KeyPrefix": "",
"MaxConcurrency": "",
"MaxErrors": "",
"ServiceRoleArn": "",
"NotificationConfig": "",
"CloudWatchOutputConfig": "",
"AlarmConfiguration": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"InstanceIds\": \"\",\n \"Targets\": \"\",\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentHash\": \"\",\n \"DocumentHashType\": \"\",\n \"TimeoutSeconds\": \"\",\n \"Comment\": \"\",\n \"Parameters\": \"\",\n \"OutputS3Region\": \"\",\n \"OutputS3BucketName\": \"\",\n \"OutputS3KeyPrefix\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"ServiceRoleArn\": \"\",\n \"NotificationConfig\": \"\",\n \"CloudWatchOutputConfig\": \"\",\n \"AlarmConfiguration\": \"\"\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=AmazonSSM.SendCommand"
payload = {
"InstanceIds": "",
"Targets": "",
"DocumentName": "",
"DocumentVersion": "",
"DocumentHash": "",
"DocumentHashType": "",
"TimeoutSeconds": "",
"Comment": "",
"Parameters": "",
"OutputS3Region": "",
"OutputS3BucketName": "",
"OutputS3KeyPrefix": "",
"MaxConcurrency": "",
"MaxErrors": "",
"ServiceRoleArn": "",
"NotificationConfig": "",
"CloudWatchOutputConfig": "",
"AlarmConfiguration": ""
}
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=AmazonSSM.SendCommand"
payload <- "{\n \"InstanceIds\": \"\",\n \"Targets\": \"\",\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentHash\": \"\",\n \"DocumentHashType\": \"\",\n \"TimeoutSeconds\": \"\",\n \"Comment\": \"\",\n \"Parameters\": \"\",\n \"OutputS3Region\": \"\",\n \"OutputS3BucketName\": \"\",\n \"OutputS3KeyPrefix\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"ServiceRoleArn\": \"\",\n \"NotificationConfig\": \"\",\n \"CloudWatchOutputConfig\": \"\",\n \"AlarmConfiguration\": \"\"\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=AmazonSSM.SendCommand")
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 \"InstanceIds\": \"\",\n \"Targets\": \"\",\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentHash\": \"\",\n \"DocumentHashType\": \"\",\n \"TimeoutSeconds\": \"\",\n \"Comment\": \"\",\n \"Parameters\": \"\",\n \"OutputS3Region\": \"\",\n \"OutputS3BucketName\": \"\",\n \"OutputS3KeyPrefix\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"ServiceRoleArn\": \"\",\n \"NotificationConfig\": \"\",\n \"CloudWatchOutputConfig\": \"\",\n \"AlarmConfiguration\": \"\"\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 \"InstanceIds\": \"\",\n \"Targets\": \"\",\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentHash\": \"\",\n \"DocumentHashType\": \"\",\n \"TimeoutSeconds\": \"\",\n \"Comment\": \"\",\n \"Parameters\": \"\",\n \"OutputS3Region\": \"\",\n \"OutputS3BucketName\": \"\",\n \"OutputS3KeyPrefix\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"ServiceRoleArn\": \"\",\n \"NotificationConfig\": \"\",\n \"CloudWatchOutputConfig\": \"\",\n \"AlarmConfiguration\": \"\"\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=AmazonSSM.SendCommand";
let payload = json!({
"InstanceIds": "",
"Targets": "",
"DocumentName": "",
"DocumentVersion": "",
"DocumentHash": "",
"DocumentHashType": "",
"TimeoutSeconds": "",
"Comment": "",
"Parameters": "",
"OutputS3Region": "",
"OutputS3BucketName": "",
"OutputS3KeyPrefix": "",
"MaxConcurrency": "",
"MaxErrors": "",
"ServiceRoleArn": "",
"NotificationConfig": "",
"CloudWatchOutputConfig": "",
"AlarmConfiguration": ""
});
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=AmazonSSM.SendCommand' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"InstanceIds": "",
"Targets": "",
"DocumentName": "",
"DocumentVersion": "",
"DocumentHash": "",
"DocumentHashType": "",
"TimeoutSeconds": "",
"Comment": "",
"Parameters": "",
"OutputS3Region": "",
"OutputS3BucketName": "",
"OutputS3KeyPrefix": "",
"MaxConcurrency": "",
"MaxErrors": "",
"ServiceRoleArn": "",
"NotificationConfig": "",
"CloudWatchOutputConfig": "",
"AlarmConfiguration": ""
}'
echo '{
"InstanceIds": "",
"Targets": "",
"DocumentName": "",
"DocumentVersion": "",
"DocumentHash": "",
"DocumentHashType": "",
"TimeoutSeconds": "",
"Comment": "",
"Parameters": "",
"OutputS3Region": "",
"OutputS3BucketName": "",
"OutputS3KeyPrefix": "",
"MaxConcurrency": "",
"MaxErrors": "",
"ServiceRoleArn": "",
"NotificationConfig": "",
"CloudWatchOutputConfig": "",
"AlarmConfiguration": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.SendCommand' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "InstanceIds": "",\n "Targets": "",\n "DocumentName": "",\n "DocumentVersion": "",\n "DocumentHash": "",\n "DocumentHashType": "",\n "TimeoutSeconds": "",\n "Comment": "",\n "Parameters": "",\n "OutputS3Region": "",\n "OutputS3BucketName": "",\n "OutputS3KeyPrefix": "",\n "MaxConcurrency": "",\n "MaxErrors": "",\n "ServiceRoleArn": "",\n "NotificationConfig": "",\n "CloudWatchOutputConfig": "",\n "AlarmConfiguration": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.SendCommand'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"InstanceIds": "",
"Targets": "",
"DocumentName": "",
"DocumentVersion": "",
"DocumentHash": "",
"DocumentHashType": "",
"TimeoutSeconds": "",
"Comment": "",
"Parameters": "",
"OutputS3Region": "",
"OutputS3BucketName": "",
"OutputS3KeyPrefix": "",
"MaxConcurrency": "",
"MaxErrors": "",
"ServiceRoleArn": "",
"NotificationConfig": "",
"CloudWatchOutputConfig": "",
"AlarmConfiguration": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.SendCommand")! 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
StartAssociationsOnce
{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartAssociationsOnce
HEADERS
X-Amz-Target
BODY json
{
"AssociationIds": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartAssociationsOnce");
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 \"AssociationIds\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartAssociationsOnce" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:AssociationIds ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartAssociationsOnce"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"AssociationIds\": \"\"\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=AmazonSSM.StartAssociationsOnce"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"AssociationIds\": \"\"\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=AmazonSSM.StartAssociationsOnce");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AssociationIds\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartAssociationsOnce"
payload := strings.NewReader("{\n \"AssociationIds\": \"\"\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: 26
{
"AssociationIds": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartAssociationsOnce")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"AssociationIds\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartAssociationsOnce"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AssociationIds\": \"\"\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 \"AssociationIds\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartAssociationsOnce")
.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=AmazonSSM.StartAssociationsOnce")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"AssociationIds\": \"\"\n}")
.asString();
const data = JSON.stringify({
AssociationIds: ''
});
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=AmazonSSM.StartAssociationsOnce');
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=AmazonSSM.StartAssociationsOnce',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AssociationIds: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartAssociationsOnce';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AssociationIds":""}'
};
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=AmazonSSM.StartAssociationsOnce',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "AssociationIds": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AssociationIds\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartAssociationsOnce")
.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({AssociationIds: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartAssociationsOnce',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {AssociationIds: ''},
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=AmazonSSM.StartAssociationsOnce');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
AssociationIds: ''
});
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=AmazonSSM.StartAssociationsOnce',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AssociationIds: ''}
};
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=AmazonSSM.StartAssociationsOnce';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AssociationIds":""}'
};
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 = @{ @"AssociationIds": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartAssociationsOnce"]
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=AmazonSSM.StartAssociationsOnce" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"AssociationIds\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartAssociationsOnce",
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([
'AssociationIds' => ''
]),
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=AmazonSSM.StartAssociationsOnce', [
'body' => '{
"AssociationIds": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartAssociationsOnce');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AssociationIds' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AssociationIds' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartAssociationsOnce');
$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=AmazonSSM.StartAssociationsOnce' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AssociationIds": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartAssociationsOnce' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AssociationIds": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AssociationIds\": \"\"\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=AmazonSSM.StartAssociationsOnce"
payload = { "AssociationIds": "" }
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=AmazonSSM.StartAssociationsOnce"
payload <- "{\n \"AssociationIds\": \"\"\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=AmazonSSM.StartAssociationsOnce")
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 \"AssociationIds\": \"\"\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 \"AssociationIds\": \"\"\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=AmazonSSM.StartAssociationsOnce";
let payload = json!({"AssociationIds": ""});
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=AmazonSSM.StartAssociationsOnce' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"AssociationIds": ""
}'
echo '{
"AssociationIds": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartAssociationsOnce' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "AssociationIds": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartAssociationsOnce'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["AssociationIds": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartAssociationsOnce")! 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
StartAutomationExecution
{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartAutomationExecution
HEADERS
X-Amz-Target
BODY json
{
"DocumentName": "",
"DocumentVersion": "",
"Parameters": "",
"ClientToken": "",
"Mode": "",
"TargetParameterName": "",
"Targets": "",
"TargetMaps": "",
"MaxConcurrency": "",
"MaxErrors": "",
"TargetLocations": "",
"Tags": "",
"AlarmConfiguration": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartAutomationExecution");
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 \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"Parameters\": \"\",\n \"ClientToken\": \"\",\n \"Mode\": \"\",\n \"TargetParameterName\": \"\",\n \"Targets\": \"\",\n \"TargetMaps\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"TargetLocations\": \"\",\n \"Tags\": \"\",\n \"AlarmConfiguration\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartAutomationExecution" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DocumentName ""
:DocumentVersion ""
:Parameters ""
:ClientToken ""
:Mode ""
:TargetParameterName ""
:Targets ""
:TargetMaps ""
:MaxConcurrency ""
:MaxErrors ""
:TargetLocations ""
:Tags ""
:AlarmConfiguration ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartAutomationExecution"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"Parameters\": \"\",\n \"ClientToken\": \"\",\n \"Mode\": \"\",\n \"TargetParameterName\": \"\",\n \"Targets\": \"\",\n \"TargetMaps\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"TargetLocations\": \"\",\n \"Tags\": \"\",\n \"AlarmConfiguration\": \"\"\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=AmazonSSM.StartAutomationExecution"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"Parameters\": \"\",\n \"ClientToken\": \"\",\n \"Mode\": \"\",\n \"TargetParameterName\": \"\",\n \"Targets\": \"\",\n \"TargetMaps\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"TargetLocations\": \"\",\n \"Tags\": \"\",\n \"AlarmConfiguration\": \"\"\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=AmazonSSM.StartAutomationExecution");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"Parameters\": \"\",\n \"ClientToken\": \"\",\n \"Mode\": \"\",\n \"TargetParameterName\": \"\",\n \"Targets\": \"\",\n \"TargetMaps\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"TargetLocations\": \"\",\n \"Tags\": \"\",\n \"AlarmConfiguration\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartAutomationExecution"
payload := strings.NewReader("{\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"Parameters\": \"\",\n \"ClientToken\": \"\",\n \"Mode\": \"\",\n \"TargetParameterName\": \"\",\n \"Targets\": \"\",\n \"TargetMaps\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"TargetLocations\": \"\",\n \"Tags\": \"\",\n \"AlarmConfiguration\": \"\"\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: 280
{
"DocumentName": "",
"DocumentVersion": "",
"Parameters": "",
"ClientToken": "",
"Mode": "",
"TargetParameterName": "",
"Targets": "",
"TargetMaps": "",
"MaxConcurrency": "",
"MaxErrors": "",
"TargetLocations": "",
"Tags": "",
"AlarmConfiguration": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartAutomationExecution")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"Parameters\": \"\",\n \"ClientToken\": \"\",\n \"Mode\": \"\",\n \"TargetParameterName\": \"\",\n \"Targets\": \"\",\n \"TargetMaps\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"TargetLocations\": \"\",\n \"Tags\": \"\",\n \"AlarmConfiguration\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartAutomationExecution"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"Parameters\": \"\",\n \"ClientToken\": \"\",\n \"Mode\": \"\",\n \"TargetParameterName\": \"\",\n \"Targets\": \"\",\n \"TargetMaps\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"TargetLocations\": \"\",\n \"Tags\": \"\",\n \"AlarmConfiguration\": \"\"\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 \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"Parameters\": \"\",\n \"ClientToken\": \"\",\n \"Mode\": \"\",\n \"TargetParameterName\": \"\",\n \"Targets\": \"\",\n \"TargetMaps\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"TargetLocations\": \"\",\n \"Tags\": \"\",\n \"AlarmConfiguration\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartAutomationExecution")
.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=AmazonSSM.StartAutomationExecution")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"Parameters\": \"\",\n \"ClientToken\": \"\",\n \"Mode\": \"\",\n \"TargetParameterName\": \"\",\n \"Targets\": \"\",\n \"TargetMaps\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"TargetLocations\": \"\",\n \"Tags\": \"\",\n \"AlarmConfiguration\": \"\"\n}")
.asString();
const data = JSON.stringify({
DocumentName: '',
DocumentVersion: '',
Parameters: '',
ClientToken: '',
Mode: '',
TargetParameterName: '',
Targets: '',
TargetMaps: '',
MaxConcurrency: '',
MaxErrors: '',
TargetLocations: '',
Tags: '',
AlarmConfiguration: ''
});
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=AmazonSSM.StartAutomationExecution');
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=AmazonSSM.StartAutomationExecution',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
DocumentName: '',
DocumentVersion: '',
Parameters: '',
ClientToken: '',
Mode: '',
TargetParameterName: '',
Targets: '',
TargetMaps: '',
MaxConcurrency: '',
MaxErrors: '',
TargetLocations: '',
Tags: '',
AlarmConfiguration: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartAutomationExecution';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DocumentName":"","DocumentVersion":"","Parameters":"","ClientToken":"","Mode":"","TargetParameterName":"","Targets":"","TargetMaps":"","MaxConcurrency":"","MaxErrors":"","TargetLocations":"","Tags":"","AlarmConfiguration":""}'
};
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=AmazonSSM.StartAutomationExecution',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DocumentName": "",\n "DocumentVersion": "",\n "Parameters": "",\n "ClientToken": "",\n "Mode": "",\n "TargetParameterName": "",\n "Targets": "",\n "TargetMaps": "",\n "MaxConcurrency": "",\n "MaxErrors": "",\n "TargetLocations": "",\n "Tags": "",\n "AlarmConfiguration": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"Parameters\": \"\",\n \"ClientToken\": \"\",\n \"Mode\": \"\",\n \"TargetParameterName\": \"\",\n \"Targets\": \"\",\n \"TargetMaps\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"TargetLocations\": \"\",\n \"Tags\": \"\",\n \"AlarmConfiguration\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartAutomationExecution")
.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({
DocumentName: '',
DocumentVersion: '',
Parameters: '',
ClientToken: '',
Mode: '',
TargetParameterName: '',
Targets: '',
TargetMaps: '',
MaxConcurrency: '',
MaxErrors: '',
TargetLocations: '',
Tags: '',
AlarmConfiguration: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartAutomationExecution',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
DocumentName: '',
DocumentVersion: '',
Parameters: '',
ClientToken: '',
Mode: '',
TargetParameterName: '',
Targets: '',
TargetMaps: '',
MaxConcurrency: '',
MaxErrors: '',
TargetLocations: '',
Tags: '',
AlarmConfiguration: ''
},
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=AmazonSSM.StartAutomationExecution');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DocumentName: '',
DocumentVersion: '',
Parameters: '',
ClientToken: '',
Mode: '',
TargetParameterName: '',
Targets: '',
TargetMaps: '',
MaxConcurrency: '',
MaxErrors: '',
TargetLocations: '',
Tags: '',
AlarmConfiguration: ''
});
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=AmazonSSM.StartAutomationExecution',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
DocumentName: '',
DocumentVersion: '',
Parameters: '',
ClientToken: '',
Mode: '',
TargetParameterName: '',
Targets: '',
TargetMaps: '',
MaxConcurrency: '',
MaxErrors: '',
TargetLocations: '',
Tags: '',
AlarmConfiguration: ''
}
};
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=AmazonSSM.StartAutomationExecution';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DocumentName":"","DocumentVersion":"","Parameters":"","ClientToken":"","Mode":"","TargetParameterName":"","Targets":"","TargetMaps":"","MaxConcurrency":"","MaxErrors":"","TargetLocations":"","Tags":"","AlarmConfiguration":""}'
};
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 = @{ @"DocumentName": @"",
@"DocumentVersion": @"",
@"Parameters": @"",
@"ClientToken": @"",
@"Mode": @"",
@"TargetParameterName": @"",
@"Targets": @"",
@"TargetMaps": @"",
@"MaxConcurrency": @"",
@"MaxErrors": @"",
@"TargetLocations": @"",
@"Tags": @"",
@"AlarmConfiguration": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartAutomationExecution"]
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=AmazonSSM.StartAutomationExecution" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"Parameters\": \"\",\n \"ClientToken\": \"\",\n \"Mode\": \"\",\n \"TargetParameterName\": \"\",\n \"Targets\": \"\",\n \"TargetMaps\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"TargetLocations\": \"\",\n \"Tags\": \"\",\n \"AlarmConfiguration\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartAutomationExecution",
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([
'DocumentName' => '',
'DocumentVersion' => '',
'Parameters' => '',
'ClientToken' => '',
'Mode' => '',
'TargetParameterName' => '',
'Targets' => '',
'TargetMaps' => '',
'MaxConcurrency' => '',
'MaxErrors' => '',
'TargetLocations' => '',
'Tags' => '',
'AlarmConfiguration' => ''
]),
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=AmazonSSM.StartAutomationExecution', [
'body' => '{
"DocumentName": "",
"DocumentVersion": "",
"Parameters": "",
"ClientToken": "",
"Mode": "",
"TargetParameterName": "",
"Targets": "",
"TargetMaps": "",
"MaxConcurrency": "",
"MaxErrors": "",
"TargetLocations": "",
"Tags": "",
"AlarmConfiguration": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartAutomationExecution');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DocumentName' => '',
'DocumentVersion' => '',
'Parameters' => '',
'ClientToken' => '',
'Mode' => '',
'TargetParameterName' => '',
'Targets' => '',
'TargetMaps' => '',
'MaxConcurrency' => '',
'MaxErrors' => '',
'TargetLocations' => '',
'Tags' => '',
'AlarmConfiguration' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DocumentName' => '',
'DocumentVersion' => '',
'Parameters' => '',
'ClientToken' => '',
'Mode' => '',
'TargetParameterName' => '',
'Targets' => '',
'TargetMaps' => '',
'MaxConcurrency' => '',
'MaxErrors' => '',
'TargetLocations' => '',
'Tags' => '',
'AlarmConfiguration' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartAutomationExecution');
$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=AmazonSSM.StartAutomationExecution' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DocumentName": "",
"DocumentVersion": "",
"Parameters": "",
"ClientToken": "",
"Mode": "",
"TargetParameterName": "",
"Targets": "",
"TargetMaps": "",
"MaxConcurrency": "",
"MaxErrors": "",
"TargetLocations": "",
"Tags": "",
"AlarmConfiguration": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartAutomationExecution' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DocumentName": "",
"DocumentVersion": "",
"Parameters": "",
"ClientToken": "",
"Mode": "",
"TargetParameterName": "",
"Targets": "",
"TargetMaps": "",
"MaxConcurrency": "",
"MaxErrors": "",
"TargetLocations": "",
"Tags": "",
"AlarmConfiguration": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"Parameters\": \"\",\n \"ClientToken\": \"\",\n \"Mode\": \"\",\n \"TargetParameterName\": \"\",\n \"Targets\": \"\",\n \"TargetMaps\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"TargetLocations\": \"\",\n \"Tags\": \"\",\n \"AlarmConfiguration\": \"\"\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=AmazonSSM.StartAutomationExecution"
payload = {
"DocumentName": "",
"DocumentVersion": "",
"Parameters": "",
"ClientToken": "",
"Mode": "",
"TargetParameterName": "",
"Targets": "",
"TargetMaps": "",
"MaxConcurrency": "",
"MaxErrors": "",
"TargetLocations": "",
"Tags": "",
"AlarmConfiguration": ""
}
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=AmazonSSM.StartAutomationExecution"
payload <- "{\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"Parameters\": \"\",\n \"ClientToken\": \"\",\n \"Mode\": \"\",\n \"TargetParameterName\": \"\",\n \"Targets\": \"\",\n \"TargetMaps\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"TargetLocations\": \"\",\n \"Tags\": \"\",\n \"AlarmConfiguration\": \"\"\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=AmazonSSM.StartAutomationExecution")
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 \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"Parameters\": \"\",\n \"ClientToken\": \"\",\n \"Mode\": \"\",\n \"TargetParameterName\": \"\",\n \"Targets\": \"\",\n \"TargetMaps\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"TargetLocations\": \"\",\n \"Tags\": \"\",\n \"AlarmConfiguration\": \"\"\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 \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"Parameters\": \"\",\n \"ClientToken\": \"\",\n \"Mode\": \"\",\n \"TargetParameterName\": \"\",\n \"Targets\": \"\",\n \"TargetMaps\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"TargetLocations\": \"\",\n \"Tags\": \"\",\n \"AlarmConfiguration\": \"\"\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=AmazonSSM.StartAutomationExecution";
let payload = json!({
"DocumentName": "",
"DocumentVersion": "",
"Parameters": "",
"ClientToken": "",
"Mode": "",
"TargetParameterName": "",
"Targets": "",
"TargetMaps": "",
"MaxConcurrency": "",
"MaxErrors": "",
"TargetLocations": "",
"Tags": "",
"AlarmConfiguration": ""
});
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=AmazonSSM.StartAutomationExecution' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DocumentName": "",
"DocumentVersion": "",
"Parameters": "",
"ClientToken": "",
"Mode": "",
"TargetParameterName": "",
"Targets": "",
"TargetMaps": "",
"MaxConcurrency": "",
"MaxErrors": "",
"TargetLocations": "",
"Tags": "",
"AlarmConfiguration": ""
}'
echo '{
"DocumentName": "",
"DocumentVersion": "",
"Parameters": "",
"ClientToken": "",
"Mode": "",
"TargetParameterName": "",
"Targets": "",
"TargetMaps": "",
"MaxConcurrency": "",
"MaxErrors": "",
"TargetLocations": "",
"Tags": "",
"AlarmConfiguration": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartAutomationExecution' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DocumentName": "",\n "DocumentVersion": "",\n "Parameters": "",\n "ClientToken": "",\n "Mode": "",\n "TargetParameterName": "",\n "Targets": "",\n "TargetMaps": "",\n "MaxConcurrency": "",\n "MaxErrors": "",\n "TargetLocations": "",\n "Tags": "",\n "AlarmConfiguration": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartAutomationExecution'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DocumentName": "",
"DocumentVersion": "",
"Parameters": "",
"ClientToken": "",
"Mode": "",
"TargetParameterName": "",
"Targets": "",
"TargetMaps": "",
"MaxConcurrency": "",
"MaxErrors": "",
"TargetLocations": "",
"Tags": "",
"AlarmConfiguration": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartAutomationExecution")! 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
StartChangeRequestExecution
{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartChangeRequestExecution
HEADERS
X-Amz-Target
BODY json
{
"ScheduledTime": "",
"DocumentName": "",
"DocumentVersion": "",
"Parameters": "",
"ChangeRequestName": "",
"ClientToken": "",
"AutoApprove": "",
"Runbooks": "",
"Tags": "",
"ScheduledEndTime": "",
"ChangeDetails": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartChangeRequestExecution");
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 \"ScheduledTime\": \"\",\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"Parameters\": \"\",\n \"ChangeRequestName\": \"\",\n \"ClientToken\": \"\",\n \"AutoApprove\": \"\",\n \"Runbooks\": \"\",\n \"Tags\": \"\",\n \"ScheduledEndTime\": \"\",\n \"ChangeDetails\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartChangeRequestExecution" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ScheduledTime ""
:DocumentName ""
:DocumentVersion ""
:Parameters ""
:ChangeRequestName ""
:ClientToken ""
:AutoApprove ""
:Runbooks ""
:Tags ""
:ScheduledEndTime ""
:ChangeDetails ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartChangeRequestExecution"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ScheduledTime\": \"\",\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"Parameters\": \"\",\n \"ChangeRequestName\": \"\",\n \"ClientToken\": \"\",\n \"AutoApprove\": \"\",\n \"Runbooks\": \"\",\n \"Tags\": \"\",\n \"ScheduledEndTime\": \"\",\n \"ChangeDetails\": \"\"\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=AmazonSSM.StartChangeRequestExecution"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ScheduledTime\": \"\",\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"Parameters\": \"\",\n \"ChangeRequestName\": \"\",\n \"ClientToken\": \"\",\n \"AutoApprove\": \"\",\n \"Runbooks\": \"\",\n \"Tags\": \"\",\n \"ScheduledEndTime\": \"\",\n \"ChangeDetails\": \"\"\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=AmazonSSM.StartChangeRequestExecution");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ScheduledTime\": \"\",\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"Parameters\": \"\",\n \"ChangeRequestName\": \"\",\n \"ClientToken\": \"\",\n \"AutoApprove\": \"\",\n \"Runbooks\": \"\",\n \"Tags\": \"\",\n \"ScheduledEndTime\": \"\",\n \"ChangeDetails\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartChangeRequestExecution"
payload := strings.NewReader("{\n \"ScheduledTime\": \"\",\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"Parameters\": \"\",\n \"ChangeRequestName\": \"\",\n \"ClientToken\": \"\",\n \"AutoApprove\": \"\",\n \"Runbooks\": \"\",\n \"Tags\": \"\",\n \"ScheduledEndTime\": \"\",\n \"ChangeDetails\": \"\"\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: 242
{
"ScheduledTime": "",
"DocumentName": "",
"DocumentVersion": "",
"Parameters": "",
"ChangeRequestName": "",
"ClientToken": "",
"AutoApprove": "",
"Runbooks": "",
"Tags": "",
"ScheduledEndTime": "",
"ChangeDetails": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartChangeRequestExecution")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ScheduledTime\": \"\",\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"Parameters\": \"\",\n \"ChangeRequestName\": \"\",\n \"ClientToken\": \"\",\n \"AutoApprove\": \"\",\n \"Runbooks\": \"\",\n \"Tags\": \"\",\n \"ScheduledEndTime\": \"\",\n \"ChangeDetails\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartChangeRequestExecution"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ScheduledTime\": \"\",\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"Parameters\": \"\",\n \"ChangeRequestName\": \"\",\n \"ClientToken\": \"\",\n \"AutoApprove\": \"\",\n \"Runbooks\": \"\",\n \"Tags\": \"\",\n \"ScheduledEndTime\": \"\",\n \"ChangeDetails\": \"\"\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 \"ScheduledTime\": \"\",\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"Parameters\": \"\",\n \"ChangeRequestName\": \"\",\n \"ClientToken\": \"\",\n \"AutoApprove\": \"\",\n \"Runbooks\": \"\",\n \"Tags\": \"\",\n \"ScheduledEndTime\": \"\",\n \"ChangeDetails\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartChangeRequestExecution")
.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=AmazonSSM.StartChangeRequestExecution")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ScheduledTime\": \"\",\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"Parameters\": \"\",\n \"ChangeRequestName\": \"\",\n \"ClientToken\": \"\",\n \"AutoApprove\": \"\",\n \"Runbooks\": \"\",\n \"Tags\": \"\",\n \"ScheduledEndTime\": \"\",\n \"ChangeDetails\": \"\"\n}")
.asString();
const data = JSON.stringify({
ScheduledTime: '',
DocumentName: '',
DocumentVersion: '',
Parameters: '',
ChangeRequestName: '',
ClientToken: '',
AutoApprove: '',
Runbooks: '',
Tags: '',
ScheduledEndTime: '',
ChangeDetails: ''
});
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=AmazonSSM.StartChangeRequestExecution');
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=AmazonSSM.StartChangeRequestExecution',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
ScheduledTime: '',
DocumentName: '',
DocumentVersion: '',
Parameters: '',
ChangeRequestName: '',
ClientToken: '',
AutoApprove: '',
Runbooks: '',
Tags: '',
ScheduledEndTime: '',
ChangeDetails: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartChangeRequestExecution';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ScheduledTime":"","DocumentName":"","DocumentVersion":"","Parameters":"","ChangeRequestName":"","ClientToken":"","AutoApprove":"","Runbooks":"","Tags":"","ScheduledEndTime":"","ChangeDetails":""}'
};
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=AmazonSSM.StartChangeRequestExecution',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ScheduledTime": "",\n "DocumentName": "",\n "DocumentVersion": "",\n "Parameters": "",\n "ChangeRequestName": "",\n "ClientToken": "",\n "AutoApprove": "",\n "Runbooks": "",\n "Tags": "",\n "ScheduledEndTime": "",\n "ChangeDetails": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ScheduledTime\": \"\",\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"Parameters\": \"\",\n \"ChangeRequestName\": \"\",\n \"ClientToken\": \"\",\n \"AutoApprove\": \"\",\n \"Runbooks\": \"\",\n \"Tags\": \"\",\n \"ScheduledEndTime\": \"\",\n \"ChangeDetails\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartChangeRequestExecution")
.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({
ScheduledTime: '',
DocumentName: '',
DocumentVersion: '',
Parameters: '',
ChangeRequestName: '',
ClientToken: '',
AutoApprove: '',
Runbooks: '',
Tags: '',
ScheduledEndTime: '',
ChangeDetails: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartChangeRequestExecution',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
ScheduledTime: '',
DocumentName: '',
DocumentVersion: '',
Parameters: '',
ChangeRequestName: '',
ClientToken: '',
AutoApprove: '',
Runbooks: '',
Tags: '',
ScheduledEndTime: '',
ChangeDetails: ''
},
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=AmazonSSM.StartChangeRequestExecution');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ScheduledTime: '',
DocumentName: '',
DocumentVersion: '',
Parameters: '',
ChangeRequestName: '',
ClientToken: '',
AutoApprove: '',
Runbooks: '',
Tags: '',
ScheduledEndTime: '',
ChangeDetails: ''
});
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=AmazonSSM.StartChangeRequestExecution',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
ScheduledTime: '',
DocumentName: '',
DocumentVersion: '',
Parameters: '',
ChangeRequestName: '',
ClientToken: '',
AutoApprove: '',
Runbooks: '',
Tags: '',
ScheduledEndTime: '',
ChangeDetails: ''
}
};
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=AmazonSSM.StartChangeRequestExecution';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ScheduledTime":"","DocumentName":"","DocumentVersion":"","Parameters":"","ChangeRequestName":"","ClientToken":"","AutoApprove":"","Runbooks":"","Tags":"","ScheduledEndTime":"","ChangeDetails":""}'
};
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 = @{ @"ScheduledTime": @"",
@"DocumentName": @"",
@"DocumentVersion": @"",
@"Parameters": @"",
@"ChangeRequestName": @"",
@"ClientToken": @"",
@"AutoApprove": @"",
@"Runbooks": @"",
@"Tags": @"",
@"ScheduledEndTime": @"",
@"ChangeDetails": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartChangeRequestExecution"]
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=AmazonSSM.StartChangeRequestExecution" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"ScheduledTime\": \"\",\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"Parameters\": \"\",\n \"ChangeRequestName\": \"\",\n \"ClientToken\": \"\",\n \"AutoApprove\": \"\",\n \"Runbooks\": \"\",\n \"Tags\": \"\",\n \"ScheduledEndTime\": \"\",\n \"ChangeDetails\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartChangeRequestExecution",
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([
'ScheduledTime' => '',
'DocumentName' => '',
'DocumentVersion' => '',
'Parameters' => '',
'ChangeRequestName' => '',
'ClientToken' => '',
'AutoApprove' => '',
'Runbooks' => '',
'Tags' => '',
'ScheduledEndTime' => '',
'ChangeDetails' => ''
]),
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=AmazonSSM.StartChangeRequestExecution', [
'body' => '{
"ScheduledTime": "",
"DocumentName": "",
"DocumentVersion": "",
"Parameters": "",
"ChangeRequestName": "",
"ClientToken": "",
"AutoApprove": "",
"Runbooks": "",
"Tags": "",
"ScheduledEndTime": "",
"ChangeDetails": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartChangeRequestExecution');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ScheduledTime' => '',
'DocumentName' => '',
'DocumentVersion' => '',
'Parameters' => '',
'ChangeRequestName' => '',
'ClientToken' => '',
'AutoApprove' => '',
'Runbooks' => '',
'Tags' => '',
'ScheduledEndTime' => '',
'ChangeDetails' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ScheduledTime' => '',
'DocumentName' => '',
'DocumentVersion' => '',
'Parameters' => '',
'ChangeRequestName' => '',
'ClientToken' => '',
'AutoApprove' => '',
'Runbooks' => '',
'Tags' => '',
'ScheduledEndTime' => '',
'ChangeDetails' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartChangeRequestExecution');
$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=AmazonSSM.StartChangeRequestExecution' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ScheduledTime": "",
"DocumentName": "",
"DocumentVersion": "",
"Parameters": "",
"ChangeRequestName": "",
"ClientToken": "",
"AutoApprove": "",
"Runbooks": "",
"Tags": "",
"ScheduledEndTime": "",
"ChangeDetails": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartChangeRequestExecution' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ScheduledTime": "",
"DocumentName": "",
"DocumentVersion": "",
"Parameters": "",
"ChangeRequestName": "",
"ClientToken": "",
"AutoApprove": "",
"Runbooks": "",
"Tags": "",
"ScheduledEndTime": "",
"ChangeDetails": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ScheduledTime\": \"\",\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"Parameters\": \"\",\n \"ChangeRequestName\": \"\",\n \"ClientToken\": \"\",\n \"AutoApprove\": \"\",\n \"Runbooks\": \"\",\n \"Tags\": \"\",\n \"ScheduledEndTime\": \"\",\n \"ChangeDetails\": \"\"\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=AmazonSSM.StartChangeRequestExecution"
payload = {
"ScheduledTime": "",
"DocumentName": "",
"DocumentVersion": "",
"Parameters": "",
"ChangeRequestName": "",
"ClientToken": "",
"AutoApprove": "",
"Runbooks": "",
"Tags": "",
"ScheduledEndTime": "",
"ChangeDetails": ""
}
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=AmazonSSM.StartChangeRequestExecution"
payload <- "{\n \"ScheduledTime\": \"\",\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"Parameters\": \"\",\n \"ChangeRequestName\": \"\",\n \"ClientToken\": \"\",\n \"AutoApprove\": \"\",\n \"Runbooks\": \"\",\n \"Tags\": \"\",\n \"ScheduledEndTime\": \"\",\n \"ChangeDetails\": \"\"\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=AmazonSSM.StartChangeRequestExecution")
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 \"ScheduledTime\": \"\",\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"Parameters\": \"\",\n \"ChangeRequestName\": \"\",\n \"ClientToken\": \"\",\n \"AutoApprove\": \"\",\n \"Runbooks\": \"\",\n \"Tags\": \"\",\n \"ScheduledEndTime\": \"\",\n \"ChangeDetails\": \"\"\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 \"ScheduledTime\": \"\",\n \"DocumentName\": \"\",\n \"DocumentVersion\": \"\",\n \"Parameters\": \"\",\n \"ChangeRequestName\": \"\",\n \"ClientToken\": \"\",\n \"AutoApprove\": \"\",\n \"Runbooks\": \"\",\n \"Tags\": \"\",\n \"ScheduledEndTime\": \"\",\n \"ChangeDetails\": \"\"\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=AmazonSSM.StartChangeRequestExecution";
let payload = json!({
"ScheduledTime": "",
"DocumentName": "",
"DocumentVersion": "",
"Parameters": "",
"ChangeRequestName": "",
"ClientToken": "",
"AutoApprove": "",
"Runbooks": "",
"Tags": "",
"ScheduledEndTime": "",
"ChangeDetails": ""
});
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=AmazonSSM.StartChangeRequestExecution' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ScheduledTime": "",
"DocumentName": "",
"DocumentVersion": "",
"Parameters": "",
"ChangeRequestName": "",
"ClientToken": "",
"AutoApprove": "",
"Runbooks": "",
"Tags": "",
"ScheduledEndTime": "",
"ChangeDetails": ""
}'
echo '{
"ScheduledTime": "",
"DocumentName": "",
"DocumentVersion": "",
"Parameters": "",
"ChangeRequestName": "",
"ClientToken": "",
"AutoApprove": "",
"Runbooks": "",
"Tags": "",
"ScheduledEndTime": "",
"ChangeDetails": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartChangeRequestExecution' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ScheduledTime": "",\n "DocumentName": "",\n "DocumentVersion": "",\n "Parameters": "",\n "ChangeRequestName": "",\n "ClientToken": "",\n "AutoApprove": "",\n "Runbooks": "",\n "Tags": "",\n "ScheduledEndTime": "",\n "ChangeDetails": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartChangeRequestExecution'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"ScheduledTime": "",
"DocumentName": "",
"DocumentVersion": "",
"Parameters": "",
"ChangeRequestName": "",
"ClientToken": "",
"AutoApprove": "",
"Runbooks": "",
"Tags": "",
"ScheduledEndTime": "",
"ChangeDetails": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartChangeRequestExecution")! 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
StartSession
{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartSession
HEADERS
X-Amz-Target
BODY json
{
"Target": "",
"DocumentName": "",
"Reason": "",
"Parameters": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartSession");
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 \"Target\": \"\",\n \"DocumentName\": \"\",\n \"Reason\": \"\",\n \"Parameters\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartSession" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Target ""
:DocumentName ""
:Reason ""
:Parameters ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartSession"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Target\": \"\",\n \"DocumentName\": \"\",\n \"Reason\": \"\",\n \"Parameters\": \"\"\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=AmazonSSM.StartSession"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Target\": \"\",\n \"DocumentName\": \"\",\n \"Reason\": \"\",\n \"Parameters\": \"\"\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=AmazonSSM.StartSession");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Target\": \"\",\n \"DocumentName\": \"\",\n \"Reason\": \"\",\n \"Parameters\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartSession"
payload := strings.NewReader("{\n \"Target\": \"\",\n \"DocumentName\": \"\",\n \"Reason\": \"\",\n \"Parameters\": \"\"\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: 76
{
"Target": "",
"DocumentName": "",
"Reason": "",
"Parameters": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartSession")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Target\": \"\",\n \"DocumentName\": \"\",\n \"Reason\": \"\",\n \"Parameters\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartSession"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Target\": \"\",\n \"DocumentName\": \"\",\n \"Reason\": \"\",\n \"Parameters\": \"\"\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 \"Target\": \"\",\n \"DocumentName\": \"\",\n \"Reason\": \"\",\n \"Parameters\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartSession")
.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=AmazonSSM.StartSession")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Target\": \"\",\n \"DocumentName\": \"\",\n \"Reason\": \"\",\n \"Parameters\": \"\"\n}")
.asString();
const data = JSON.stringify({
Target: '',
DocumentName: '',
Reason: '',
Parameters: ''
});
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=AmazonSSM.StartSession');
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=AmazonSSM.StartSession',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Target: '', DocumentName: '', Reason: '', Parameters: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartSession';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Target":"","DocumentName":"","Reason":"","Parameters":""}'
};
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=AmazonSSM.StartSession',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Target": "",\n "DocumentName": "",\n "Reason": "",\n "Parameters": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Target\": \"\",\n \"DocumentName\": \"\",\n \"Reason\": \"\",\n \"Parameters\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartSession")
.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({Target: '', DocumentName: '', Reason: '', Parameters: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartSession',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Target: '', DocumentName: '', Reason: '', Parameters: ''},
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=AmazonSSM.StartSession');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Target: '',
DocumentName: '',
Reason: '',
Parameters: ''
});
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=AmazonSSM.StartSession',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Target: '', DocumentName: '', Reason: '', Parameters: ''}
};
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=AmazonSSM.StartSession';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Target":"","DocumentName":"","Reason":"","Parameters":""}'
};
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 = @{ @"Target": @"",
@"DocumentName": @"",
@"Reason": @"",
@"Parameters": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartSession"]
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=AmazonSSM.StartSession" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Target\": \"\",\n \"DocumentName\": \"\",\n \"Reason\": \"\",\n \"Parameters\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartSession",
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([
'Target' => '',
'DocumentName' => '',
'Reason' => '',
'Parameters' => ''
]),
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=AmazonSSM.StartSession', [
'body' => '{
"Target": "",
"DocumentName": "",
"Reason": "",
"Parameters": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartSession');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Target' => '',
'DocumentName' => '',
'Reason' => '',
'Parameters' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Target' => '',
'DocumentName' => '',
'Reason' => '',
'Parameters' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartSession');
$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=AmazonSSM.StartSession' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Target": "",
"DocumentName": "",
"Reason": "",
"Parameters": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartSession' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Target": "",
"DocumentName": "",
"Reason": "",
"Parameters": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Target\": \"\",\n \"DocumentName\": \"\",\n \"Reason\": \"\",\n \"Parameters\": \"\"\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=AmazonSSM.StartSession"
payload = {
"Target": "",
"DocumentName": "",
"Reason": "",
"Parameters": ""
}
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=AmazonSSM.StartSession"
payload <- "{\n \"Target\": \"\",\n \"DocumentName\": \"\",\n \"Reason\": \"\",\n \"Parameters\": \"\"\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=AmazonSSM.StartSession")
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 \"Target\": \"\",\n \"DocumentName\": \"\",\n \"Reason\": \"\",\n \"Parameters\": \"\"\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 \"Target\": \"\",\n \"DocumentName\": \"\",\n \"Reason\": \"\",\n \"Parameters\": \"\"\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=AmazonSSM.StartSession";
let payload = json!({
"Target": "",
"DocumentName": "",
"Reason": "",
"Parameters": ""
});
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=AmazonSSM.StartSession' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Target": "",
"DocumentName": "",
"Reason": "",
"Parameters": ""
}'
echo '{
"Target": "",
"DocumentName": "",
"Reason": "",
"Parameters": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartSession' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Target": "",\n "DocumentName": "",\n "Reason": "",\n "Parameters": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartSession'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Target": "",
"DocumentName": "",
"Reason": "",
"Parameters": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.StartSession")! 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
StopAutomationExecution
{{baseUrl}}/#X-Amz-Target=AmazonSSM.StopAutomationExecution
HEADERS
X-Amz-Target
BODY json
{
"AutomationExecutionId": "",
"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=AmazonSSM.StopAutomationExecution");
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 \"AutomationExecutionId\": \"\",\n \"Type\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.StopAutomationExecution" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:AutomationExecutionId ""
:Type ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.StopAutomationExecution"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"AutomationExecutionId\": \"\",\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=AmazonSSM.StopAutomationExecution"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"AutomationExecutionId\": \"\",\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=AmazonSSM.StopAutomationExecution");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AutomationExecutionId\": \"\",\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=AmazonSSM.StopAutomationExecution"
payload := strings.NewReader("{\n \"AutomationExecutionId\": \"\",\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: 47
{
"AutomationExecutionId": "",
"Type": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.StopAutomationExecution")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"AutomationExecutionId\": \"\",\n \"Type\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.StopAutomationExecution"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AutomationExecutionId\": \"\",\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 \"AutomationExecutionId\": \"\",\n \"Type\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.StopAutomationExecution")
.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=AmazonSSM.StopAutomationExecution")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"AutomationExecutionId\": \"\",\n \"Type\": \"\"\n}")
.asString();
const data = JSON.stringify({
AutomationExecutionId: '',
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=AmazonSSM.StopAutomationExecution');
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=AmazonSSM.StopAutomationExecution',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AutomationExecutionId: '', Type: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.StopAutomationExecution';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AutomationExecutionId":"","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=AmazonSSM.StopAutomationExecution',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "AutomationExecutionId": "",\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 \"AutomationExecutionId\": \"\",\n \"Type\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.StopAutomationExecution")
.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({AutomationExecutionId: '', Type: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.StopAutomationExecution',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {AutomationExecutionId: '', 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=AmazonSSM.StopAutomationExecution');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
AutomationExecutionId: '',
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=AmazonSSM.StopAutomationExecution',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AutomationExecutionId: '', 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=AmazonSSM.StopAutomationExecution';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AutomationExecutionId":"","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 = @{ @"AutomationExecutionId": @"",
@"Type": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.StopAutomationExecution"]
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=AmazonSSM.StopAutomationExecution" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"AutomationExecutionId\": \"\",\n \"Type\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.StopAutomationExecution",
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([
'AutomationExecutionId' => '',
'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=AmazonSSM.StopAutomationExecution', [
'body' => '{
"AutomationExecutionId": "",
"Type": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.StopAutomationExecution');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AutomationExecutionId' => '',
'Type' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AutomationExecutionId' => '',
'Type' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.StopAutomationExecution');
$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=AmazonSSM.StopAutomationExecution' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AutomationExecutionId": "",
"Type": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.StopAutomationExecution' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AutomationExecutionId": "",
"Type": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AutomationExecutionId\": \"\",\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=AmazonSSM.StopAutomationExecution"
payload = {
"AutomationExecutionId": "",
"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=AmazonSSM.StopAutomationExecution"
payload <- "{\n \"AutomationExecutionId\": \"\",\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=AmazonSSM.StopAutomationExecution")
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 \"AutomationExecutionId\": \"\",\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 \"AutomationExecutionId\": \"\",\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=AmazonSSM.StopAutomationExecution";
let payload = json!({
"AutomationExecutionId": "",
"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=AmazonSSM.StopAutomationExecution' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"AutomationExecutionId": "",
"Type": ""
}'
echo '{
"AutomationExecutionId": "",
"Type": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.StopAutomationExecution' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "AutomationExecutionId": "",\n "Type": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.StopAutomationExecution'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"AutomationExecutionId": "",
"Type": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.StopAutomationExecution")! 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
TerminateSession
{{baseUrl}}/#X-Amz-Target=AmazonSSM.TerminateSession
HEADERS
X-Amz-Target
BODY json
{
"SessionId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.TerminateSession");
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 \"SessionId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.TerminateSession" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:SessionId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.TerminateSession"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"SessionId\": \"\"\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=AmazonSSM.TerminateSession"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"SessionId\": \"\"\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=AmazonSSM.TerminateSession");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"SessionId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.TerminateSession"
payload := strings.NewReader("{\n \"SessionId\": \"\"\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: 21
{
"SessionId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.TerminateSession")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"SessionId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.TerminateSession"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"SessionId\": \"\"\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 \"SessionId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.TerminateSession")
.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=AmazonSSM.TerminateSession")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"SessionId\": \"\"\n}")
.asString();
const data = JSON.stringify({
SessionId: ''
});
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=AmazonSSM.TerminateSession');
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=AmazonSSM.TerminateSession',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {SessionId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.TerminateSession';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"SessionId":""}'
};
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=AmazonSSM.TerminateSession',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "SessionId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"SessionId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.TerminateSession")
.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({SessionId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.TerminateSession',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {SessionId: ''},
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=AmazonSSM.TerminateSession');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
SessionId: ''
});
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=AmazonSSM.TerminateSession',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {SessionId: ''}
};
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=AmazonSSM.TerminateSession';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"SessionId":""}'
};
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 = @{ @"SessionId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.TerminateSession"]
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=AmazonSSM.TerminateSession" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"SessionId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.TerminateSession",
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([
'SessionId' => ''
]),
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=AmazonSSM.TerminateSession', [
'body' => '{
"SessionId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.TerminateSession');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'SessionId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'SessionId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.TerminateSession');
$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=AmazonSSM.TerminateSession' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SessionId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.TerminateSession' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SessionId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"SessionId\": \"\"\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=AmazonSSM.TerminateSession"
payload = { "SessionId": "" }
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=AmazonSSM.TerminateSession"
payload <- "{\n \"SessionId\": \"\"\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=AmazonSSM.TerminateSession")
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 \"SessionId\": \"\"\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 \"SessionId\": \"\"\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=AmazonSSM.TerminateSession";
let payload = json!({"SessionId": ""});
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=AmazonSSM.TerminateSession' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"SessionId": ""
}'
echo '{
"SessionId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.TerminateSession' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "SessionId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.TerminateSession'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["SessionId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.TerminateSession")! 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
UnlabelParameterVersion
{{baseUrl}}/#X-Amz-Target=AmazonSSM.UnlabelParameterVersion
HEADERS
X-Amz-Target
BODY json
{
"Name": "",
"ParameterVersion": "",
"Labels": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UnlabelParameterVersion");
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 \"ParameterVersion\": \"\",\n \"Labels\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UnlabelParameterVersion" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Name ""
:ParameterVersion ""
:Labels ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UnlabelParameterVersion"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Name\": \"\",\n \"ParameterVersion\": \"\",\n \"Labels\": \"\"\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=AmazonSSM.UnlabelParameterVersion"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Name\": \"\",\n \"ParameterVersion\": \"\",\n \"Labels\": \"\"\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=AmazonSSM.UnlabelParameterVersion");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Name\": \"\",\n \"ParameterVersion\": \"\",\n \"Labels\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UnlabelParameterVersion"
payload := strings.NewReader("{\n \"Name\": \"\",\n \"ParameterVersion\": \"\",\n \"Labels\": \"\"\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
{
"Name": "",
"ParameterVersion": "",
"Labels": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UnlabelParameterVersion")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Name\": \"\",\n \"ParameterVersion\": \"\",\n \"Labels\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UnlabelParameterVersion"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Name\": \"\",\n \"ParameterVersion\": \"\",\n \"Labels\": \"\"\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 \"ParameterVersion\": \"\",\n \"Labels\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UnlabelParameterVersion")
.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=AmazonSSM.UnlabelParameterVersion")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Name\": \"\",\n \"ParameterVersion\": \"\",\n \"Labels\": \"\"\n}")
.asString();
const data = JSON.stringify({
Name: '',
ParameterVersion: '',
Labels: ''
});
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=AmazonSSM.UnlabelParameterVersion');
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=AmazonSSM.UnlabelParameterVersion',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Name: '', ParameterVersion: '', Labels: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UnlabelParameterVersion';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","ParameterVersion":"","Labels":""}'
};
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=AmazonSSM.UnlabelParameterVersion',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Name": "",\n "ParameterVersion": "",\n "Labels": ""\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 \"ParameterVersion\": \"\",\n \"Labels\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UnlabelParameterVersion")
.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: '', ParameterVersion: '', Labels: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UnlabelParameterVersion',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Name: '', ParameterVersion: '', Labels: ''},
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=AmazonSSM.UnlabelParameterVersion');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Name: '',
ParameterVersion: '',
Labels: ''
});
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=AmazonSSM.UnlabelParameterVersion',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Name: '', ParameterVersion: '', Labels: ''}
};
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=AmazonSSM.UnlabelParameterVersion';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","ParameterVersion":"","Labels":""}'
};
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": @"",
@"ParameterVersion": @"",
@"Labels": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.UnlabelParameterVersion"]
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=AmazonSSM.UnlabelParameterVersion" 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 \"ParameterVersion\": \"\",\n \"Labels\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.UnlabelParameterVersion",
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' => '',
'ParameterVersion' => '',
'Labels' => ''
]),
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=AmazonSSM.UnlabelParameterVersion', [
'body' => '{
"Name": "",
"ParameterVersion": "",
"Labels": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.UnlabelParameterVersion');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Name' => '',
'ParameterVersion' => '',
'Labels' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Name' => '',
'ParameterVersion' => '',
'Labels' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.UnlabelParameterVersion');
$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=AmazonSSM.UnlabelParameterVersion' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"ParameterVersion": "",
"Labels": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UnlabelParameterVersion' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"ParameterVersion": "",
"Labels": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Name\": \"\",\n \"ParameterVersion\": \"\",\n \"Labels\": \"\"\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=AmazonSSM.UnlabelParameterVersion"
payload = {
"Name": "",
"ParameterVersion": "",
"Labels": ""
}
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=AmazonSSM.UnlabelParameterVersion"
payload <- "{\n \"Name\": \"\",\n \"ParameterVersion\": \"\",\n \"Labels\": \"\"\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=AmazonSSM.UnlabelParameterVersion")
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 \"ParameterVersion\": \"\",\n \"Labels\": \"\"\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 \"ParameterVersion\": \"\",\n \"Labels\": \"\"\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=AmazonSSM.UnlabelParameterVersion";
let payload = json!({
"Name": "",
"ParameterVersion": "",
"Labels": ""
});
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=AmazonSSM.UnlabelParameterVersion' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Name": "",
"ParameterVersion": "",
"Labels": ""
}'
echo '{
"Name": "",
"ParameterVersion": "",
"Labels": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UnlabelParameterVersion' \
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 "ParameterVersion": "",\n "Labels": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UnlabelParameterVersion'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Name": "",
"ParameterVersion": "",
"Labels": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UnlabelParameterVersion")! 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
UpdateAssociation
{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateAssociation
HEADERS
X-Amz-Target
BODY json
{
"AssociationId": "",
"Parameters": "",
"DocumentVersion": "",
"ScheduleExpression": "",
"OutputLocation": "",
"Name": "",
"Targets": "",
"AssociationName": "",
"AssociationVersion": "",
"AutomationTargetParameterName": "",
"MaxErrors": "",
"MaxConcurrency": "",
"ComplianceSeverity": "",
"SyncCompliance": "",
"ApplyOnlyAtCronInterval": "",
"CalendarNames": "",
"TargetLocations": "",
"ScheduleOffset": "",
"TargetMaps": "",
"AlarmConfiguration": {
"IgnorePollAlarmFailure": "",
"Alarms": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateAssociation");
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 \"AssociationId\": \"\",\n \"Parameters\": \"\",\n \"DocumentVersion\": \"\",\n \"ScheduleExpression\": \"\",\n \"OutputLocation\": \"\",\n \"Name\": \"\",\n \"Targets\": \"\",\n \"AssociationName\": \"\",\n \"AssociationVersion\": \"\",\n \"AutomationTargetParameterName\": \"\",\n \"MaxErrors\": \"\",\n \"MaxConcurrency\": \"\",\n \"ComplianceSeverity\": \"\",\n \"SyncCompliance\": \"\",\n \"ApplyOnlyAtCronInterval\": \"\",\n \"CalendarNames\": \"\",\n \"TargetLocations\": \"\",\n \"ScheduleOffset\": \"\",\n \"TargetMaps\": \"\",\n \"AlarmConfiguration\": {\n \"IgnorePollAlarmFailure\": \"\",\n \"Alarms\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateAssociation" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:AssociationId ""
:Parameters ""
:DocumentVersion ""
:ScheduleExpression ""
:OutputLocation ""
:Name ""
:Targets ""
:AssociationName ""
:AssociationVersion ""
:AutomationTargetParameterName ""
:MaxErrors ""
:MaxConcurrency ""
:ComplianceSeverity ""
:SyncCompliance ""
:ApplyOnlyAtCronInterval ""
:CalendarNames ""
:TargetLocations ""
:ScheduleOffset ""
:TargetMaps ""
:AlarmConfiguration {:IgnorePollAlarmFailure ""
:Alarms ""}}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateAssociation"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"AssociationId\": \"\",\n \"Parameters\": \"\",\n \"DocumentVersion\": \"\",\n \"ScheduleExpression\": \"\",\n \"OutputLocation\": \"\",\n \"Name\": \"\",\n \"Targets\": \"\",\n \"AssociationName\": \"\",\n \"AssociationVersion\": \"\",\n \"AutomationTargetParameterName\": \"\",\n \"MaxErrors\": \"\",\n \"MaxConcurrency\": \"\",\n \"ComplianceSeverity\": \"\",\n \"SyncCompliance\": \"\",\n \"ApplyOnlyAtCronInterval\": \"\",\n \"CalendarNames\": \"\",\n \"TargetLocations\": \"\",\n \"ScheduleOffset\": \"\",\n \"TargetMaps\": \"\",\n \"AlarmConfiguration\": {\n \"IgnorePollAlarmFailure\": \"\",\n \"Alarms\": \"\"\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=AmazonSSM.UpdateAssociation"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"AssociationId\": \"\",\n \"Parameters\": \"\",\n \"DocumentVersion\": \"\",\n \"ScheduleExpression\": \"\",\n \"OutputLocation\": \"\",\n \"Name\": \"\",\n \"Targets\": \"\",\n \"AssociationName\": \"\",\n \"AssociationVersion\": \"\",\n \"AutomationTargetParameterName\": \"\",\n \"MaxErrors\": \"\",\n \"MaxConcurrency\": \"\",\n \"ComplianceSeverity\": \"\",\n \"SyncCompliance\": \"\",\n \"ApplyOnlyAtCronInterval\": \"\",\n \"CalendarNames\": \"\",\n \"TargetLocations\": \"\",\n \"ScheduleOffset\": \"\",\n \"TargetMaps\": \"\",\n \"AlarmConfiguration\": {\n \"IgnorePollAlarmFailure\": \"\",\n \"Alarms\": \"\"\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=AmazonSSM.UpdateAssociation");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AssociationId\": \"\",\n \"Parameters\": \"\",\n \"DocumentVersion\": \"\",\n \"ScheduleExpression\": \"\",\n \"OutputLocation\": \"\",\n \"Name\": \"\",\n \"Targets\": \"\",\n \"AssociationName\": \"\",\n \"AssociationVersion\": \"\",\n \"AutomationTargetParameterName\": \"\",\n \"MaxErrors\": \"\",\n \"MaxConcurrency\": \"\",\n \"ComplianceSeverity\": \"\",\n \"SyncCompliance\": \"\",\n \"ApplyOnlyAtCronInterval\": \"\",\n \"CalendarNames\": \"\",\n \"TargetLocations\": \"\",\n \"ScheduleOffset\": \"\",\n \"TargetMaps\": \"\",\n \"AlarmConfiguration\": {\n \"IgnorePollAlarmFailure\": \"\",\n \"Alarms\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateAssociation"
payload := strings.NewReader("{\n \"AssociationId\": \"\",\n \"Parameters\": \"\",\n \"DocumentVersion\": \"\",\n \"ScheduleExpression\": \"\",\n \"OutputLocation\": \"\",\n \"Name\": \"\",\n \"Targets\": \"\",\n \"AssociationName\": \"\",\n \"AssociationVersion\": \"\",\n \"AutomationTargetParameterName\": \"\",\n \"MaxErrors\": \"\",\n \"MaxConcurrency\": \"\",\n \"ComplianceSeverity\": \"\",\n \"SyncCompliance\": \"\",\n \"ApplyOnlyAtCronInterval\": \"\",\n \"CalendarNames\": \"\",\n \"TargetLocations\": \"\",\n \"ScheduleOffset\": \"\",\n \"TargetMaps\": \"\",\n \"AlarmConfiguration\": {\n \"IgnorePollAlarmFailure\": \"\",\n \"Alarms\": \"\"\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: 547
{
"AssociationId": "",
"Parameters": "",
"DocumentVersion": "",
"ScheduleExpression": "",
"OutputLocation": "",
"Name": "",
"Targets": "",
"AssociationName": "",
"AssociationVersion": "",
"AutomationTargetParameterName": "",
"MaxErrors": "",
"MaxConcurrency": "",
"ComplianceSeverity": "",
"SyncCompliance": "",
"ApplyOnlyAtCronInterval": "",
"CalendarNames": "",
"TargetLocations": "",
"ScheduleOffset": "",
"TargetMaps": "",
"AlarmConfiguration": {
"IgnorePollAlarmFailure": "",
"Alarms": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateAssociation")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"AssociationId\": \"\",\n \"Parameters\": \"\",\n \"DocumentVersion\": \"\",\n \"ScheduleExpression\": \"\",\n \"OutputLocation\": \"\",\n \"Name\": \"\",\n \"Targets\": \"\",\n \"AssociationName\": \"\",\n \"AssociationVersion\": \"\",\n \"AutomationTargetParameterName\": \"\",\n \"MaxErrors\": \"\",\n \"MaxConcurrency\": \"\",\n \"ComplianceSeverity\": \"\",\n \"SyncCompliance\": \"\",\n \"ApplyOnlyAtCronInterval\": \"\",\n \"CalendarNames\": \"\",\n \"TargetLocations\": \"\",\n \"ScheduleOffset\": \"\",\n \"TargetMaps\": \"\",\n \"AlarmConfiguration\": {\n \"IgnorePollAlarmFailure\": \"\",\n \"Alarms\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateAssociation"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AssociationId\": \"\",\n \"Parameters\": \"\",\n \"DocumentVersion\": \"\",\n \"ScheduleExpression\": \"\",\n \"OutputLocation\": \"\",\n \"Name\": \"\",\n \"Targets\": \"\",\n \"AssociationName\": \"\",\n \"AssociationVersion\": \"\",\n \"AutomationTargetParameterName\": \"\",\n \"MaxErrors\": \"\",\n \"MaxConcurrency\": \"\",\n \"ComplianceSeverity\": \"\",\n \"SyncCompliance\": \"\",\n \"ApplyOnlyAtCronInterval\": \"\",\n \"CalendarNames\": \"\",\n \"TargetLocations\": \"\",\n \"ScheduleOffset\": \"\",\n \"TargetMaps\": \"\",\n \"AlarmConfiguration\": {\n \"IgnorePollAlarmFailure\": \"\",\n \"Alarms\": \"\"\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 \"AssociationId\": \"\",\n \"Parameters\": \"\",\n \"DocumentVersion\": \"\",\n \"ScheduleExpression\": \"\",\n \"OutputLocation\": \"\",\n \"Name\": \"\",\n \"Targets\": \"\",\n \"AssociationName\": \"\",\n \"AssociationVersion\": \"\",\n \"AutomationTargetParameterName\": \"\",\n \"MaxErrors\": \"\",\n \"MaxConcurrency\": \"\",\n \"ComplianceSeverity\": \"\",\n \"SyncCompliance\": \"\",\n \"ApplyOnlyAtCronInterval\": \"\",\n \"CalendarNames\": \"\",\n \"TargetLocations\": \"\",\n \"ScheduleOffset\": \"\",\n \"TargetMaps\": \"\",\n \"AlarmConfiguration\": {\n \"IgnorePollAlarmFailure\": \"\",\n \"Alarms\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateAssociation")
.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=AmazonSSM.UpdateAssociation")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"AssociationId\": \"\",\n \"Parameters\": \"\",\n \"DocumentVersion\": \"\",\n \"ScheduleExpression\": \"\",\n \"OutputLocation\": \"\",\n \"Name\": \"\",\n \"Targets\": \"\",\n \"AssociationName\": \"\",\n \"AssociationVersion\": \"\",\n \"AutomationTargetParameterName\": \"\",\n \"MaxErrors\": \"\",\n \"MaxConcurrency\": \"\",\n \"ComplianceSeverity\": \"\",\n \"SyncCompliance\": \"\",\n \"ApplyOnlyAtCronInterval\": \"\",\n \"CalendarNames\": \"\",\n \"TargetLocations\": \"\",\n \"ScheduleOffset\": \"\",\n \"TargetMaps\": \"\",\n \"AlarmConfiguration\": {\n \"IgnorePollAlarmFailure\": \"\",\n \"Alarms\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
AssociationId: '',
Parameters: '',
DocumentVersion: '',
ScheduleExpression: '',
OutputLocation: '',
Name: '',
Targets: '',
AssociationName: '',
AssociationVersion: '',
AutomationTargetParameterName: '',
MaxErrors: '',
MaxConcurrency: '',
ComplianceSeverity: '',
SyncCompliance: '',
ApplyOnlyAtCronInterval: '',
CalendarNames: '',
TargetLocations: '',
ScheduleOffset: '',
TargetMaps: '',
AlarmConfiguration: {
IgnorePollAlarmFailure: '',
Alarms: ''
}
});
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=AmazonSSM.UpdateAssociation');
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=AmazonSSM.UpdateAssociation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
AssociationId: '',
Parameters: '',
DocumentVersion: '',
ScheduleExpression: '',
OutputLocation: '',
Name: '',
Targets: '',
AssociationName: '',
AssociationVersion: '',
AutomationTargetParameterName: '',
MaxErrors: '',
MaxConcurrency: '',
ComplianceSeverity: '',
SyncCompliance: '',
ApplyOnlyAtCronInterval: '',
CalendarNames: '',
TargetLocations: '',
ScheduleOffset: '',
TargetMaps: '',
AlarmConfiguration: {IgnorePollAlarmFailure: '', Alarms: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateAssociation';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AssociationId":"","Parameters":"","DocumentVersion":"","ScheduleExpression":"","OutputLocation":"","Name":"","Targets":"","AssociationName":"","AssociationVersion":"","AutomationTargetParameterName":"","MaxErrors":"","MaxConcurrency":"","ComplianceSeverity":"","SyncCompliance":"","ApplyOnlyAtCronInterval":"","CalendarNames":"","TargetLocations":"","ScheduleOffset":"","TargetMaps":"","AlarmConfiguration":{"IgnorePollAlarmFailure":"","Alarms":""}}'
};
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=AmazonSSM.UpdateAssociation',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "AssociationId": "",\n "Parameters": "",\n "DocumentVersion": "",\n "ScheduleExpression": "",\n "OutputLocation": "",\n "Name": "",\n "Targets": "",\n "AssociationName": "",\n "AssociationVersion": "",\n "AutomationTargetParameterName": "",\n "MaxErrors": "",\n "MaxConcurrency": "",\n "ComplianceSeverity": "",\n "SyncCompliance": "",\n "ApplyOnlyAtCronInterval": "",\n "CalendarNames": "",\n "TargetLocations": "",\n "ScheduleOffset": "",\n "TargetMaps": "",\n "AlarmConfiguration": {\n "IgnorePollAlarmFailure": "",\n "Alarms": ""\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 \"AssociationId\": \"\",\n \"Parameters\": \"\",\n \"DocumentVersion\": \"\",\n \"ScheduleExpression\": \"\",\n \"OutputLocation\": \"\",\n \"Name\": \"\",\n \"Targets\": \"\",\n \"AssociationName\": \"\",\n \"AssociationVersion\": \"\",\n \"AutomationTargetParameterName\": \"\",\n \"MaxErrors\": \"\",\n \"MaxConcurrency\": \"\",\n \"ComplianceSeverity\": \"\",\n \"SyncCompliance\": \"\",\n \"ApplyOnlyAtCronInterval\": \"\",\n \"CalendarNames\": \"\",\n \"TargetLocations\": \"\",\n \"ScheduleOffset\": \"\",\n \"TargetMaps\": \"\",\n \"AlarmConfiguration\": {\n \"IgnorePollAlarmFailure\": \"\",\n \"Alarms\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateAssociation")
.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({
AssociationId: '',
Parameters: '',
DocumentVersion: '',
ScheduleExpression: '',
OutputLocation: '',
Name: '',
Targets: '',
AssociationName: '',
AssociationVersion: '',
AutomationTargetParameterName: '',
MaxErrors: '',
MaxConcurrency: '',
ComplianceSeverity: '',
SyncCompliance: '',
ApplyOnlyAtCronInterval: '',
CalendarNames: '',
TargetLocations: '',
ScheduleOffset: '',
TargetMaps: '',
AlarmConfiguration: {IgnorePollAlarmFailure: '', Alarms: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateAssociation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
AssociationId: '',
Parameters: '',
DocumentVersion: '',
ScheduleExpression: '',
OutputLocation: '',
Name: '',
Targets: '',
AssociationName: '',
AssociationVersion: '',
AutomationTargetParameterName: '',
MaxErrors: '',
MaxConcurrency: '',
ComplianceSeverity: '',
SyncCompliance: '',
ApplyOnlyAtCronInterval: '',
CalendarNames: '',
TargetLocations: '',
ScheduleOffset: '',
TargetMaps: '',
AlarmConfiguration: {IgnorePollAlarmFailure: '', Alarms: ''}
},
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=AmazonSSM.UpdateAssociation');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
AssociationId: '',
Parameters: '',
DocumentVersion: '',
ScheduleExpression: '',
OutputLocation: '',
Name: '',
Targets: '',
AssociationName: '',
AssociationVersion: '',
AutomationTargetParameterName: '',
MaxErrors: '',
MaxConcurrency: '',
ComplianceSeverity: '',
SyncCompliance: '',
ApplyOnlyAtCronInterval: '',
CalendarNames: '',
TargetLocations: '',
ScheduleOffset: '',
TargetMaps: '',
AlarmConfiguration: {
IgnorePollAlarmFailure: '',
Alarms: ''
}
});
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=AmazonSSM.UpdateAssociation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
AssociationId: '',
Parameters: '',
DocumentVersion: '',
ScheduleExpression: '',
OutputLocation: '',
Name: '',
Targets: '',
AssociationName: '',
AssociationVersion: '',
AutomationTargetParameterName: '',
MaxErrors: '',
MaxConcurrency: '',
ComplianceSeverity: '',
SyncCompliance: '',
ApplyOnlyAtCronInterval: '',
CalendarNames: '',
TargetLocations: '',
ScheduleOffset: '',
TargetMaps: '',
AlarmConfiguration: {IgnorePollAlarmFailure: '', Alarms: ''}
}
};
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=AmazonSSM.UpdateAssociation';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AssociationId":"","Parameters":"","DocumentVersion":"","ScheduleExpression":"","OutputLocation":"","Name":"","Targets":"","AssociationName":"","AssociationVersion":"","AutomationTargetParameterName":"","MaxErrors":"","MaxConcurrency":"","ComplianceSeverity":"","SyncCompliance":"","ApplyOnlyAtCronInterval":"","CalendarNames":"","TargetLocations":"","ScheduleOffset":"","TargetMaps":"","AlarmConfiguration":{"IgnorePollAlarmFailure":"","Alarms":""}}'
};
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 = @{ @"AssociationId": @"",
@"Parameters": @"",
@"DocumentVersion": @"",
@"ScheduleExpression": @"",
@"OutputLocation": @"",
@"Name": @"",
@"Targets": @"",
@"AssociationName": @"",
@"AssociationVersion": @"",
@"AutomationTargetParameterName": @"",
@"MaxErrors": @"",
@"MaxConcurrency": @"",
@"ComplianceSeverity": @"",
@"SyncCompliance": @"",
@"ApplyOnlyAtCronInterval": @"",
@"CalendarNames": @"",
@"TargetLocations": @"",
@"ScheduleOffset": @"",
@"TargetMaps": @"",
@"AlarmConfiguration": @{ @"IgnorePollAlarmFailure": @"", @"Alarms": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateAssociation"]
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=AmazonSSM.UpdateAssociation" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"AssociationId\": \"\",\n \"Parameters\": \"\",\n \"DocumentVersion\": \"\",\n \"ScheduleExpression\": \"\",\n \"OutputLocation\": \"\",\n \"Name\": \"\",\n \"Targets\": \"\",\n \"AssociationName\": \"\",\n \"AssociationVersion\": \"\",\n \"AutomationTargetParameterName\": \"\",\n \"MaxErrors\": \"\",\n \"MaxConcurrency\": \"\",\n \"ComplianceSeverity\": \"\",\n \"SyncCompliance\": \"\",\n \"ApplyOnlyAtCronInterval\": \"\",\n \"CalendarNames\": \"\",\n \"TargetLocations\": \"\",\n \"ScheduleOffset\": \"\",\n \"TargetMaps\": \"\",\n \"AlarmConfiguration\": {\n \"IgnorePollAlarmFailure\": \"\",\n \"Alarms\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateAssociation",
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([
'AssociationId' => '',
'Parameters' => '',
'DocumentVersion' => '',
'ScheduleExpression' => '',
'OutputLocation' => '',
'Name' => '',
'Targets' => '',
'AssociationName' => '',
'AssociationVersion' => '',
'AutomationTargetParameterName' => '',
'MaxErrors' => '',
'MaxConcurrency' => '',
'ComplianceSeverity' => '',
'SyncCompliance' => '',
'ApplyOnlyAtCronInterval' => '',
'CalendarNames' => '',
'TargetLocations' => '',
'ScheduleOffset' => '',
'TargetMaps' => '',
'AlarmConfiguration' => [
'IgnorePollAlarmFailure' => '',
'Alarms' => ''
]
]),
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=AmazonSSM.UpdateAssociation', [
'body' => '{
"AssociationId": "",
"Parameters": "",
"DocumentVersion": "",
"ScheduleExpression": "",
"OutputLocation": "",
"Name": "",
"Targets": "",
"AssociationName": "",
"AssociationVersion": "",
"AutomationTargetParameterName": "",
"MaxErrors": "",
"MaxConcurrency": "",
"ComplianceSeverity": "",
"SyncCompliance": "",
"ApplyOnlyAtCronInterval": "",
"CalendarNames": "",
"TargetLocations": "",
"ScheduleOffset": "",
"TargetMaps": "",
"AlarmConfiguration": {
"IgnorePollAlarmFailure": "",
"Alarms": ""
}
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateAssociation');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AssociationId' => '',
'Parameters' => '',
'DocumentVersion' => '',
'ScheduleExpression' => '',
'OutputLocation' => '',
'Name' => '',
'Targets' => '',
'AssociationName' => '',
'AssociationVersion' => '',
'AutomationTargetParameterName' => '',
'MaxErrors' => '',
'MaxConcurrency' => '',
'ComplianceSeverity' => '',
'SyncCompliance' => '',
'ApplyOnlyAtCronInterval' => '',
'CalendarNames' => '',
'TargetLocations' => '',
'ScheduleOffset' => '',
'TargetMaps' => '',
'AlarmConfiguration' => [
'IgnorePollAlarmFailure' => '',
'Alarms' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AssociationId' => '',
'Parameters' => '',
'DocumentVersion' => '',
'ScheduleExpression' => '',
'OutputLocation' => '',
'Name' => '',
'Targets' => '',
'AssociationName' => '',
'AssociationVersion' => '',
'AutomationTargetParameterName' => '',
'MaxErrors' => '',
'MaxConcurrency' => '',
'ComplianceSeverity' => '',
'SyncCompliance' => '',
'ApplyOnlyAtCronInterval' => '',
'CalendarNames' => '',
'TargetLocations' => '',
'ScheduleOffset' => '',
'TargetMaps' => '',
'AlarmConfiguration' => [
'IgnorePollAlarmFailure' => '',
'Alarms' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateAssociation');
$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=AmazonSSM.UpdateAssociation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AssociationId": "",
"Parameters": "",
"DocumentVersion": "",
"ScheduleExpression": "",
"OutputLocation": "",
"Name": "",
"Targets": "",
"AssociationName": "",
"AssociationVersion": "",
"AutomationTargetParameterName": "",
"MaxErrors": "",
"MaxConcurrency": "",
"ComplianceSeverity": "",
"SyncCompliance": "",
"ApplyOnlyAtCronInterval": "",
"CalendarNames": "",
"TargetLocations": "",
"ScheduleOffset": "",
"TargetMaps": "",
"AlarmConfiguration": {
"IgnorePollAlarmFailure": "",
"Alarms": ""
}
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateAssociation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AssociationId": "",
"Parameters": "",
"DocumentVersion": "",
"ScheduleExpression": "",
"OutputLocation": "",
"Name": "",
"Targets": "",
"AssociationName": "",
"AssociationVersion": "",
"AutomationTargetParameterName": "",
"MaxErrors": "",
"MaxConcurrency": "",
"ComplianceSeverity": "",
"SyncCompliance": "",
"ApplyOnlyAtCronInterval": "",
"CalendarNames": "",
"TargetLocations": "",
"ScheduleOffset": "",
"TargetMaps": "",
"AlarmConfiguration": {
"IgnorePollAlarmFailure": "",
"Alarms": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AssociationId\": \"\",\n \"Parameters\": \"\",\n \"DocumentVersion\": \"\",\n \"ScheduleExpression\": \"\",\n \"OutputLocation\": \"\",\n \"Name\": \"\",\n \"Targets\": \"\",\n \"AssociationName\": \"\",\n \"AssociationVersion\": \"\",\n \"AutomationTargetParameterName\": \"\",\n \"MaxErrors\": \"\",\n \"MaxConcurrency\": \"\",\n \"ComplianceSeverity\": \"\",\n \"SyncCompliance\": \"\",\n \"ApplyOnlyAtCronInterval\": \"\",\n \"CalendarNames\": \"\",\n \"TargetLocations\": \"\",\n \"ScheduleOffset\": \"\",\n \"TargetMaps\": \"\",\n \"AlarmConfiguration\": {\n \"IgnorePollAlarmFailure\": \"\",\n \"Alarms\": \"\"\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=AmazonSSM.UpdateAssociation"
payload = {
"AssociationId": "",
"Parameters": "",
"DocumentVersion": "",
"ScheduleExpression": "",
"OutputLocation": "",
"Name": "",
"Targets": "",
"AssociationName": "",
"AssociationVersion": "",
"AutomationTargetParameterName": "",
"MaxErrors": "",
"MaxConcurrency": "",
"ComplianceSeverity": "",
"SyncCompliance": "",
"ApplyOnlyAtCronInterval": "",
"CalendarNames": "",
"TargetLocations": "",
"ScheduleOffset": "",
"TargetMaps": "",
"AlarmConfiguration": {
"IgnorePollAlarmFailure": "",
"Alarms": ""
}
}
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=AmazonSSM.UpdateAssociation"
payload <- "{\n \"AssociationId\": \"\",\n \"Parameters\": \"\",\n \"DocumentVersion\": \"\",\n \"ScheduleExpression\": \"\",\n \"OutputLocation\": \"\",\n \"Name\": \"\",\n \"Targets\": \"\",\n \"AssociationName\": \"\",\n \"AssociationVersion\": \"\",\n \"AutomationTargetParameterName\": \"\",\n \"MaxErrors\": \"\",\n \"MaxConcurrency\": \"\",\n \"ComplianceSeverity\": \"\",\n \"SyncCompliance\": \"\",\n \"ApplyOnlyAtCronInterval\": \"\",\n \"CalendarNames\": \"\",\n \"TargetLocations\": \"\",\n \"ScheduleOffset\": \"\",\n \"TargetMaps\": \"\",\n \"AlarmConfiguration\": {\n \"IgnorePollAlarmFailure\": \"\",\n \"Alarms\": \"\"\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=AmazonSSM.UpdateAssociation")
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 \"AssociationId\": \"\",\n \"Parameters\": \"\",\n \"DocumentVersion\": \"\",\n \"ScheduleExpression\": \"\",\n \"OutputLocation\": \"\",\n \"Name\": \"\",\n \"Targets\": \"\",\n \"AssociationName\": \"\",\n \"AssociationVersion\": \"\",\n \"AutomationTargetParameterName\": \"\",\n \"MaxErrors\": \"\",\n \"MaxConcurrency\": \"\",\n \"ComplianceSeverity\": \"\",\n \"SyncCompliance\": \"\",\n \"ApplyOnlyAtCronInterval\": \"\",\n \"CalendarNames\": \"\",\n \"TargetLocations\": \"\",\n \"ScheduleOffset\": \"\",\n \"TargetMaps\": \"\",\n \"AlarmConfiguration\": {\n \"IgnorePollAlarmFailure\": \"\",\n \"Alarms\": \"\"\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 \"AssociationId\": \"\",\n \"Parameters\": \"\",\n \"DocumentVersion\": \"\",\n \"ScheduleExpression\": \"\",\n \"OutputLocation\": \"\",\n \"Name\": \"\",\n \"Targets\": \"\",\n \"AssociationName\": \"\",\n \"AssociationVersion\": \"\",\n \"AutomationTargetParameterName\": \"\",\n \"MaxErrors\": \"\",\n \"MaxConcurrency\": \"\",\n \"ComplianceSeverity\": \"\",\n \"SyncCompliance\": \"\",\n \"ApplyOnlyAtCronInterval\": \"\",\n \"CalendarNames\": \"\",\n \"TargetLocations\": \"\",\n \"ScheduleOffset\": \"\",\n \"TargetMaps\": \"\",\n \"AlarmConfiguration\": {\n \"IgnorePollAlarmFailure\": \"\",\n \"Alarms\": \"\"\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=AmazonSSM.UpdateAssociation";
let payload = json!({
"AssociationId": "",
"Parameters": "",
"DocumentVersion": "",
"ScheduleExpression": "",
"OutputLocation": "",
"Name": "",
"Targets": "",
"AssociationName": "",
"AssociationVersion": "",
"AutomationTargetParameterName": "",
"MaxErrors": "",
"MaxConcurrency": "",
"ComplianceSeverity": "",
"SyncCompliance": "",
"ApplyOnlyAtCronInterval": "",
"CalendarNames": "",
"TargetLocations": "",
"ScheduleOffset": "",
"TargetMaps": "",
"AlarmConfiguration": json!({
"IgnorePollAlarmFailure": "",
"Alarms": ""
})
});
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=AmazonSSM.UpdateAssociation' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"AssociationId": "",
"Parameters": "",
"DocumentVersion": "",
"ScheduleExpression": "",
"OutputLocation": "",
"Name": "",
"Targets": "",
"AssociationName": "",
"AssociationVersion": "",
"AutomationTargetParameterName": "",
"MaxErrors": "",
"MaxConcurrency": "",
"ComplianceSeverity": "",
"SyncCompliance": "",
"ApplyOnlyAtCronInterval": "",
"CalendarNames": "",
"TargetLocations": "",
"ScheduleOffset": "",
"TargetMaps": "",
"AlarmConfiguration": {
"IgnorePollAlarmFailure": "",
"Alarms": ""
}
}'
echo '{
"AssociationId": "",
"Parameters": "",
"DocumentVersion": "",
"ScheduleExpression": "",
"OutputLocation": "",
"Name": "",
"Targets": "",
"AssociationName": "",
"AssociationVersion": "",
"AutomationTargetParameterName": "",
"MaxErrors": "",
"MaxConcurrency": "",
"ComplianceSeverity": "",
"SyncCompliance": "",
"ApplyOnlyAtCronInterval": "",
"CalendarNames": "",
"TargetLocations": "",
"ScheduleOffset": "",
"TargetMaps": "",
"AlarmConfiguration": {
"IgnorePollAlarmFailure": "",
"Alarms": ""
}
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateAssociation' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "AssociationId": "",\n "Parameters": "",\n "DocumentVersion": "",\n "ScheduleExpression": "",\n "OutputLocation": "",\n "Name": "",\n "Targets": "",\n "AssociationName": "",\n "AssociationVersion": "",\n "AutomationTargetParameterName": "",\n "MaxErrors": "",\n "MaxConcurrency": "",\n "ComplianceSeverity": "",\n "SyncCompliance": "",\n "ApplyOnlyAtCronInterval": "",\n "CalendarNames": "",\n "TargetLocations": "",\n "ScheduleOffset": "",\n "TargetMaps": "",\n "AlarmConfiguration": {\n "IgnorePollAlarmFailure": "",\n "Alarms": ""\n }\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateAssociation'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"AssociationId": "",
"Parameters": "",
"DocumentVersion": "",
"ScheduleExpression": "",
"OutputLocation": "",
"Name": "",
"Targets": "",
"AssociationName": "",
"AssociationVersion": "",
"AutomationTargetParameterName": "",
"MaxErrors": "",
"MaxConcurrency": "",
"ComplianceSeverity": "",
"SyncCompliance": "",
"ApplyOnlyAtCronInterval": "",
"CalendarNames": "",
"TargetLocations": "",
"ScheduleOffset": "",
"TargetMaps": "",
"AlarmConfiguration": [
"IgnorePollAlarmFailure": "",
"Alarms": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateAssociation")! 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
UpdateAssociationStatus
{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateAssociationStatus
HEADERS
X-Amz-Target
BODY json
{
"Name": "",
"InstanceId": "",
"AssociationStatus": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateAssociationStatus");
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 \"InstanceId\": \"\",\n \"AssociationStatus\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateAssociationStatus" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Name ""
:InstanceId ""
:AssociationStatus ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateAssociationStatus"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Name\": \"\",\n \"InstanceId\": \"\",\n \"AssociationStatus\": \"\"\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=AmazonSSM.UpdateAssociationStatus"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Name\": \"\",\n \"InstanceId\": \"\",\n \"AssociationStatus\": \"\"\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=AmazonSSM.UpdateAssociationStatus");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Name\": \"\",\n \"InstanceId\": \"\",\n \"AssociationStatus\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateAssociationStatus"
payload := strings.NewReader("{\n \"Name\": \"\",\n \"InstanceId\": \"\",\n \"AssociationStatus\": \"\"\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: 63
{
"Name": "",
"InstanceId": "",
"AssociationStatus": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateAssociationStatus")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Name\": \"\",\n \"InstanceId\": \"\",\n \"AssociationStatus\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateAssociationStatus"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Name\": \"\",\n \"InstanceId\": \"\",\n \"AssociationStatus\": \"\"\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 \"InstanceId\": \"\",\n \"AssociationStatus\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateAssociationStatus")
.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=AmazonSSM.UpdateAssociationStatus")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Name\": \"\",\n \"InstanceId\": \"\",\n \"AssociationStatus\": \"\"\n}")
.asString();
const data = JSON.stringify({
Name: '',
InstanceId: '',
AssociationStatus: ''
});
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=AmazonSSM.UpdateAssociationStatus');
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=AmazonSSM.UpdateAssociationStatus',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Name: '', InstanceId: '', AssociationStatus: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateAssociationStatus';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","InstanceId":"","AssociationStatus":""}'
};
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=AmazonSSM.UpdateAssociationStatus',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Name": "",\n "InstanceId": "",\n "AssociationStatus": ""\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 \"InstanceId\": \"\",\n \"AssociationStatus\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateAssociationStatus")
.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: '', InstanceId: '', AssociationStatus: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateAssociationStatus',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Name: '', InstanceId: '', AssociationStatus: ''},
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=AmazonSSM.UpdateAssociationStatus');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Name: '',
InstanceId: '',
AssociationStatus: ''
});
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=AmazonSSM.UpdateAssociationStatus',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Name: '', InstanceId: '', AssociationStatus: ''}
};
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=AmazonSSM.UpdateAssociationStatus';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","InstanceId":"","AssociationStatus":""}'
};
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": @"",
@"InstanceId": @"",
@"AssociationStatus": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateAssociationStatus"]
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=AmazonSSM.UpdateAssociationStatus" 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 \"InstanceId\": \"\",\n \"AssociationStatus\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateAssociationStatus",
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' => '',
'InstanceId' => '',
'AssociationStatus' => ''
]),
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=AmazonSSM.UpdateAssociationStatus', [
'body' => '{
"Name": "",
"InstanceId": "",
"AssociationStatus": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateAssociationStatus');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Name' => '',
'InstanceId' => '',
'AssociationStatus' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Name' => '',
'InstanceId' => '',
'AssociationStatus' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateAssociationStatus');
$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=AmazonSSM.UpdateAssociationStatus' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"InstanceId": "",
"AssociationStatus": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateAssociationStatus' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"InstanceId": "",
"AssociationStatus": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Name\": \"\",\n \"InstanceId\": \"\",\n \"AssociationStatus\": \"\"\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=AmazonSSM.UpdateAssociationStatus"
payload = {
"Name": "",
"InstanceId": "",
"AssociationStatus": ""
}
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=AmazonSSM.UpdateAssociationStatus"
payload <- "{\n \"Name\": \"\",\n \"InstanceId\": \"\",\n \"AssociationStatus\": \"\"\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=AmazonSSM.UpdateAssociationStatus")
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 \"InstanceId\": \"\",\n \"AssociationStatus\": \"\"\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 \"InstanceId\": \"\",\n \"AssociationStatus\": \"\"\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=AmazonSSM.UpdateAssociationStatus";
let payload = json!({
"Name": "",
"InstanceId": "",
"AssociationStatus": ""
});
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=AmazonSSM.UpdateAssociationStatus' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Name": "",
"InstanceId": "",
"AssociationStatus": ""
}'
echo '{
"Name": "",
"InstanceId": "",
"AssociationStatus": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateAssociationStatus' \
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 "InstanceId": "",\n "AssociationStatus": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateAssociationStatus'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Name": "",
"InstanceId": "",
"AssociationStatus": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateAssociationStatus")! 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
UpdateDocument
{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocument
HEADERS
X-Amz-Target
BODY json
{
"Content": "",
"Attachments": "",
"Name": "",
"DisplayName": "",
"VersionName": "",
"DocumentVersion": "",
"DocumentFormat": "",
"TargetType": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocument");
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 \"Content\": \"\",\n \"Attachments\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"VersionName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentFormat\": \"\",\n \"TargetType\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocument" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Content ""
:Attachments ""
:Name ""
:DisplayName ""
:VersionName ""
:DocumentVersion ""
:DocumentFormat ""
:TargetType ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocument"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Content\": \"\",\n \"Attachments\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"VersionName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentFormat\": \"\",\n \"TargetType\": \"\"\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=AmazonSSM.UpdateDocument"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Content\": \"\",\n \"Attachments\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"VersionName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentFormat\": \"\",\n \"TargetType\": \"\"\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=AmazonSSM.UpdateDocument");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Content\": \"\",\n \"Attachments\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"VersionName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentFormat\": \"\",\n \"TargetType\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocument"
payload := strings.NewReader("{\n \"Content\": \"\",\n \"Attachments\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"VersionName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentFormat\": \"\",\n \"TargetType\": \"\"\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: 165
{
"Content": "",
"Attachments": "",
"Name": "",
"DisplayName": "",
"VersionName": "",
"DocumentVersion": "",
"DocumentFormat": "",
"TargetType": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocument")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Content\": \"\",\n \"Attachments\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"VersionName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentFormat\": \"\",\n \"TargetType\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocument"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Content\": \"\",\n \"Attachments\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"VersionName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentFormat\": \"\",\n \"TargetType\": \"\"\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 \"Content\": \"\",\n \"Attachments\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"VersionName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentFormat\": \"\",\n \"TargetType\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocument")
.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=AmazonSSM.UpdateDocument")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Content\": \"\",\n \"Attachments\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"VersionName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentFormat\": \"\",\n \"TargetType\": \"\"\n}")
.asString();
const data = JSON.stringify({
Content: '',
Attachments: '',
Name: '',
DisplayName: '',
VersionName: '',
DocumentVersion: '',
DocumentFormat: '',
TargetType: ''
});
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=AmazonSSM.UpdateDocument');
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=AmazonSSM.UpdateDocument',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Content: '',
Attachments: '',
Name: '',
DisplayName: '',
VersionName: '',
DocumentVersion: '',
DocumentFormat: '',
TargetType: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocument';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Content":"","Attachments":"","Name":"","DisplayName":"","VersionName":"","DocumentVersion":"","DocumentFormat":"","TargetType":""}'
};
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=AmazonSSM.UpdateDocument',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Content": "",\n "Attachments": "",\n "Name": "",\n "DisplayName": "",\n "VersionName": "",\n "DocumentVersion": "",\n "DocumentFormat": "",\n "TargetType": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Content\": \"\",\n \"Attachments\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"VersionName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentFormat\": \"\",\n \"TargetType\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocument")
.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({
Content: '',
Attachments: '',
Name: '',
DisplayName: '',
VersionName: '',
DocumentVersion: '',
DocumentFormat: '',
TargetType: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocument',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
Content: '',
Attachments: '',
Name: '',
DisplayName: '',
VersionName: '',
DocumentVersion: '',
DocumentFormat: '',
TargetType: ''
},
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=AmazonSSM.UpdateDocument');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Content: '',
Attachments: '',
Name: '',
DisplayName: '',
VersionName: '',
DocumentVersion: '',
DocumentFormat: '',
TargetType: ''
});
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=AmazonSSM.UpdateDocument',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Content: '',
Attachments: '',
Name: '',
DisplayName: '',
VersionName: '',
DocumentVersion: '',
DocumentFormat: '',
TargetType: ''
}
};
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=AmazonSSM.UpdateDocument';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Content":"","Attachments":"","Name":"","DisplayName":"","VersionName":"","DocumentVersion":"","DocumentFormat":"","TargetType":""}'
};
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 = @{ @"Content": @"",
@"Attachments": @"",
@"Name": @"",
@"DisplayName": @"",
@"VersionName": @"",
@"DocumentVersion": @"",
@"DocumentFormat": @"",
@"TargetType": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocument"]
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=AmazonSSM.UpdateDocument" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Content\": \"\",\n \"Attachments\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"VersionName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentFormat\": \"\",\n \"TargetType\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocument",
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([
'Content' => '',
'Attachments' => '',
'Name' => '',
'DisplayName' => '',
'VersionName' => '',
'DocumentVersion' => '',
'DocumentFormat' => '',
'TargetType' => ''
]),
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=AmazonSSM.UpdateDocument', [
'body' => '{
"Content": "",
"Attachments": "",
"Name": "",
"DisplayName": "",
"VersionName": "",
"DocumentVersion": "",
"DocumentFormat": "",
"TargetType": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocument');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Content' => '',
'Attachments' => '',
'Name' => '',
'DisplayName' => '',
'VersionName' => '',
'DocumentVersion' => '',
'DocumentFormat' => '',
'TargetType' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Content' => '',
'Attachments' => '',
'Name' => '',
'DisplayName' => '',
'VersionName' => '',
'DocumentVersion' => '',
'DocumentFormat' => '',
'TargetType' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocument');
$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=AmazonSSM.UpdateDocument' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Content": "",
"Attachments": "",
"Name": "",
"DisplayName": "",
"VersionName": "",
"DocumentVersion": "",
"DocumentFormat": "",
"TargetType": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocument' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Content": "",
"Attachments": "",
"Name": "",
"DisplayName": "",
"VersionName": "",
"DocumentVersion": "",
"DocumentFormat": "",
"TargetType": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Content\": \"\",\n \"Attachments\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"VersionName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentFormat\": \"\",\n \"TargetType\": \"\"\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=AmazonSSM.UpdateDocument"
payload = {
"Content": "",
"Attachments": "",
"Name": "",
"DisplayName": "",
"VersionName": "",
"DocumentVersion": "",
"DocumentFormat": "",
"TargetType": ""
}
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=AmazonSSM.UpdateDocument"
payload <- "{\n \"Content\": \"\",\n \"Attachments\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"VersionName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentFormat\": \"\",\n \"TargetType\": \"\"\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=AmazonSSM.UpdateDocument")
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 \"Content\": \"\",\n \"Attachments\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"VersionName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentFormat\": \"\",\n \"TargetType\": \"\"\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 \"Content\": \"\",\n \"Attachments\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"VersionName\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentFormat\": \"\",\n \"TargetType\": \"\"\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=AmazonSSM.UpdateDocument";
let payload = json!({
"Content": "",
"Attachments": "",
"Name": "",
"DisplayName": "",
"VersionName": "",
"DocumentVersion": "",
"DocumentFormat": "",
"TargetType": ""
});
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=AmazonSSM.UpdateDocument' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Content": "",
"Attachments": "",
"Name": "",
"DisplayName": "",
"VersionName": "",
"DocumentVersion": "",
"DocumentFormat": "",
"TargetType": ""
}'
echo '{
"Content": "",
"Attachments": "",
"Name": "",
"DisplayName": "",
"VersionName": "",
"DocumentVersion": "",
"DocumentFormat": "",
"TargetType": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocument' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Content": "",\n "Attachments": "",\n "Name": "",\n "DisplayName": "",\n "VersionName": "",\n "DocumentVersion": "",\n "DocumentFormat": "",\n "TargetType": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocument'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Content": "",
"Attachments": "",
"Name": "",
"DisplayName": "",
"VersionName": "",
"DocumentVersion": "",
"DocumentFormat": "",
"TargetType": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocument")! 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
UpdateDocumentDefaultVersion
{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocumentDefaultVersion
HEADERS
X-Amz-Target
BODY json
{
"Name": "",
"DocumentVersion": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocumentDefaultVersion");
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 \"DocumentVersion\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocumentDefaultVersion" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Name ""
:DocumentVersion ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocumentDefaultVersion"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Name\": \"\",\n \"DocumentVersion\": \"\"\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=AmazonSSM.UpdateDocumentDefaultVersion"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Name\": \"\",\n \"DocumentVersion\": \"\"\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=AmazonSSM.UpdateDocumentDefaultVersion");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Name\": \"\",\n \"DocumentVersion\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocumentDefaultVersion"
payload := strings.NewReader("{\n \"Name\": \"\",\n \"DocumentVersion\": \"\"\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
{
"Name": "",
"DocumentVersion": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocumentDefaultVersion")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Name\": \"\",\n \"DocumentVersion\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocumentDefaultVersion"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Name\": \"\",\n \"DocumentVersion\": \"\"\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 \"DocumentVersion\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocumentDefaultVersion")
.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=AmazonSSM.UpdateDocumentDefaultVersion")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Name\": \"\",\n \"DocumentVersion\": \"\"\n}")
.asString();
const data = JSON.stringify({
Name: '',
DocumentVersion: ''
});
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=AmazonSSM.UpdateDocumentDefaultVersion');
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=AmazonSSM.UpdateDocumentDefaultVersion',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Name: '', DocumentVersion: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocumentDefaultVersion';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","DocumentVersion":""}'
};
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=AmazonSSM.UpdateDocumentDefaultVersion',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Name": "",\n "DocumentVersion": ""\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 \"DocumentVersion\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocumentDefaultVersion")
.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: '', DocumentVersion: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocumentDefaultVersion',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Name: '', DocumentVersion: ''},
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=AmazonSSM.UpdateDocumentDefaultVersion');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Name: '',
DocumentVersion: ''
});
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=AmazonSSM.UpdateDocumentDefaultVersion',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Name: '', DocumentVersion: ''}
};
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=AmazonSSM.UpdateDocumentDefaultVersion';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","DocumentVersion":""}'
};
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": @"",
@"DocumentVersion": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocumentDefaultVersion"]
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=AmazonSSM.UpdateDocumentDefaultVersion" 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 \"DocumentVersion\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocumentDefaultVersion",
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' => '',
'DocumentVersion' => ''
]),
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=AmazonSSM.UpdateDocumentDefaultVersion', [
'body' => '{
"Name": "",
"DocumentVersion": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocumentDefaultVersion');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Name' => '',
'DocumentVersion' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Name' => '',
'DocumentVersion' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocumentDefaultVersion');
$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=AmazonSSM.UpdateDocumentDefaultVersion' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"DocumentVersion": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocumentDefaultVersion' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"DocumentVersion": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Name\": \"\",\n \"DocumentVersion\": \"\"\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=AmazonSSM.UpdateDocumentDefaultVersion"
payload = {
"Name": "",
"DocumentVersion": ""
}
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=AmazonSSM.UpdateDocumentDefaultVersion"
payload <- "{\n \"Name\": \"\",\n \"DocumentVersion\": \"\"\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=AmazonSSM.UpdateDocumentDefaultVersion")
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 \"DocumentVersion\": \"\"\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 \"DocumentVersion\": \"\"\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=AmazonSSM.UpdateDocumentDefaultVersion";
let payload = json!({
"Name": "",
"DocumentVersion": ""
});
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=AmazonSSM.UpdateDocumentDefaultVersion' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Name": "",
"DocumentVersion": ""
}'
echo '{
"Name": "",
"DocumentVersion": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocumentDefaultVersion' \
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 "DocumentVersion": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocumentDefaultVersion'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Name": "",
"DocumentVersion": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocumentDefaultVersion")! 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
UpdateDocumentMetadata
{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocumentMetadata
HEADERS
X-Amz-Target
BODY json
{
"Name": "",
"DocumentVersion": "",
"DocumentReviews": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocumentMetadata");
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 \"DocumentVersion\": \"\",\n \"DocumentReviews\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocumentMetadata" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Name ""
:DocumentVersion ""
:DocumentReviews ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocumentMetadata"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentReviews\": \"\"\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=AmazonSSM.UpdateDocumentMetadata"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentReviews\": \"\"\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=AmazonSSM.UpdateDocumentMetadata");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentReviews\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocumentMetadata"
payload := strings.NewReader("{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentReviews\": \"\"\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: 66
{
"Name": "",
"DocumentVersion": "",
"DocumentReviews": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocumentMetadata")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentReviews\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocumentMetadata"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentReviews\": \"\"\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 \"DocumentVersion\": \"\",\n \"DocumentReviews\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocumentMetadata")
.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=AmazonSSM.UpdateDocumentMetadata")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentReviews\": \"\"\n}")
.asString();
const data = JSON.stringify({
Name: '',
DocumentVersion: '',
DocumentReviews: ''
});
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=AmazonSSM.UpdateDocumentMetadata');
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=AmazonSSM.UpdateDocumentMetadata',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Name: '', DocumentVersion: '', DocumentReviews: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocumentMetadata';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","DocumentVersion":"","DocumentReviews":""}'
};
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=AmazonSSM.UpdateDocumentMetadata',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Name": "",\n "DocumentVersion": "",\n "DocumentReviews": ""\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 \"DocumentVersion\": \"\",\n \"DocumentReviews\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocumentMetadata")
.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: '', DocumentVersion: '', DocumentReviews: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocumentMetadata',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Name: '', DocumentVersion: '', DocumentReviews: ''},
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=AmazonSSM.UpdateDocumentMetadata');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Name: '',
DocumentVersion: '',
DocumentReviews: ''
});
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=AmazonSSM.UpdateDocumentMetadata',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Name: '', DocumentVersion: '', DocumentReviews: ''}
};
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=AmazonSSM.UpdateDocumentMetadata';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","DocumentVersion":"","DocumentReviews":""}'
};
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": @"",
@"DocumentVersion": @"",
@"DocumentReviews": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocumentMetadata"]
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=AmazonSSM.UpdateDocumentMetadata" 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 \"DocumentVersion\": \"\",\n \"DocumentReviews\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocumentMetadata",
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' => '',
'DocumentVersion' => '',
'DocumentReviews' => ''
]),
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=AmazonSSM.UpdateDocumentMetadata', [
'body' => '{
"Name": "",
"DocumentVersion": "",
"DocumentReviews": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocumentMetadata');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Name' => '',
'DocumentVersion' => '',
'DocumentReviews' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Name' => '',
'DocumentVersion' => '',
'DocumentReviews' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocumentMetadata');
$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=AmazonSSM.UpdateDocumentMetadata' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"DocumentVersion": "",
"DocumentReviews": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocumentMetadata' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"DocumentVersion": "",
"DocumentReviews": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentReviews\": \"\"\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=AmazonSSM.UpdateDocumentMetadata"
payload = {
"Name": "",
"DocumentVersion": "",
"DocumentReviews": ""
}
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=AmazonSSM.UpdateDocumentMetadata"
payload <- "{\n \"Name\": \"\",\n \"DocumentVersion\": \"\",\n \"DocumentReviews\": \"\"\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=AmazonSSM.UpdateDocumentMetadata")
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 \"DocumentVersion\": \"\",\n \"DocumentReviews\": \"\"\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 \"DocumentVersion\": \"\",\n \"DocumentReviews\": \"\"\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=AmazonSSM.UpdateDocumentMetadata";
let payload = json!({
"Name": "",
"DocumentVersion": "",
"DocumentReviews": ""
});
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=AmazonSSM.UpdateDocumentMetadata' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Name": "",
"DocumentVersion": "",
"DocumentReviews": ""
}'
echo '{
"Name": "",
"DocumentVersion": "",
"DocumentReviews": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocumentMetadata' \
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 "DocumentVersion": "",\n "DocumentReviews": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocumentMetadata'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Name": "",
"DocumentVersion": "",
"DocumentReviews": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateDocumentMetadata")! 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
UpdateMaintenanceWindow
{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindow
HEADERS
X-Amz-Target
BODY json
{
"WindowId": "",
"Name": "",
"Description": "",
"StartDate": "",
"EndDate": "",
"Schedule": "",
"ScheduleTimezone": "",
"ScheduleOffset": "",
"Duration": "",
"Cutoff": "",
"AllowUnassociatedTargets": "",
"Enabled": "",
"Replace": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindow");
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 \"WindowId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"Schedule\": \"\",\n \"ScheduleTimezone\": \"\",\n \"ScheduleOffset\": \"\",\n \"Duration\": \"\",\n \"Cutoff\": \"\",\n \"AllowUnassociatedTargets\": \"\",\n \"Enabled\": \"\",\n \"Replace\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindow" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:WindowId ""
:Name ""
:Description ""
:StartDate ""
:EndDate ""
:Schedule ""
:ScheduleTimezone ""
:ScheduleOffset ""
:Duration ""
:Cutoff ""
:AllowUnassociatedTargets ""
:Enabled ""
:Replace ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindow"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"WindowId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"Schedule\": \"\",\n \"ScheduleTimezone\": \"\",\n \"ScheduleOffset\": \"\",\n \"Duration\": \"\",\n \"Cutoff\": \"\",\n \"AllowUnassociatedTargets\": \"\",\n \"Enabled\": \"\",\n \"Replace\": \"\"\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=AmazonSSM.UpdateMaintenanceWindow"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"WindowId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"Schedule\": \"\",\n \"ScheduleTimezone\": \"\",\n \"ScheduleOffset\": \"\",\n \"Duration\": \"\",\n \"Cutoff\": \"\",\n \"AllowUnassociatedTargets\": \"\",\n \"Enabled\": \"\",\n \"Replace\": \"\"\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=AmazonSSM.UpdateMaintenanceWindow");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"WindowId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"Schedule\": \"\",\n \"ScheduleTimezone\": \"\",\n \"ScheduleOffset\": \"\",\n \"Duration\": \"\",\n \"Cutoff\": \"\",\n \"AllowUnassociatedTargets\": \"\",\n \"Enabled\": \"\",\n \"Replace\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindow"
payload := strings.NewReader("{\n \"WindowId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"Schedule\": \"\",\n \"ScheduleTimezone\": \"\",\n \"ScheduleOffset\": \"\",\n \"Duration\": \"\",\n \"Cutoff\": \"\",\n \"AllowUnassociatedTargets\": \"\",\n \"Enabled\": \"\",\n \"Replace\": \"\"\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: 261
{
"WindowId": "",
"Name": "",
"Description": "",
"StartDate": "",
"EndDate": "",
"Schedule": "",
"ScheduleTimezone": "",
"ScheduleOffset": "",
"Duration": "",
"Cutoff": "",
"AllowUnassociatedTargets": "",
"Enabled": "",
"Replace": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindow")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"WindowId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"Schedule\": \"\",\n \"ScheduleTimezone\": \"\",\n \"ScheduleOffset\": \"\",\n \"Duration\": \"\",\n \"Cutoff\": \"\",\n \"AllowUnassociatedTargets\": \"\",\n \"Enabled\": \"\",\n \"Replace\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindow"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"WindowId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"Schedule\": \"\",\n \"ScheduleTimezone\": \"\",\n \"ScheduleOffset\": \"\",\n \"Duration\": \"\",\n \"Cutoff\": \"\",\n \"AllowUnassociatedTargets\": \"\",\n \"Enabled\": \"\",\n \"Replace\": \"\"\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 \"WindowId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"Schedule\": \"\",\n \"ScheduleTimezone\": \"\",\n \"ScheduleOffset\": \"\",\n \"Duration\": \"\",\n \"Cutoff\": \"\",\n \"AllowUnassociatedTargets\": \"\",\n \"Enabled\": \"\",\n \"Replace\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindow")
.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=AmazonSSM.UpdateMaintenanceWindow")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"WindowId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"Schedule\": \"\",\n \"ScheduleTimezone\": \"\",\n \"ScheduleOffset\": \"\",\n \"Duration\": \"\",\n \"Cutoff\": \"\",\n \"AllowUnassociatedTargets\": \"\",\n \"Enabled\": \"\",\n \"Replace\": \"\"\n}")
.asString();
const data = JSON.stringify({
WindowId: '',
Name: '',
Description: '',
StartDate: '',
EndDate: '',
Schedule: '',
ScheduleTimezone: '',
ScheduleOffset: '',
Duration: '',
Cutoff: '',
AllowUnassociatedTargets: '',
Enabled: '',
Replace: ''
});
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=AmazonSSM.UpdateMaintenanceWindow');
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=AmazonSSM.UpdateMaintenanceWindow',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
WindowId: '',
Name: '',
Description: '',
StartDate: '',
EndDate: '',
Schedule: '',
ScheduleTimezone: '',
ScheduleOffset: '',
Duration: '',
Cutoff: '',
AllowUnassociatedTargets: '',
Enabled: '',
Replace: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindow';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowId":"","Name":"","Description":"","StartDate":"","EndDate":"","Schedule":"","ScheduleTimezone":"","ScheduleOffset":"","Duration":"","Cutoff":"","AllowUnassociatedTargets":"","Enabled":"","Replace":""}'
};
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=AmazonSSM.UpdateMaintenanceWindow',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "WindowId": "",\n "Name": "",\n "Description": "",\n "StartDate": "",\n "EndDate": "",\n "Schedule": "",\n "ScheduleTimezone": "",\n "ScheduleOffset": "",\n "Duration": "",\n "Cutoff": "",\n "AllowUnassociatedTargets": "",\n "Enabled": "",\n "Replace": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"WindowId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"Schedule\": \"\",\n \"ScheduleTimezone\": \"\",\n \"ScheduleOffset\": \"\",\n \"Duration\": \"\",\n \"Cutoff\": \"\",\n \"AllowUnassociatedTargets\": \"\",\n \"Enabled\": \"\",\n \"Replace\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindow")
.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({
WindowId: '',
Name: '',
Description: '',
StartDate: '',
EndDate: '',
Schedule: '',
ScheduleTimezone: '',
ScheduleOffset: '',
Duration: '',
Cutoff: '',
AllowUnassociatedTargets: '',
Enabled: '',
Replace: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindow',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
WindowId: '',
Name: '',
Description: '',
StartDate: '',
EndDate: '',
Schedule: '',
ScheduleTimezone: '',
ScheduleOffset: '',
Duration: '',
Cutoff: '',
AllowUnassociatedTargets: '',
Enabled: '',
Replace: ''
},
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=AmazonSSM.UpdateMaintenanceWindow');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
WindowId: '',
Name: '',
Description: '',
StartDate: '',
EndDate: '',
Schedule: '',
ScheduleTimezone: '',
ScheduleOffset: '',
Duration: '',
Cutoff: '',
AllowUnassociatedTargets: '',
Enabled: '',
Replace: ''
});
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=AmazonSSM.UpdateMaintenanceWindow',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
WindowId: '',
Name: '',
Description: '',
StartDate: '',
EndDate: '',
Schedule: '',
ScheduleTimezone: '',
ScheduleOffset: '',
Duration: '',
Cutoff: '',
AllowUnassociatedTargets: '',
Enabled: '',
Replace: ''
}
};
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=AmazonSSM.UpdateMaintenanceWindow';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowId":"","Name":"","Description":"","StartDate":"","EndDate":"","Schedule":"","ScheduleTimezone":"","ScheduleOffset":"","Duration":"","Cutoff":"","AllowUnassociatedTargets":"","Enabled":"","Replace":""}'
};
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 = @{ @"WindowId": @"",
@"Name": @"",
@"Description": @"",
@"StartDate": @"",
@"EndDate": @"",
@"Schedule": @"",
@"ScheduleTimezone": @"",
@"ScheduleOffset": @"",
@"Duration": @"",
@"Cutoff": @"",
@"AllowUnassociatedTargets": @"",
@"Enabled": @"",
@"Replace": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindow"]
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=AmazonSSM.UpdateMaintenanceWindow" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"WindowId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"Schedule\": \"\",\n \"ScheduleTimezone\": \"\",\n \"ScheduleOffset\": \"\",\n \"Duration\": \"\",\n \"Cutoff\": \"\",\n \"AllowUnassociatedTargets\": \"\",\n \"Enabled\": \"\",\n \"Replace\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindow",
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([
'WindowId' => '',
'Name' => '',
'Description' => '',
'StartDate' => '',
'EndDate' => '',
'Schedule' => '',
'ScheduleTimezone' => '',
'ScheduleOffset' => '',
'Duration' => '',
'Cutoff' => '',
'AllowUnassociatedTargets' => '',
'Enabled' => '',
'Replace' => ''
]),
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=AmazonSSM.UpdateMaintenanceWindow', [
'body' => '{
"WindowId": "",
"Name": "",
"Description": "",
"StartDate": "",
"EndDate": "",
"Schedule": "",
"ScheduleTimezone": "",
"ScheduleOffset": "",
"Duration": "",
"Cutoff": "",
"AllowUnassociatedTargets": "",
"Enabled": "",
"Replace": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindow');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'WindowId' => '',
'Name' => '',
'Description' => '',
'StartDate' => '',
'EndDate' => '',
'Schedule' => '',
'ScheduleTimezone' => '',
'ScheduleOffset' => '',
'Duration' => '',
'Cutoff' => '',
'AllowUnassociatedTargets' => '',
'Enabled' => '',
'Replace' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'WindowId' => '',
'Name' => '',
'Description' => '',
'StartDate' => '',
'EndDate' => '',
'Schedule' => '',
'ScheduleTimezone' => '',
'ScheduleOffset' => '',
'Duration' => '',
'Cutoff' => '',
'AllowUnassociatedTargets' => '',
'Enabled' => '',
'Replace' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindow');
$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=AmazonSSM.UpdateMaintenanceWindow' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowId": "",
"Name": "",
"Description": "",
"StartDate": "",
"EndDate": "",
"Schedule": "",
"ScheduleTimezone": "",
"ScheduleOffset": "",
"Duration": "",
"Cutoff": "",
"AllowUnassociatedTargets": "",
"Enabled": "",
"Replace": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindow' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowId": "",
"Name": "",
"Description": "",
"StartDate": "",
"EndDate": "",
"Schedule": "",
"ScheduleTimezone": "",
"ScheduleOffset": "",
"Duration": "",
"Cutoff": "",
"AllowUnassociatedTargets": "",
"Enabled": "",
"Replace": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"WindowId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"Schedule\": \"\",\n \"ScheduleTimezone\": \"\",\n \"ScheduleOffset\": \"\",\n \"Duration\": \"\",\n \"Cutoff\": \"\",\n \"AllowUnassociatedTargets\": \"\",\n \"Enabled\": \"\",\n \"Replace\": \"\"\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=AmazonSSM.UpdateMaintenanceWindow"
payload = {
"WindowId": "",
"Name": "",
"Description": "",
"StartDate": "",
"EndDate": "",
"Schedule": "",
"ScheduleTimezone": "",
"ScheduleOffset": "",
"Duration": "",
"Cutoff": "",
"AllowUnassociatedTargets": "",
"Enabled": "",
"Replace": ""
}
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=AmazonSSM.UpdateMaintenanceWindow"
payload <- "{\n \"WindowId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"Schedule\": \"\",\n \"ScheduleTimezone\": \"\",\n \"ScheduleOffset\": \"\",\n \"Duration\": \"\",\n \"Cutoff\": \"\",\n \"AllowUnassociatedTargets\": \"\",\n \"Enabled\": \"\",\n \"Replace\": \"\"\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=AmazonSSM.UpdateMaintenanceWindow")
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 \"WindowId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"Schedule\": \"\",\n \"ScheduleTimezone\": \"\",\n \"ScheduleOffset\": \"\",\n \"Duration\": \"\",\n \"Cutoff\": \"\",\n \"AllowUnassociatedTargets\": \"\",\n \"Enabled\": \"\",\n \"Replace\": \"\"\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 \"WindowId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"StartDate\": \"\",\n \"EndDate\": \"\",\n \"Schedule\": \"\",\n \"ScheduleTimezone\": \"\",\n \"ScheduleOffset\": \"\",\n \"Duration\": \"\",\n \"Cutoff\": \"\",\n \"AllowUnassociatedTargets\": \"\",\n \"Enabled\": \"\",\n \"Replace\": \"\"\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=AmazonSSM.UpdateMaintenanceWindow";
let payload = json!({
"WindowId": "",
"Name": "",
"Description": "",
"StartDate": "",
"EndDate": "",
"Schedule": "",
"ScheduleTimezone": "",
"ScheduleOffset": "",
"Duration": "",
"Cutoff": "",
"AllowUnassociatedTargets": "",
"Enabled": "",
"Replace": ""
});
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=AmazonSSM.UpdateMaintenanceWindow' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"WindowId": "",
"Name": "",
"Description": "",
"StartDate": "",
"EndDate": "",
"Schedule": "",
"ScheduleTimezone": "",
"ScheduleOffset": "",
"Duration": "",
"Cutoff": "",
"AllowUnassociatedTargets": "",
"Enabled": "",
"Replace": ""
}'
echo '{
"WindowId": "",
"Name": "",
"Description": "",
"StartDate": "",
"EndDate": "",
"Schedule": "",
"ScheduleTimezone": "",
"ScheduleOffset": "",
"Duration": "",
"Cutoff": "",
"AllowUnassociatedTargets": "",
"Enabled": "",
"Replace": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindow' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "WindowId": "",\n "Name": "",\n "Description": "",\n "StartDate": "",\n "EndDate": "",\n "Schedule": "",\n "ScheduleTimezone": "",\n "ScheduleOffset": "",\n "Duration": "",\n "Cutoff": "",\n "AllowUnassociatedTargets": "",\n "Enabled": "",\n "Replace": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindow'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"WindowId": "",
"Name": "",
"Description": "",
"StartDate": "",
"EndDate": "",
"Schedule": "",
"ScheduleTimezone": "",
"ScheduleOffset": "",
"Duration": "",
"Cutoff": "",
"AllowUnassociatedTargets": "",
"Enabled": "",
"Replace": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindow")! 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
UpdateMaintenanceWindowTarget
{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindowTarget
HEADERS
X-Amz-Target
BODY json
{
"WindowId": "",
"WindowTargetId": "",
"Targets": "",
"OwnerInformation": "",
"Name": "",
"Description": "",
"Replace": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindowTarget");
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 \"WindowId\": \"\",\n \"WindowTargetId\": \"\",\n \"Targets\": \"\",\n \"OwnerInformation\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Replace\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindowTarget" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:WindowId ""
:WindowTargetId ""
:Targets ""
:OwnerInformation ""
:Name ""
:Description ""
:Replace ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindowTarget"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"WindowId\": \"\",\n \"WindowTargetId\": \"\",\n \"Targets\": \"\",\n \"OwnerInformation\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Replace\": \"\"\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=AmazonSSM.UpdateMaintenanceWindowTarget"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"WindowId\": \"\",\n \"WindowTargetId\": \"\",\n \"Targets\": \"\",\n \"OwnerInformation\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Replace\": \"\"\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=AmazonSSM.UpdateMaintenanceWindowTarget");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"WindowId\": \"\",\n \"WindowTargetId\": \"\",\n \"Targets\": \"\",\n \"OwnerInformation\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Replace\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindowTarget"
payload := strings.NewReader("{\n \"WindowId\": \"\",\n \"WindowTargetId\": \"\",\n \"Targets\": \"\",\n \"OwnerInformation\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Replace\": \"\"\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: 139
{
"WindowId": "",
"WindowTargetId": "",
"Targets": "",
"OwnerInformation": "",
"Name": "",
"Description": "",
"Replace": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindowTarget")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"WindowId\": \"\",\n \"WindowTargetId\": \"\",\n \"Targets\": \"\",\n \"OwnerInformation\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Replace\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindowTarget"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"WindowId\": \"\",\n \"WindowTargetId\": \"\",\n \"Targets\": \"\",\n \"OwnerInformation\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Replace\": \"\"\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 \"WindowId\": \"\",\n \"WindowTargetId\": \"\",\n \"Targets\": \"\",\n \"OwnerInformation\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Replace\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindowTarget")
.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=AmazonSSM.UpdateMaintenanceWindowTarget")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"WindowId\": \"\",\n \"WindowTargetId\": \"\",\n \"Targets\": \"\",\n \"OwnerInformation\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Replace\": \"\"\n}")
.asString();
const data = JSON.stringify({
WindowId: '',
WindowTargetId: '',
Targets: '',
OwnerInformation: '',
Name: '',
Description: '',
Replace: ''
});
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=AmazonSSM.UpdateMaintenanceWindowTarget');
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=AmazonSSM.UpdateMaintenanceWindowTarget',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
WindowId: '',
WindowTargetId: '',
Targets: '',
OwnerInformation: '',
Name: '',
Description: '',
Replace: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindowTarget';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowId":"","WindowTargetId":"","Targets":"","OwnerInformation":"","Name":"","Description":"","Replace":""}'
};
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=AmazonSSM.UpdateMaintenanceWindowTarget',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "WindowId": "",\n "WindowTargetId": "",\n "Targets": "",\n "OwnerInformation": "",\n "Name": "",\n "Description": "",\n "Replace": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"WindowId\": \"\",\n \"WindowTargetId\": \"\",\n \"Targets\": \"\",\n \"OwnerInformation\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Replace\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindowTarget")
.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({
WindowId: '',
WindowTargetId: '',
Targets: '',
OwnerInformation: '',
Name: '',
Description: '',
Replace: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindowTarget',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
WindowId: '',
WindowTargetId: '',
Targets: '',
OwnerInformation: '',
Name: '',
Description: '',
Replace: ''
},
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=AmazonSSM.UpdateMaintenanceWindowTarget');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
WindowId: '',
WindowTargetId: '',
Targets: '',
OwnerInformation: '',
Name: '',
Description: '',
Replace: ''
});
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=AmazonSSM.UpdateMaintenanceWindowTarget',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
WindowId: '',
WindowTargetId: '',
Targets: '',
OwnerInformation: '',
Name: '',
Description: '',
Replace: ''
}
};
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=AmazonSSM.UpdateMaintenanceWindowTarget';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowId":"","WindowTargetId":"","Targets":"","OwnerInformation":"","Name":"","Description":"","Replace":""}'
};
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 = @{ @"WindowId": @"",
@"WindowTargetId": @"",
@"Targets": @"",
@"OwnerInformation": @"",
@"Name": @"",
@"Description": @"",
@"Replace": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindowTarget"]
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=AmazonSSM.UpdateMaintenanceWindowTarget" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"WindowId\": \"\",\n \"WindowTargetId\": \"\",\n \"Targets\": \"\",\n \"OwnerInformation\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Replace\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindowTarget",
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([
'WindowId' => '',
'WindowTargetId' => '',
'Targets' => '',
'OwnerInformation' => '',
'Name' => '',
'Description' => '',
'Replace' => ''
]),
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=AmazonSSM.UpdateMaintenanceWindowTarget', [
'body' => '{
"WindowId": "",
"WindowTargetId": "",
"Targets": "",
"OwnerInformation": "",
"Name": "",
"Description": "",
"Replace": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindowTarget');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'WindowId' => '',
'WindowTargetId' => '',
'Targets' => '',
'OwnerInformation' => '',
'Name' => '',
'Description' => '',
'Replace' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'WindowId' => '',
'WindowTargetId' => '',
'Targets' => '',
'OwnerInformation' => '',
'Name' => '',
'Description' => '',
'Replace' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindowTarget');
$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=AmazonSSM.UpdateMaintenanceWindowTarget' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowId": "",
"WindowTargetId": "",
"Targets": "",
"OwnerInformation": "",
"Name": "",
"Description": "",
"Replace": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindowTarget' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowId": "",
"WindowTargetId": "",
"Targets": "",
"OwnerInformation": "",
"Name": "",
"Description": "",
"Replace": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"WindowId\": \"\",\n \"WindowTargetId\": \"\",\n \"Targets\": \"\",\n \"OwnerInformation\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Replace\": \"\"\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=AmazonSSM.UpdateMaintenanceWindowTarget"
payload = {
"WindowId": "",
"WindowTargetId": "",
"Targets": "",
"OwnerInformation": "",
"Name": "",
"Description": "",
"Replace": ""
}
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=AmazonSSM.UpdateMaintenanceWindowTarget"
payload <- "{\n \"WindowId\": \"\",\n \"WindowTargetId\": \"\",\n \"Targets\": \"\",\n \"OwnerInformation\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Replace\": \"\"\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=AmazonSSM.UpdateMaintenanceWindowTarget")
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 \"WindowId\": \"\",\n \"WindowTargetId\": \"\",\n \"Targets\": \"\",\n \"OwnerInformation\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Replace\": \"\"\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 \"WindowId\": \"\",\n \"WindowTargetId\": \"\",\n \"Targets\": \"\",\n \"OwnerInformation\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Replace\": \"\"\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=AmazonSSM.UpdateMaintenanceWindowTarget";
let payload = json!({
"WindowId": "",
"WindowTargetId": "",
"Targets": "",
"OwnerInformation": "",
"Name": "",
"Description": "",
"Replace": ""
});
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=AmazonSSM.UpdateMaintenanceWindowTarget' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"WindowId": "",
"WindowTargetId": "",
"Targets": "",
"OwnerInformation": "",
"Name": "",
"Description": "",
"Replace": ""
}'
echo '{
"WindowId": "",
"WindowTargetId": "",
"Targets": "",
"OwnerInformation": "",
"Name": "",
"Description": "",
"Replace": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindowTarget' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "WindowId": "",\n "WindowTargetId": "",\n "Targets": "",\n "OwnerInformation": "",\n "Name": "",\n "Description": "",\n "Replace": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindowTarget'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"WindowId": "",
"WindowTargetId": "",
"Targets": "",
"OwnerInformation": "",
"Name": "",
"Description": "",
"Replace": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindowTarget")! 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
UpdateMaintenanceWindowTask
{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindowTask
HEADERS
X-Amz-Target
BODY json
{
"WindowId": "",
"WindowTaskId": "",
"Targets": "",
"TaskArn": "",
"ServiceRoleArn": "",
"TaskParameters": "",
"TaskInvocationParameters": "",
"Priority": "",
"MaxConcurrency": "",
"MaxErrors": "",
"LoggingInfo": "",
"Name": "",
"Description": "",
"Replace": "",
"CutoffBehavior": "",
"AlarmConfiguration": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindowTask");
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 \"WindowId\": \"\",\n \"WindowTaskId\": \"\",\n \"Targets\": \"\",\n \"TaskArn\": \"\",\n \"ServiceRoleArn\": \"\",\n \"TaskParameters\": \"\",\n \"TaskInvocationParameters\": \"\",\n \"Priority\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"LoggingInfo\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Replace\": \"\",\n \"CutoffBehavior\": \"\",\n \"AlarmConfiguration\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindowTask" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:WindowId ""
:WindowTaskId ""
:Targets ""
:TaskArn ""
:ServiceRoleArn ""
:TaskParameters ""
:TaskInvocationParameters ""
:Priority ""
:MaxConcurrency ""
:MaxErrors ""
:LoggingInfo ""
:Name ""
:Description ""
:Replace ""
:CutoffBehavior ""
:AlarmConfiguration ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindowTask"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"WindowId\": \"\",\n \"WindowTaskId\": \"\",\n \"Targets\": \"\",\n \"TaskArn\": \"\",\n \"ServiceRoleArn\": \"\",\n \"TaskParameters\": \"\",\n \"TaskInvocationParameters\": \"\",\n \"Priority\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"LoggingInfo\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Replace\": \"\",\n \"CutoffBehavior\": \"\",\n \"AlarmConfiguration\": \"\"\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=AmazonSSM.UpdateMaintenanceWindowTask"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"WindowId\": \"\",\n \"WindowTaskId\": \"\",\n \"Targets\": \"\",\n \"TaskArn\": \"\",\n \"ServiceRoleArn\": \"\",\n \"TaskParameters\": \"\",\n \"TaskInvocationParameters\": \"\",\n \"Priority\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"LoggingInfo\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Replace\": \"\",\n \"CutoffBehavior\": \"\",\n \"AlarmConfiguration\": \"\"\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=AmazonSSM.UpdateMaintenanceWindowTask");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"WindowId\": \"\",\n \"WindowTaskId\": \"\",\n \"Targets\": \"\",\n \"TaskArn\": \"\",\n \"ServiceRoleArn\": \"\",\n \"TaskParameters\": \"\",\n \"TaskInvocationParameters\": \"\",\n \"Priority\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"LoggingInfo\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Replace\": \"\",\n \"CutoffBehavior\": \"\",\n \"AlarmConfiguration\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindowTask"
payload := strings.NewReader("{\n \"WindowId\": \"\",\n \"WindowTaskId\": \"\",\n \"Targets\": \"\",\n \"TaskArn\": \"\",\n \"ServiceRoleArn\": \"\",\n \"TaskParameters\": \"\",\n \"TaskInvocationParameters\": \"\",\n \"Priority\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"LoggingInfo\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Replace\": \"\",\n \"CutoffBehavior\": \"\",\n \"AlarmConfiguration\": \"\"\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: 344
{
"WindowId": "",
"WindowTaskId": "",
"Targets": "",
"TaskArn": "",
"ServiceRoleArn": "",
"TaskParameters": "",
"TaskInvocationParameters": "",
"Priority": "",
"MaxConcurrency": "",
"MaxErrors": "",
"LoggingInfo": "",
"Name": "",
"Description": "",
"Replace": "",
"CutoffBehavior": "",
"AlarmConfiguration": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindowTask")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"WindowId\": \"\",\n \"WindowTaskId\": \"\",\n \"Targets\": \"\",\n \"TaskArn\": \"\",\n \"ServiceRoleArn\": \"\",\n \"TaskParameters\": \"\",\n \"TaskInvocationParameters\": \"\",\n \"Priority\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"LoggingInfo\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Replace\": \"\",\n \"CutoffBehavior\": \"\",\n \"AlarmConfiguration\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindowTask"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"WindowId\": \"\",\n \"WindowTaskId\": \"\",\n \"Targets\": \"\",\n \"TaskArn\": \"\",\n \"ServiceRoleArn\": \"\",\n \"TaskParameters\": \"\",\n \"TaskInvocationParameters\": \"\",\n \"Priority\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"LoggingInfo\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Replace\": \"\",\n \"CutoffBehavior\": \"\",\n \"AlarmConfiguration\": \"\"\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 \"WindowId\": \"\",\n \"WindowTaskId\": \"\",\n \"Targets\": \"\",\n \"TaskArn\": \"\",\n \"ServiceRoleArn\": \"\",\n \"TaskParameters\": \"\",\n \"TaskInvocationParameters\": \"\",\n \"Priority\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"LoggingInfo\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Replace\": \"\",\n \"CutoffBehavior\": \"\",\n \"AlarmConfiguration\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindowTask")
.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=AmazonSSM.UpdateMaintenanceWindowTask")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"WindowId\": \"\",\n \"WindowTaskId\": \"\",\n \"Targets\": \"\",\n \"TaskArn\": \"\",\n \"ServiceRoleArn\": \"\",\n \"TaskParameters\": \"\",\n \"TaskInvocationParameters\": \"\",\n \"Priority\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"LoggingInfo\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Replace\": \"\",\n \"CutoffBehavior\": \"\",\n \"AlarmConfiguration\": \"\"\n}")
.asString();
const data = JSON.stringify({
WindowId: '',
WindowTaskId: '',
Targets: '',
TaskArn: '',
ServiceRoleArn: '',
TaskParameters: '',
TaskInvocationParameters: '',
Priority: '',
MaxConcurrency: '',
MaxErrors: '',
LoggingInfo: '',
Name: '',
Description: '',
Replace: '',
CutoffBehavior: '',
AlarmConfiguration: ''
});
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=AmazonSSM.UpdateMaintenanceWindowTask');
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=AmazonSSM.UpdateMaintenanceWindowTask',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
WindowId: '',
WindowTaskId: '',
Targets: '',
TaskArn: '',
ServiceRoleArn: '',
TaskParameters: '',
TaskInvocationParameters: '',
Priority: '',
MaxConcurrency: '',
MaxErrors: '',
LoggingInfo: '',
Name: '',
Description: '',
Replace: '',
CutoffBehavior: '',
AlarmConfiguration: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindowTask';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowId":"","WindowTaskId":"","Targets":"","TaskArn":"","ServiceRoleArn":"","TaskParameters":"","TaskInvocationParameters":"","Priority":"","MaxConcurrency":"","MaxErrors":"","LoggingInfo":"","Name":"","Description":"","Replace":"","CutoffBehavior":"","AlarmConfiguration":""}'
};
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=AmazonSSM.UpdateMaintenanceWindowTask',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "WindowId": "",\n "WindowTaskId": "",\n "Targets": "",\n "TaskArn": "",\n "ServiceRoleArn": "",\n "TaskParameters": "",\n "TaskInvocationParameters": "",\n "Priority": "",\n "MaxConcurrency": "",\n "MaxErrors": "",\n "LoggingInfo": "",\n "Name": "",\n "Description": "",\n "Replace": "",\n "CutoffBehavior": "",\n "AlarmConfiguration": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"WindowId\": \"\",\n \"WindowTaskId\": \"\",\n \"Targets\": \"\",\n \"TaskArn\": \"\",\n \"ServiceRoleArn\": \"\",\n \"TaskParameters\": \"\",\n \"TaskInvocationParameters\": \"\",\n \"Priority\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"LoggingInfo\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Replace\": \"\",\n \"CutoffBehavior\": \"\",\n \"AlarmConfiguration\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindowTask")
.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({
WindowId: '',
WindowTaskId: '',
Targets: '',
TaskArn: '',
ServiceRoleArn: '',
TaskParameters: '',
TaskInvocationParameters: '',
Priority: '',
MaxConcurrency: '',
MaxErrors: '',
LoggingInfo: '',
Name: '',
Description: '',
Replace: '',
CutoffBehavior: '',
AlarmConfiguration: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindowTask',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
WindowId: '',
WindowTaskId: '',
Targets: '',
TaskArn: '',
ServiceRoleArn: '',
TaskParameters: '',
TaskInvocationParameters: '',
Priority: '',
MaxConcurrency: '',
MaxErrors: '',
LoggingInfo: '',
Name: '',
Description: '',
Replace: '',
CutoffBehavior: '',
AlarmConfiguration: ''
},
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=AmazonSSM.UpdateMaintenanceWindowTask');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
WindowId: '',
WindowTaskId: '',
Targets: '',
TaskArn: '',
ServiceRoleArn: '',
TaskParameters: '',
TaskInvocationParameters: '',
Priority: '',
MaxConcurrency: '',
MaxErrors: '',
LoggingInfo: '',
Name: '',
Description: '',
Replace: '',
CutoffBehavior: '',
AlarmConfiguration: ''
});
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=AmazonSSM.UpdateMaintenanceWindowTask',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
WindowId: '',
WindowTaskId: '',
Targets: '',
TaskArn: '',
ServiceRoleArn: '',
TaskParameters: '',
TaskInvocationParameters: '',
Priority: '',
MaxConcurrency: '',
MaxErrors: '',
LoggingInfo: '',
Name: '',
Description: '',
Replace: '',
CutoffBehavior: '',
AlarmConfiguration: ''
}
};
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=AmazonSSM.UpdateMaintenanceWindowTask';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"WindowId":"","WindowTaskId":"","Targets":"","TaskArn":"","ServiceRoleArn":"","TaskParameters":"","TaskInvocationParameters":"","Priority":"","MaxConcurrency":"","MaxErrors":"","LoggingInfo":"","Name":"","Description":"","Replace":"","CutoffBehavior":"","AlarmConfiguration":""}'
};
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 = @{ @"WindowId": @"",
@"WindowTaskId": @"",
@"Targets": @"",
@"TaskArn": @"",
@"ServiceRoleArn": @"",
@"TaskParameters": @"",
@"TaskInvocationParameters": @"",
@"Priority": @"",
@"MaxConcurrency": @"",
@"MaxErrors": @"",
@"LoggingInfo": @"",
@"Name": @"",
@"Description": @"",
@"Replace": @"",
@"CutoffBehavior": @"",
@"AlarmConfiguration": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindowTask"]
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=AmazonSSM.UpdateMaintenanceWindowTask" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"WindowId\": \"\",\n \"WindowTaskId\": \"\",\n \"Targets\": \"\",\n \"TaskArn\": \"\",\n \"ServiceRoleArn\": \"\",\n \"TaskParameters\": \"\",\n \"TaskInvocationParameters\": \"\",\n \"Priority\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"LoggingInfo\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Replace\": \"\",\n \"CutoffBehavior\": \"\",\n \"AlarmConfiguration\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindowTask",
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([
'WindowId' => '',
'WindowTaskId' => '',
'Targets' => '',
'TaskArn' => '',
'ServiceRoleArn' => '',
'TaskParameters' => '',
'TaskInvocationParameters' => '',
'Priority' => '',
'MaxConcurrency' => '',
'MaxErrors' => '',
'LoggingInfo' => '',
'Name' => '',
'Description' => '',
'Replace' => '',
'CutoffBehavior' => '',
'AlarmConfiguration' => ''
]),
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=AmazonSSM.UpdateMaintenanceWindowTask', [
'body' => '{
"WindowId": "",
"WindowTaskId": "",
"Targets": "",
"TaskArn": "",
"ServiceRoleArn": "",
"TaskParameters": "",
"TaskInvocationParameters": "",
"Priority": "",
"MaxConcurrency": "",
"MaxErrors": "",
"LoggingInfo": "",
"Name": "",
"Description": "",
"Replace": "",
"CutoffBehavior": "",
"AlarmConfiguration": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindowTask');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'WindowId' => '',
'WindowTaskId' => '',
'Targets' => '',
'TaskArn' => '',
'ServiceRoleArn' => '',
'TaskParameters' => '',
'TaskInvocationParameters' => '',
'Priority' => '',
'MaxConcurrency' => '',
'MaxErrors' => '',
'LoggingInfo' => '',
'Name' => '',
'Description' => '',
'Replace' => '',
'CutoffBehavior' => '',
'AlarmConfiguration' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'WindowId' => '',
'WindowTaskId' => '',
'Targets' => '',
'TaskArn' => '',
'ServiceRoleArn' => '',
'TaskParameters' => '',
'TaskInvocationParameters' => '',
'Priority' => '',
'MaxConcurrency' => '',
'MaxErrors' => '',
'LoggingInfo' => '',
'Name' => '',
'Description' => '',
'Replace' => '',
'CutoffBehavior' => '',
'AlarmConfiguration' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindowTask');
$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=AmazonSSM.UpdateMaintenanceWindowTask' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowId": "",
"WindowTaskId": "",
"Targets": "",
"TaskArn": "",
"ServiceRoleArn": "",
"TaskParameters": "",
"TaskInvocationParameters": "",
"Priority": "",
"MaxConcurrency": "",
"MaxErrors": "",
"LoggingInfo": "",
"Name": "",
"Description": "",
"Replace": "",
"CutoffBehavior": "",
"AlarmConfiguration": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindowTask' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"WindowId": "",
"WindowTaskId": "",
"Targets": "",
"TaskArn": "",
"ServiceRoleArn": "",
"TaskParameters": "",
"TaskInvocationParameters": "",
"Priority": "",
"MaxConcurrency": "",
"MaxErrors": "",
"LoggingInfo": "",
"Name": "",
"Description": "",
"Replace": "",
"CutoffBehavior": "",
"AlarmConfiguration": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"WindowId\": \"\",\n \"WindowTaskId\": \"\",\n \"Targets\": \"\",\n \"TaskArn\": \"\",\n \"ServiceRoleArn\": \"\",\n \"TaskParameters\": \"\",\n \"TaskInvocationParameters\": \"\",\n \"Priority\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"LoggingInfo\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Replace\": \"\",\n \"CutoffBehavior\": \"\",\n \"AlarmConfiguration\": \"\"\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=AmazonSSM.UpdateMaintenanceWindowTask"
payload = {
"WindowId": "",
"WindowTaskId": "",
"Targets": "",
"TaskArn": "",
"ServiceRoleArn": "",
"TaskParameters": "",
"TaskInvocationParameters": "",
"Priority": "",
"MaxConcurrency": "",
"MaxErrors": "",
"LoggingInfo": "",
"Name": "",
"Description": "",
"Replace": "",
"CutoffBehavior": "",
"AlarmConfiguration": ""
}
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=AmazonSSM.UpdateMaintenanceWindowTask"
payload <- "{\n \"WindowId\": \"\",\n \"WindowTaskId\": \"\",\n \"Targets\": \"\",\n \"TaskArn\": \"\",\n \"ServiceRoleArn\": \"\",\n \"TaskParameters\": \"\",\n \"TaskInvocationParameters\": \"\",\n \"Priority\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"LoggingInfo\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Replace\": \"\",\n \"CutoffBehavior\": \"\",\n \"AlarmConfiguration\": \"\"\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=AmazonSSM.UpdateMaintenanceWindowTask")
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 \"WindowId\": \"\",\n \"WindowTaskId\": \"\",\n \"Targets\": \"\",\n \"TaskArn\": \"\",\n \"ServiceRoleArn\": \"\",\n \"TaskParameters\": \"\",\n \"TaskInvocationParameters\": \"\",\n \"Priority\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"LoggingInfo\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Replace\": \"\",\n \"CutoffBehavior\": \"\",\n \"AlarmConfiguration\": \"\"\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 \"WindowId\": \"\",\n \"WindowTaskId\": \"\",\n \"Targets\": \"\",\n \"TaskArn\": \"\",\n \"ServiceRoleArn\": \"\",\n \"TaskParameters\": \"\",\n \"TaskInvocationParameters\": \"\",\n \"Priority\": \"\",\n \"MaxConcurrency\": \"\",\n \"MaxErrors\": \"\",\n \"LoggingInfo\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Replace\": \"\",\n \"CutoffBehavior\": \"\",\n \"AlarmConfiguration\": \"\"\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=AmazonSSM.UpdateMaintenanceWindowTask";
let payload = json!({
"WindowId": "",
"WindowTaskId": "",
"Targets": "",
"TaskArn": "",
"ServiceRoleArn": "",
"TaskParameters": "",
"TaskInvocationParameters": "",
"Priority": "",
"MaxConcurrency": "",
"MaxErrors": "",
"LoggingInfo": "",
"Name": "",
"Description": "",
"Replace": "",
"CutoffBehavior": "",
"AlarmConfiguration": ""
});
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=AmazonSSM.UpdateMaintenanceWindowTask' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"WindowId": "",
"WindowTaskId": "",
"Targets": "",
"TaskArn": "",
"ServiceRoleArn": "",
"TaskParameters": "",
"TaskInvocationParameters": "",
"Priority": "",
"MaxConcurrency": "",
"MaxErrors": "",
"LoggingInfo": "",
"Name": "",
"Description": "",
"Replace": "",
"CutoffBehavior": "",
"AlarmConfiguration": ""
}'
echo '{
"WindowId": "",
"WindowTaskId": "",
"Targets": "",
"TaskArn": "",
"ServiceRoleArn": "",
"TaskParameters": "",
"TaskInvocationParameters": "",
"Priority": "",
"MaxConcurrency": "",
"MaxErrors": "",
"LoggingInfo": "",
"Name": "",
"Description": "",
"Replace": "",
"CutoffBehavior": "",
"AlarmConfiguration": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindowTask' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "WindowId": "",\n "WindowTaskId": "",\n "Targets": "",\n "TaskArn": "",\n "ServiceRoleArn": "",\n "TaskParameters": "",\n "TaskInvocationParameters": "",\n "Priority": "",\n "MaxConcurrency": "",\n "MaxErrors": "",\n "LoggingInfo": "",\n "Name": "",\n "Description": "",\n "Replace": "",\n "CutoffBehavior": "",\n "AlarmConfiguration": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindowTask'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"WindowId": "",
"WindowTaskId": "",
"Targets": "",
"TaskArn": "",
"ServiceRoleArn": "",
"TaskParameters": "",
"TaskInvocationParameters": "",
"Priority": "",
"MaxConcurrency": "",
"MaxErrors": "",
"LoggingInfo": "",
"Name": "",
"Description": "",
"Replace": "",
"CutoffBehavior": "",
"AlarmConfiguration": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateMaintenanceWindowTask")! 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
UpdateManagedInstanceRole
{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateManagedInstanceRole
HEADERS
X-Amz-Target
BODY json
{
"InstanceId": "",
"IamRole": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateManagedInstanceRole");
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 \"InstanceId\": \"\",\n \"IamRole\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateManagedInstanceRole" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:InstanceId ""
:IamRole ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateManagedInstanceRole"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"InstanceId\": \"\",\n \"IamRole\": \"\"\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=AmazonSSM.UpdateManagedInstanceRole"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"InstanceId\": \"\",\n \"IamRole\": \"\"\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=AmazonSSM.UpdateManagedInstanceRole");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"InstanceId\": \"\",\n \"IamRole\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateManagedInstanceRole"
payload := strings.NewReader("{\n \"InstanceId\": \"\",\n \"IamRole\": \"\"\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
{
"InstanceId": "",
"IamRole": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateManagedInstanceRole")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"InstanceId\": \"\",\n \"IamRole\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateManagedInstanceRole"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"InstanceId\": \"\",\n \"IamRole\": \"\"\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 \"InstanceId\": \"\",\n \"IamRole\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateManagedInstanceRole")
.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=AmazonSSM.UpdateManagedInstanceRole")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"InstanceId\": \"\",\n \"IamRole\": \"\"\n}")
.asString();
const data = JSON.stringify({
InstanceId: '',
IamRole: ''
});
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=AmazonSSM.UpdateManagedInstanceRole');
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=AmazonSSM.UpdateManagedInstanceRole',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: '', IamRole: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateManagedInstanceRole';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":"","IamRole":""}'
};
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=AmazonSSM.UpdateManagedInstanceRole',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "InstanceId": "",\n "IamRole": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"InstanceId\": \"\",\n \"IamRole\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateManagedInstanceRole")
.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({InstanceId: '', IamRole: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateManagedInstanceRole',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {InstanceId: '', IamRole: ''},
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=AmazonSSM.UpdateManagedInstanceRole');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
InstanceId: '',
IamRole: ''
});
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=AmazonSSM.UpdateManagedInstanceRole',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: '', IamRole: ''}
};
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=AmazonSSM.UpdateManagedInstanceRole';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":"","IamRole":""}'
};
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 = @{ @"InstanceId": @"",
@"IamRole": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateManagedInstanceRole"]
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=AmazonSSM.UpdateManagedInstanceRole" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"InstanceId\": \"\",\n \"IamRole\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateManagedInstanceRole",
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([
'InstanceId' => '',
'IamRole' => ''
]),
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=AmazonSSM.UpdateManagedInstanceRole', [
'body' => '{
"InstanceId": "",
"IamRole": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateManagedInstanceRole');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'InstanceId' => '',
'IamRole' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'InstanceId' => '',
'IamRole' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateManagedInstanceRole');
$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=AmazonSSM.UpdateManagedInstanceRole' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": "",
"IamRole": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateManagedInstanceRole' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": "",
"IamRole": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"InstanceId\": \"\",\n \"IamRole\": \"\"\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=AmazonSSM.UpdateManagedInstanceRole"
payload = {
"InstanceId": "",
"IamRole": ""
}
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=AmazonSSM.UpdateManagedInstanceRole"
payload <- "{\n \"InstanceId\": \"\",\n \"IamRole\": \"\"\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=AmazonSSM.UpdateManagedInstanceRole")
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 \"InstanceId\": \"\",\n \"IamRole\": \"\"\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 \"InstanceId\": \"\",\n \"IamRole\": \"\"\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=AmazonSSM.UpdateManagedInstanceRole";
let payload = json!({
"InstanceId": "",
"IamRole": ""
});
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=AmazonSSM.UpdateManagedInstanceRole' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"InstanceId": "",
"IamRole": ""
}'
echo '{
"InstanceId": "",
"IamRole": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateManagedInstanceRole' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "InstanceId": "",\n "IamRole": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateManagedInstanceRole'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"InstanceId": "",
"IamRole": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateManagedInstanceRole")! 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
UpdateOpsItem
{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateOpsItem
HEADERS
X-Amz-Target
BODY json
{
"Description": "",
"OperationalData": "",
"OperationalDataToDelete": "",
"Notifications": "",
"Priority": "",
"RelatedOpsItems": "",
"Status": "",
"OpsItemId": "",
"Title": "",
"Category": "",
"Severity": "",
"ActualStartTime": "",
"ActualEndTime": "",
"PlannedStartTime": "",
"PlannedEndTime": "",
"OpsItemArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateOpsItem");
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 \"Description\": \"\",\n \"OperationalData\": \"\",\n \"OperationalDataToDelete\": \"\",\n \"Notifications\": \"\",\n \"Priority\": \"\",\n \"RelatedOpsItems\": \"\",\n \"Status\": \"\",\n \"OpsItemId\": \"\",\n \"Title\": \"\",\n \"Category\": \"\",\n \"Severity\": \"\",\n \"ActualStartTime\": \"\",\n \"ActualEndTime\": \"\",\n \"PlannedStartTime\": \"\",\n \"PlannedEndTime\": \"\",\n \"OpsItemArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateOpsItem" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Description ""
:OperationalData ""
:OperationalDataToDelete ""
:Notifications ""
:Priority ""
:RelatedOpsItems ""
:Status ""
:OpsItemId ""
:Title ""
:Category ""
:Severity ""
:ActualStartTime ""
:ActualEndTime ""
:PlannedStartTime ""
:PlannedEndTime ""
:OpsItemArn ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateOpsItem"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Description\": \"\",\n \"OperationalData\": \"\",\n \"OperationalDataToDelete\": \"\",\n \"Notifications\": \"\",\n \"Priority\": \"\",\n \"RelatedOpsItems\": \"\",\n \"Status\": \"\",\n \"OpsItemId\": \"\",\n \"Title\": \"\",\n \"Category\": \"\",\n \"Severity\": \"\",\n \"ActualStartTime\": \"\",\n \"ActualEndTime\": \"\",\n \"PlannedStartTime\": \"\",\n \"PlannedEndTime\": \"\",\n \"OpsItemArn\": \"\"\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=AmazonSSM.UpdateOpsItem"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Description\": \"\",\n \"OperationalData\": \"\",\n \"OperationalDataToDelete\": \"\",\n \"Notifications\": \"\",\n \"Priority\": \"\",\n \"RelatedOpsItems\": \"\",\n \"Status\": \"\",\n \"OpsItemId\": \"\",\n \"Title\": \"\",\n \"Category\": \"\",\n \"Severity\": \"\",\n \"ActualStartTime\": \"\",\n \"ActualEndTime\": \"\",\n \"PlannedStartTime\": \"\",\n \"PlannedEndTime\": \"\",\n \"OpsItemArn\": \"\"\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=AmazonSSM.UpdateOpsItem");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Description\": \"\",\n \"OperationalData\": \"\",\n \"OperationalDataToDelete\": \"\",\n \"Notifications\": \"\",\n \"Priority\": \"\",\n \"RelatedOpsItems\": \"\",\n \"Status\": \"\",\n \"OpsItemId\": \"\",\n \"Title\": \"\",\n \"Category\": \"\",\n \"Severity\": \"\",\n \"ActualStartTime\": \"\",\n \"ActualEndTime\": \"\",\n \"PlannedStartTime\": \"\",\n \"PlannedEndTime\": \"\",\n \"OpsItemArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateOpsItem"
payload := strings.NewReader("{\n \"Description\": \"\",\n \"OperationalData\": \"\",\n \"OperationalDataToDelete\": \"\",\n \"Notifications\": \"\",\n \"Priority\": \"\",\n \"RelatedOpsItems\": \"\",\n \"Status\": \"\",\n \"OpsItemId\": \"\",\n \"Title\": \"\",\n \"Category\": \"\",\n \"Severity\": \"\",\n \"ActualStartTime\": \"\",\n \"ActualEndTime\": \"\",\n \"PlannedStartTime\": \"\",\n \"PlannedEndTime\": \"\",\n \"OpsItemArn\": \"\"\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: 351
{
"Description": "",
"OperationalData": "",
"OperationalDataToDelete": "",
"Notifications": "",
"Priority": "",
"RelatedOpsItems": "",
"Status": "",
"OpsItemId": "",
"Title": "",
"Category": "",
"Severity": "",
"ActualStartTime": "",
"ActualEndTime": "",
"PlannedStartTime": "",
"PlannedEndTime": "",
"OpsItemArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateOpsItem")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Description\": \"\",\n \"OperationalData\": \"\",\n \"OperationalDataToDelete\": \"\",\n \"Notifications\": \"\",\n \"Priority\": \"\",\n \"RelatedOpsItems\": \"\",\n \"Status\": \"\",\n \"OpsItemId\": \"\",\n \"Title\": \"\",\n \"Category\": \"\",\n \"Severity\": \"\",\n \"ActualStartTime\": \"\",\n \"ActualEndTime\": \"\",\n \"PlannedStartTime\": \"\",\n \"PlannedEndTime\": \"\",\n \"OpsItemArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateOpsItem"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Description\": \"\",\n \"OperationalData\": \"\",\n \"OperationalDataToDelete\": \"\",\n \"Notifications\": \"\",\n \"Priority\": \"\",\n \"RelatedOpsItems\": \"\",\n \"Status\": \"\",\n \"OpsItemId\": \"\",\n \"Title\": \"\",\n \"Category\": \"\",\n \"Severity\": \"\",\n \"ActualStartTime\": \"\",\n \"ActualEndTime\": \"\",\n \"PlannedStartTime\": \"\",\n \"PlannedEndTime\": \"\",\n \"OpsItemArn\": \"\"\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 \"Description\": \"\",\n \"OperationalData\": \"\",\n \"OperationalDataToDelete\": \"\",\n \"Notifications\": \"\",\n \"Priority\": \"\",\n \"RelatedOpsItems\": \"\",\n \"Status\": \"\",\n \"OpsItemId\": \"\",\n \"Title\": \"\",\n \"Category\": \"\",\n \"Severity\": \"\",\n \"ActualStartTime\": \"\",\n \"ActualEndTime\": \"\",\n \"PlannedStartTime\": \"\",\n \"PlannedEndTime\": \"\",\n \"OpsItemArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateOpsItem")
.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=AmazonSSM.UpdateOpsItem")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Description\": \"\",\n \"OperationalData\": \"\",\n \"OperationalDataToDelete\": \"\",\n \"Notifications\": \"\",\n \"Priority\": \"\",\n \"RelatedOpsItems\": \"\",\n \"Status\": \"\",\n \"OpsItemId\": \"\",\n \"Title\": \"\",\n \"Category\": \"\",\n \"Severity\": \"\",\n \"ActualStartTime\": \"\",\n \"ActualEndTime\": \"\",\n \"PlannedStartTime\": \"\",\n \"PlannedEndTime\": \"\",\n \"OpsItemArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
Description: '',
OperationalData: '',
OperationalDataToDelete: '',
Notifications: '',
Priority: '',
RelatedOpsItems: '',
Status: '',
OpsItemId: '',
Title: '',
Category: '',
Severity: '',
ActualStartTime: '',
ActualEndTime: '',
PlannedStartTime: '',
PlannedEndTime: '',
OpsItemArn: ''
});
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=AmazonSSM.UpdateOpsItem');
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=AmazonSSM.UpdateOpsItem',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Description: '',
OperationalData: '',
OperationalDataToDelete: '',
Notifications: '',
Priority: '',
RelatedOpsItems: '',
Status: '',
OpsItemId: '',
Title: '',
Category: '',
Severity: '',
ActualStartTime: '',
ActualEndTime: '',
PlannedStartTime: '',
PlannedEndTime: '',
OpsItemArn: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateOpsItem';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Description":"","OperationalData":"","OperationalDataToDelete":"","Notifications":"","Priority":"","RelatedOpsItems":"","Status":"","OpsItemId":"","Title":"","Category":"","Severity":"","ActualStartTime":"","ActualEndTime":"","PlannedStartTime":"","PlannedEndTime":"","OpsItemArn":""}'
};
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=AmazonSSM.UpdateOpsItem',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Description": "",\n "OperationalData": "",\n "OperationalDataToDelete": "",\n "Notifications": "",\n "Priority": "",\n "RelatedOpsItems": "",\n "Status": "",\n "OpsItemId": "",\n "Title": "",\n "Category": "",\n "Severity": "",\n "ActualStartTime": "",\n "ActualEndTime": "",\n "PlannedStartTime": "",\n "PlannedEndTime": "",\n "OpsItemArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Description\": \"\",\n \"OperationalData\": \"\",\n \"OperationalDataToDelete\": \"\",\n \"Notifications\": \"\",\n \"Priority\": \"\",\n \"RelatedOpsItems\": \"\",\n \"Status\": \"\",\n \"OpsItemId\": \"\",\n \"Title\": \"\",\n \"Category\": \"\",\n \"Severity\": \"\",\n \"ActualStartTime\": \"\",\n \"ActualEndTime\": \"\",\n \"PlannedStartTime\": \"\",\n \"PlannedEndTime\": \"\",\n \"OpsItemArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateOpsItem")
.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({
Description: '',
OperationalData: '',
OperationalDataToDelete: '',
Notifications: '',
Priority: '',
RelatedOpsItems: '',
Status: '',
OpsItemId: '',
Title: '',
Category: '',
Severity: '',
ActualStartTime: '',
ActualEndTime: '',
PlannedStartTime: '',
PlannedEndTime: '',
OpsItemArn: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateOpsItem',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
Description: '',
OperationalData: '',
OperationalDataToDelete: '',
Notifications: '',
Priority: '',
RelatedOpsItems: '',
Status: '',
OpsItemId: '',
Title: '',
Category: '',
Severity: '',
ActualStartTime: '',
ActualEndTime: '',
PlannedStartTime: '',
PlannedEndTime: '',
OpsItemArn: ''
},
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=AmazonSSM.UpdateOpsItem');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Description: '',
OperationalData: '',
OperationalDataToDelete: '',
Notifications: '',
Priority: '',
RelatedOpsItems: '',
Status: '',
OpsItemId: '',
Title: '',
Category: '',
Severity: '',
ActualStartTime: '',
ActualEndTime: '',
PlannedStartTime: '',
PlannedEndTime: '',
OpsItemArn: ''
});
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=AmazonSSM.UpdateOpsItem',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Description: '',
OperationalData: '',
OperationalDataToDelete: '',
Notifications: '',
Priority: '',
RelatedOpsItems: '',
Status: '',
OpsItemId: '',
Title: '',
Category: '',
Severity: '',
ActualStartTime: '',
ActualEndTime: '',
PlannedStartTime: '',
PlannedEndTime: '',
OpsItemArn: ''
}
};
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=AmazonSSM.UpdateOpsItem';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Description":"","OperationalData":"","OperationalDataToDelete":"","Notifications":"","Priority":"","RelatedOpsItems":"","Status":"","OpsItemId":"","Title":"","Category":"","Severity":"","ActualStartTime":"","ActualEndTime":"","PlannedStartTime":"","PlannedEndTime":"","OpsItemArn":""}'
};
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 = @{ @"Description": @"",
@"OperationalData": @"",
@"OperationalDataToDelete": @"",
@"Notifications": @"",
@"Priority": @"",
@"RelatedOpsItems": @"",
@"Status": @"",
@"OpsItemId": @"",
@"Title": @"",
@"Category": @"",
@"Severity": @"",
@"ActualStartTime": @"",
@"ActualEndTime": @"",
@"PlannedStartTime": @"",
@"PlannedEndTime": @"",
@"OpsItemArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateOpsItem"]
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=AmazonSSM.UpdateOpsItem" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Description\": \"\",\n \"OperationalData\": \"\",\n \"OperationalDataToDelete\": \"\",\n \"Notifications\": \"\",\n \"Priority\": \"\",\n \"RelatedOpsItems\": \"\",\n \"Status\": \"\",\n \"OpsItemId\": \"\",\n \"Title\": \"\",\n \"Category\": \"\",\n \"Severity\": \"\",\n \"ActualStartTime\": \"\",\n \"ActualEndTime\": \"\",\n \"PlannedStartTime\": \"\",\n \"PlannedEndTime\": \"\",\n \"OpsItemArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateOpsItem",
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([
'Description' => '',
'OperationalData' => '',
'OperationalDataToDelete' => '',
'Notifications' => '',
'Priority' => '',
'RelatedOpsItems' => '',
'Status' => '',
'OpsItemId' => '',
'Title' => '',
'Category' => '',
'Severity' => '',
'ActualStartTime' => '',
'ActualEndTime' => '',
'PlannedStartTime' => '',
'PlannedEndTime' => '',
'OpsItemArn' => ''
]),
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=AmazonSSM.UpdateOpsItem', [
'body' => '{
"Description": "",
"OperationalData": "",
"OperationalDataToDelete": "",
"Notifications": "",
"Priority": "",
"RelatedOpsItems": "",
"Status": "",
"OpsItemId": "",
"Title": "",
"Category": "",
"Severity": "",
"ActualStartTime": "",
"ActualEndTime": "",
"PlannedStartTime": "",
"PlannedEndTime": "",
"OpsItemArn": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateOpsItem');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Description' => '',
'OperationalData' => '',
'OperationalDataToDelete' => '',
'Notifications' => '',
'Priority' => '',
'RelatedOpsItems' => '',
'Status' => '',
'OpsItemId' => '',
'Title' => '',
'Category' => '',
'Severity' => '',
'ActualStartTime' => '',
'ActualEndTime' => '',
'PlannedStartTime' => '',
'PlannedEndTime' => '',
'OpsItemArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Description' => '',
'OperationalData' => '',
'OperationalDataToDelete' => '',
'Notifications' => '',
'Priority' => '',
'RelatedOpsItems' => '',
'Status' => '',
'OpsItemId' => '',
'Title' => '',
'Category' => '',
'Severity' => '',
'ActualStartTime' => '',
'ActualEndTime' => '',
'PlannedStartTime' => '',
'PlannedEndTime' => '',
'OpsItemArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateOpsItem');
$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=AmazonSSM.UpdateOpsItem' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Description": "",
"OperationalData": "",
"OperationalDataToDelete": "",
"Notifications": "",
"Priority": "",
"RelatedOpsItems": "",
"Status": "",
"OpsItemId": "",
"Title": "",
"Category": "",
"Severity": "",
"ActualStartTime": "",
"ActualEndTime": "",
"PlannedStartTime": "",
"PlannedEndTime": "",
"OpsItemArn": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateOpsItem' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Description": "",
"OperationalData": "",
"OperationalDataToDelete": "",
"Notifications": "",
"Priority": "",
"RelatedOpsItems": "",
"Status": "",
"OpsItemId": "",
"Title": "",
"Category": "",
"Severity": "",
"ActualStartTime": "",
"ActualEndTime": "",
"PlannedStartTime": "",
"PlannedEndTime": "",
"OpsItemArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Description\": \"\",\n \"OperationalData\": \"\",\n \"OperationalDataToDelete\": \"\",\n \"Notifications\": \"\",\n \"Priority\": \"\",\n \"RelatedOpsItems\": \"\",\n \"Status\": \"\",\n \"OpsItemId\": \"\",\n \"Title\": \"\",\n \"Category\": \"\",\n \"Severity\": \"\",\n \"ActualStartTime\": \"\",\n \"ActualEndTime\": \"\",\n \"PlannedStartTime\": \"\",\n \"PlannedEndTime\": \"\",\n \"OpsItemArn\": \"\"\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=AmazonSSM.UpdateOpsItem"
payload = {
"Description": "",
"OperationalData": "",
"OperationalDataToDelete": "",
"Notifications": "",
"Priority": "",
"RelatedOpsItems": "",
"Status": "",
"OpsItemId": "",
"Title": "",
"Category": "",
"Severity": "",
"ActualStartTime": "",
"ActualEndTime": "",
"PlannedStartTime": "",
"PlannedEndTime": "",
"OpsItemArn": ""
}
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=AmazonSSM.UpdateOpsItem"
payload <- "{\n \"Description\": \"\",\n \"OperationalData\": \"\",\n \"OperationalDataToDelete\": \"\",\n \"Notifications\": \"\",\n \"Priority\": \"\",\n \"RelatedOpsItems\": \"\",\n \"Status\": \"\",\n \"OpsItemId\": \"\",\n \"Title\": \"\",\n \"Category\": \"\",\n \"Severity\": \"\",\n \"ActualStartTime\": \"\",\n \"ActualEndTime\": \"\",\n \"PlannedStartTime\": \"\",\n \"PlannedEndTime\": \"\",\n \"OpsItemArn\": \"\"\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=AmazonSSM.UpdateOpsItem")
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 \"Description\": \"\",\n \"OperationalData\": \"\",\n \"OperationalDataToDelete\": \"\",\n \"Notifications\": \"\",\n \"Priority\": \"\",\n \"RelatedOpsItems\": \"\",\n \"Status\": \"\",\n \"OpsItemId\": \"\",\n \"Title\": \"\",\n \"Category\": \"\",\n \"Severity\": \"\",\n \"ActualStartTime\": \"\",\n \"ActualEndTime\": \"\",\n \"PlannedStartTime\": \"\",\n \"PlannedEndTime\": \"\",\n \"OpsItemArn\": \"\"\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 \"Description\": \"\",\n \"OperationalData\": \"\",\n \"OperationalDataToDelete\": \"\",\n \"Notifications\": \"\",\n \"Priority\": \"\",\n \"RelatedOpsItems\": \"\",\n \"Status\": \"\",\n \"OpsItemId\": \"\",\n \"Title\": \"\",\n \"Category\": \"\",\n \"Severity\": \"\",\n \"ActualStartTime\": \"\",\n \"ActualEndTime\": \"\",\n \"PlannedStartTime\": \"\",\n \"PlannedEndTime\": \"\",\n \"OpsItemArn\": \"\"\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=AmazonSSM.UpdateOpsItem";
let payload = json!({
"Description": "",
"OperationalData": "",
"OperationalDataToDelete": "",
"Notifications": "",
"Priority": "",
"RelatedOpsItems": "",
"Status": "",
"OpsItemId": "",
"Title": "",
"Category": "",
"Severity": "",
"ActualStartTime": "",
"ActualEndTime": "",
"PlannedStartTime": "",
"PlannedEndTime": "",
"OpsItemArn": ""
});
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=AmazonSSM.UpdateOpsItem' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Description": "",
"OperationalData": "",
"OperationalDataToDelete": "",
"Notifications": "",
"Priority": "",
"RelatedOpsItems": "",
"Status": "",
"OpsItemId": "",
"Title": "",
"Category": "",
"Severity": "",
"ActualStartTime": "",
"ActualEndTime": "",
"PlannedStartTime": "",
"PlannedEndTime": "",
"OpsItemArn": ""
}'
echo '{
"Description": "",
"OperationalData": "",
"OperationalDataToDelete": "",
"Notifications": "",
"Priority": "",
"RelatedOpsItems": "",
"Status": "",
"OpsItemId": "",
"Title": "",
"Category": "",
"Severity": "",
"ActualStartTime": "",
"ActualEndTime": "",
"PlannedStartTime": "",
"PlannedEndTime": "",
"OpsItemArn": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateOpsItem' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Description": "",\n "OperationalData": "",\n "OperationalDataToDelete": "",\n "Notifications": "",\n "Priority": "",\n "RelatedOpsItems": "",\n "Status": "",\n "OpsItemId": "",\n "Title": "",\n "Category": "",\n "Severity": "",\n "ActualStartTime": "",\n "ActualEndTime": "",\n "PlannedStartTime": "",\n "PlannedEndTime": "",\n "OpsItemArn": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateOpsItem'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Description": "",
"OperationalData": "",
"OperationalDataToDelete": "",
"Notifications": "",
"Priority": "",
"RelatedOpsItems": "",
"Status": "",
"OpsItemId": "",
"Title": "",
"Category": "",
"Severity": "",
"ActualStartTime": "",
"ActualEndTime": "",
"PlannedStartTime": "",
"PlannedEndTime": "",
"OpsItemArn": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateOpsItem")! 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
UpdateOpsMetadata
{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateOpsMetadata
HEADERS
X-Amz-Target
BODY json
{
"OpsMetadataArn": "",
"MetadataToUpdate": "",
"KeysToDelete": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateOpsMetadata");
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 \"OpsMetadataArn\": \"\",\n \"MetadataToUpdate\": \"\",\n \"KeysToDelete\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateOpsMetadata" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OpsMetadataArn ""
:MetadataToUpdate ""
:KeysToDelete ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateOpsMetadata"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OpsMetadataArn\": \"\",\n \"MetadataToUpdate\": \"\",\n \"KeysToDelete\": \"\"\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=AmazonSSM.UpdateOpsMetadata"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OpsMetadataArn\": \"\",\n \"MetadataToUpdate\": \"\",\n \"KeysToDelete\": \"\"\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=AmazonSSM.UpdateOpsMetadata");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OpsMetadataArn\": \"\",\n \"MetadataToUpdate\": \"\",\n \"KeysToDelete\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateOpsMetadata"
payload := strings.NewReader("{\n \"OpsMetadataArn\": \"\",\n \"MetadataToUpdate\": \"\",\n \"KeysToDelete\": \"\"\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: 74
{
"OpsMetadataArn": "",
"MetadataToUpdate": "",
"KeysToDelete": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateOpsMetadata")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OpsMetadataArn\": \"\",\n \"MetadataToUpdate\": \"\",\n \"KeysToDelete\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateOpsMetadata"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OpsMetadataArn\": \"\",\n \"MetadataToUpdate\": \"\",\n \"KeysToDelete\": \"\"\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 \"OpsMetadataArn\": \"\",\n \"MetadataToUpdate\": \"\",\n \"KeysToDelete\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateOpsMetadata")
.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=AmazonSSM.UpdateOpsMetadata")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OpsMetadataArn\": \"\",\n \"MetadataToUpdate\": \"\",\n \"KeysToDelete\": \"\"\n}")
.asString();
const data = JSON.stringify({
OpsMetadataArn: '',
MetadataToUpdate: '',
KeysToDelete: ''
});
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=AmazonSSM.UpdateOpsMetadata');
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=AmazonSSM.UpdateOpsMetadata',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OpsMetadataArn: '', MetadataToUpdate: '', KeysToDelete: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateOpsMetadata';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OpsMetadataArn":"","MetadataToUpdate":"","KeysToDelete":""}'
};
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=AmazonSSM.UpdateOpsMetadata',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OpsMetadataArn": "",\n "MetadataToUpdate": "",\n "KeysToDelete": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OpsMetadataArn\": \"\",\n \"MetadataToUpdate\": \"\",\n \"KeysToDelete\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateOpsMetadata")
.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({OpsMetadataArn: '', MetadataToUpdate: '', KeysToDelete: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateOpsMetadata',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OpsMetadataArn: '', MetadataToUpdate: '', KeysToDelete: ''},
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=AmazonSSM.UpdateOpsMetadata');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OpsMetadataArn: '',
MetadataToUpdate: '',
KeysToDelete: ''
});
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=AmazonSSM.UpdateOpsMetadata',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OpsMetadataArn: '', MetadataToUpdate: '', KeysToDelete: ''}
};
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=AmazonSSM.UpdateOpsMetadata';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OpsMetadataArn":"","MetadataToUpdate":"","KeysToDelete":""}'
};
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 = @{ @"OpsMetadataArn": @"",
@"MetadataToUpdate": @"",
@"KeysToDelete": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateOpsMetadata"]
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=AmazonSSM.UpdateOpsMetadata" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OpsMetadataArn\": \"\",\n \"MetadataToUpdate\": \"\",\n \"KeysToDelete\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateOpsMetadata",
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([
'OpsMetadataArn' => '',
'MetadataToUpdate' => '',
'KeysToDelete' => ''
]),
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=AmazonSSM.UpdateOpsMetadata', [
'body' => '{
"OpsMetadataArn": "",
"MetadataToUpdate": "",
"KeysToDelete": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateOpsMetadata');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OpsMetadataArn' => '',
'MetadataToUpdate' => '',
'KeysToDelete' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OpsMetadataArn' => '',
'MetadataToUpdate' => '',
'KeysToDelete' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateOpsMetadata');
$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=AmazonSSM.UpdateOpsMetadata' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OpsMetadataArn": "",
"MetadataToUpdate": "",
"KeysToDelete": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateOpsMetadata' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OpsMetadataArn": "",
"MetadataToUpdate": "",
"KeysToDelete": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OpsMetadataArn\": \"\",\n \"MetadataToUpdate\": \"\",\n \"KeysToDelete\": \"\"\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=AmazonSSM.UpdateOpsMetadata"
payload = {
"OpsMetadataArn": "",
"MetadataToUpdate": "",
"KeysToDelete": ""
}
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=AmazonSSM.UpdateOpsMetadata"
payload <- "{\n \"OpsMetadataArn\": \"\",\n \"MetadataToUpdate\": \"\",\n \"KeysToDelete\": \"\"\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=AmazonSSM.UpdateOpsMetadata")
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 \"OpsMetadataArn\": \"\",\n \"MetadataToUpdate\": \"\",\n \"KeysToDelete\": \"\"\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 \"OpsMetadataArn\": \"\",\n \"MetadataToUpdate\": \"\",\n \"KeysToDelete\": \"\"\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=AmazonSSM.UpdateOpsMetadata";
let payload = json!({
"OpsMetadataArn": "",
"MetadataToUpdate": "",
"KeysToDelete": ""
});
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=AmazonSSM.UpdateOpsMetadata' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OpsMetadataArn": "",
"MetadataToUpdate": "",
"KeysToDelete": ""
}'
echo '{
"OpsMetadataArn": "",
"MetadataToUpdate": "",
"KeysToDelete": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateOpsMetadata' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OpsMetadataArn": "",\n "MetadataToUpdate": "",\n "KeysToDelete": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateOpsMetadata'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OpsMetadataArn": "",
"MetadataToUpdate": "",
"KeysToDelete": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateOpsMetadata")! 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
UpdatePatchBaseline
{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdatePatchBaseline
HEADERS
X-Amz-Target
BODY json
{
"BaselineId": "",
"Name": "",
"GlobalFilters": "",
"ApprovalRules": "",
"ApprovedPatches": "",
"ApprovedPatchesComplianceLevel": "",
"ApprovedPatchesEnableNonSecurity": "",
"RejectedPatches": "",
"RejectedPatchesAction": "",
"Description": "",
"Sources": "",
"Replace": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdatePatchBaseline");
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 \"BaselineId\": \"\",\n \"Name\": \"\",\n \"GlobalFilters\": \"\",\n \"ApprovalRules\": \"\",\n \"ApprovedPatches\": \"\",\n \"ApprovedPatchesComplianceLevel\": \"\",\n \"ApprovedPatchesEnableNonSecurity\": \"\",\n \"RejectedPatches\": \"\",\n \"RejectedPatchesAction\": \"\",\n \"Description\": \"\",\n \"Sources\": \"\",\n \"Replace\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdatePatchBaseline" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:BaselineId ""
:Name ""
:GlobalFilters ""
:ApprovalRules ""
:ApprovedPatches ""
:ApprovedPatchesComplianceLevel ""
:ApprovedPatchesEnableNonSecurity ""
:RejectedPatches ""
:RejectedPatchesAction ""
:Description ""
:Sources ""
:Replace ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdatePatchBaseline"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"BaselineId\": \"\",\n \"Name\": \"\",\n \"GlobalFilters\": \"\",\n \"ApprovalRules\": \"\",\n \"ApprovedPatches\": \"\",\n \"ApprovedPatchesComplianceLevel\": \"\",\n \"ApprovedPatchesEnableNonSecurity\": \"\",\n \"RejectedPatches\": \"\",\n \"RejectedPatchesAction\": \"\",\n \"Description\": \"\",\n \"Sources\": \"\",\n \"Replace\": \"\"\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=AmazonSSM.UpdatePatchBaseline"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"BaselineId\": \"\",\n \"Name\": \"\",\n \"GlobalFilters\": \"\",\n \"ApprovalRules\": \"\",\n \"ApprovedPatches\": \"\",\n \"ApprovedPatchesComplianceLevel\": \"\",\n \"ApprovedPatchesEnableNonSecurity\": \"\",\n \"RejectedPatches\": \"\",\n \"RejectedPatchesAction\": \"\",\n \"Description\": \"\",\n \"Sources\": \"\",\n \"Replace\": \"\"\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=AmazonSSM.UpdatePatchBaseline");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"BaselineId\": \"\",\n \"Name\": \"\",\n \"GlobalFilters\": \"\",\n \"ApprovalRules\": \"\",\n \"ApprovedPatches\": \"\",\n \"ApprovedPatchesComplianceLevel\": \"\",\n \"ApprovedPatchesEnableNonSecurity\": \"\",\n \"RejectedPatches\": \"\",\n \"RejectedPatchesAction\": \"\",\n \"Description\": \"\",\n \"Sources\": \"\",\n \"Replace\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdatePatchBaseline"
payload := strings.NewReader("{\n \"BaselineId\": \"\",\n \"Name\": \"\",\n \"GlobalFilters\": \"\",\n \"ApprovalRules\": \"\",\n \"ApprovedPatches\": \"\",\n \"ApprovedPatchesComplianceLevel\": \"\",\n \"ApprovedPatchesEnableNonSecurity\": \"\",\n \"RejectedPatches\": \"\",\n \"RejectedPatchesAction\": \"\",\n \"Description\": \"\",\n \"Sources\": \"\",\n \"Replace\": \"\"\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: 300
{
"BaselineId": "",
"Name": "",
"GlobalFilters": "",
"ApprovalRules": "",
"ApprovedPatches": "",
"ApprovedPatchesComplianceLevel": "",
"ApprovedPatchesEnableNonSecurity": "",
"RejectedPatches": "",
"RejectedPatchesAction": "",
"Description": "",
"Sources": "",
"Replace": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdatePatchBaseline")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"BaselineId\": \"\",\n \"Name\": \"\",\n \"GlobalFilters\": \"\",\n \"ApprovalRules\": \"\",\n \"ApprovedPatches\": \"\",\n \"ApprovedPatchesComplianceLevel\": \"\",\n \"ApprovedPatchesEnableNonSecurity\": \"\",\n \"RejectedPatches\": \"\",\n \"RejectedPatchesAction\": \"\",\n \"Description\": \"\",\n \"Sources\": \"\",\n \"Replace\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdatePatchBaseline"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"BaselineId\": \"\",\n \"Name\": \"\",\n \"GlobalFilters\": \"\",\n \"ApprovalRules\": \"\",\n \"ApprovedPatches\": \"\",\n \"ApprovedPatchesComplianceLevel\": \"\",\n \"ApprovedPatchesEnableNonSecurity\": \"\",\n \"RejectedPatches\": \"\",\n \"RejectedPatchesAction\": \"\",\n \"Description\": \"\",\n \"Sources\": \"\",\n \"Replace\": \"\"\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 \"BaselineId\": \"\",\n \"Name\": \"\",\n \"GlobalFilters\": \"\",\n \"ApprovalRules\": \"\",\n \"ApprovedPatches\": \"\",\n \"ApprovedPatchesComplianceLevel\": \"\",\n \"ApprovedPatchesEnableNonSecurity\": \"\",\n \"RejectedPatches\": \"\",\n \"RejectedPatchesAction\": \"\",\n \"Description\": \"\",\n \"Sources\": \"\",\n \"Replace\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdatePatchBaseline")
.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=AmazonSSM.UpdatePatchBaseline")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"BaselineId\": \"\",\n \"Name\": \"\",\n \"GlobalFilters\": \"\",\n \"ApprovalRules\": \"\",\n \"ApprovedPatches\": \"\",\n \"ApprovedPatchesComplianceLevel\": \"\",\n \"ApprovedPatchesEnableNonSecurity\": \"\",\n \"RejectedPatches\": \"\",\n \"RejectedPatchesAction\": \"\",\n \"Description\": \"\",\n \"Sources\": \"\",\n \"Replace\": \"\"\n}")
.asString();
const data = JSON.stringify({
BaselineId: '',
Name: '',
GlobalFilters: '',
ApprovalRules: '',
ApprovedPatches: '',
ApprovedPatchesComplianceLevel: '',
ApprovedPatchesEnableNonSecurity: '',
RejectedPatches: '',
RejectedPatchesAction: '',
Description: '',
Sources: '',
Replace: ''
});
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=AmazonSSM.UpdatePatchBaseline');
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=AmazonSSM.UpdatePatchBaseline',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
BaselineId: '',
Name: '',
GlobalFilters: '',
ApprovalRules: '',
ApprovedPatches: '',
ApprovedPatchesComplianceLevel: '',
ApprovedPatchesEnableNonSecurity: '',
RejectedPatches: '',
RejectedPatchesAction: '',
Description: '',
Sources: '',
Replace: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdatePatchBaseline';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"BaselineId":"","Name":"","GlobalFilters":"","ApprovalRules":"","ApprovedPatches":"","ApprovedPatchesComplianceLevel":"","ApprovedPatchesEnableNonSecurity":"","RejectedPatches":"","RejectedPatchesAction":"","Description":"","Sources":"","Replace":""}'
};
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=AmazonSSM.UpdatePatchBaseline',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "BaselineId": "",\n "Name": "",\n "GlobalFilters": "",\n "ApprovalRules": "",\n "ApprovedPatches": "",\n "ApprovedPatchesComplianceLevel": "",\n "ApprovedPatchesEnableNonSecurity": "",\n "RejectedPatches": "",\n "RejectedPatchesAction": "",\n "Description": "",\n "Sources": "",\n "Replace": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"BaselineId\": \"\",\n \"Name\": \"\",\n \"GlobalFilters\": \"\",\n \"ApprovalRules\": \"\",\n \"ApprovedPatches\": \"\",\n \"ApprovedPatchesComplianceLevel\": \"\",\n \"ApprovedPatchesEnableNonSecurity\": \"\",\n \"RejectedPatches\": \"\",\n \"RejectedPatchesAction\": \"\",\n \"Description\": \"\",\n \"Sources\": \"\",\n \"Replace\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdatePatchBaseline")
.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({
BaselineId: '',
Name: '',
GlobalFilters: '',
ApprovalRules: '',
ApprovedPatches: '',
ApprovedPatchesComplianceLevel: '',
ApprovedPatchesEnableNonSecurity: '',
RejectedPatches: '',
RejectedPatchesAction: '',
Description: '',
Sources: '',
Replace: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdatePatchBaseline',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
BaselineId: '',
Name: '',
GlobalFilters: '',
ApprovalRules: '',
ApprovedPatches: '',
ApprovedPatchesComplianceLevel: '',
ApprovedPatchesEnableNonSecurity: '',
RejectedPatches: '',
RejectedPatchesAction: '',
Description: '',
Sources: '',
Replace: ''
},
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=AmazonSSM.UpdatePatchBaseline');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
BaselineId: '',
Name: '',
GlobalFilters: '',
ApprovalRules: '',
ApprovedPatches: '',
ApprovedPatchesComplianceLevel: '',
ApprovedPatchesEnableNonSecurity: '',
RejectedPatches: '',
RejectedPatchesAction: '',
Description: '',
Sources: '',
Replace: ''
});
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=AmazonSSM.UpdatePatchBaseline',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
BaselineId: '',
Name: '',
GlobalFilters: '',
ApprovalRules: '',
ApprovedPatches: '',
ApprovedPatchesComplianceLevel: '',
ApprovedPatchesEnableNonSecurity: '',
RejectedPatches: '',
RejectedPatchesAction: '',
Description: '',
Sources: '',
Replace: ''
}
};
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=AmazonSSM.UpdatePatchBaseline';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"BaselineId":"","Name":"","GlobalFilters":"","ApprovalRules":"","ApprovedPatches":"","ApprovedPatchesComplianceLevel":"","ApprovedPatchesEnableNonSecurity":"","RejectedPatches":"","RejectedPatchesAction":"","Description":"","Sources":"","Replace":""}'
};
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 = @{ @"BaselineId": @"",
@"Name": @"",
@"GlobalFilters": @"",
@"ApprovalRules": @"",
@"ApprovedPatches": @"",
@"ApprovedPatchesComplianceLevel": @"",
@"ApprovedPatchesEnableNonSecurity": @"",
@"RejectedPatches": @"",
@"RejectedPatchesAction": @"",
@"Description": @"",
@"Sources": @"",
@"Replace": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdatePatchBaseline"]
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=AmazonSSM.UpdatePatchBaseline" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"BaselineId\": \"\",\n \"Name\": \"\",\n \"GlobalFilters\": \"\",\n \"ApprovalRules\": \"\",\n \"ApprovedPatches\": \"\",\n \"ApprovedPatchesComplianceLevel\": \"\",\n \"ApprovedPatchesEnableNonSecurity\": \"\",\n \"RejectedPatches\": \"\",\n \"RejectedPatchesAction\": \"\",\n \"Description\": \"\",\n \"Sources\": \"\",\n \"Replace\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdatePatchBaseline",
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([
'BaselineId' => '',
'Name' => '',
'GlobalFilters' => '',
'ApprovalRules' => '',
'ApprovedPatches' => '',
'ApprovedPatchesComplianceLevel' => '',
'ApprovedPatchesEnableNonSecurity' => '',
'RejectedPatches' => '',
'RejectedPatchesAction' => '',
'Description' => '',
'Sources' => '',
'Replace' => ''
]),
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=AmazonSSM.UpdatePatchBaseline', [
'body' => '{
"BaselineId": "",
"Name": "",
"GlobalFilters": "",
"ApprovalRules": "",
"ApprovedPatches": "",
"ApprovedPatchesComplianceLevel": "",
"ApprovedPatchesEnableNonSecurity": "",
"RejectedPatches": "",
"RejectedPatchesAction": "",
"Description": "",
"Sources": "",
"Replace": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdatePatchBaseline');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'BaselineId' => '',
'Name' => '',
'GlobalFilters' => '',
'ApprovalRules' => '',
'ApprovedPatches' => '',
'ApprovedPatchesComplianceLevel' => '',
'ApprovedPatchesEnableNonSecurity' => '',
'RejectedPatches' => '',
'RejectedPatchesAction' => '',
'Description' => '',
'Sources' => '',
'Replace' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'BaselineId' => '',
'Name' => '',
'GlobalFilters' => '',
'ApprovalRules' => '',
'ApprovedPatches' => '',
'ApprovedPatchesComplianceLevel' => '',
'ApprovedPatchesEnableNonSecurity' => '',
'RejectedPatches' => '',
'RejectedPatchesAction' => '',
'Description' => '',
'Sources' => '',
'Replace' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdatePatchBaseline');
$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=AmazonSSM.UpdatePatchBaseline' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"BaselineId": "",
"Name": "",
"GlobalFilters": "",
"ApprovalRules": "",
"ApprovedPatches": "",
"ApprovedPatchesComplianceLevel": "",
"ApprovedPatchesEnableNonSecurity": "",
"RejectedPatches": "",
"RejectedPatchesAction": "",
"Description": "",
"Sources": "",
"Replace": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdatePatchBaseline' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"BaselineId": "",
"Name": "",
"GlobalFilters": "",
"ApprovalRules": "",
"ApprovedPatches": "",
"ApprovedPatchesComplianceLevel": "",
"ApprovedPatchesEnableNonSecurity": "",
"RejectedPatches": "",
"RejectedPatchesAction": "",
"Description": "",
"Sources": "",
"Replace": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"BaselineId\": \"\",\n \"Name\": \"\",\n \"GlobalFilters\": \"\",\n \"ApprovalRules\": \"\",\n \"ApprovedPatches\": \"\",\n \"ApprovedPatchesComplianceLevel\": \"\",\n \"ApprovedPatchesEnableNonSecurity\": \"\",\n \"RejectedPatches\": \"\",\n \"RejectedPatchesAction\": \"\",\n \"Description\": \"\",\n \"Sources\": \"\",\n \"Replace\": \"\"\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=AmazonSSM.UpdatePatchBaseline"
payload = {
"BaselineId": "",
"Name": "",
"GlobalFilters": "",
"ApprovalRules": "",
"ApprovedPatches": "",
"ApprovedPatchesComplianceLevel": "",
"ApprovedPatchesEnableNonSecurity": "",
"RejectedPatches": "",
"RejectedPatchesAction": "",
"Description": "",
"Sources": "",
"Replace": ""
}
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=AmazonSSM.UpdatePatchBaseline"
payload <- "{\n \"BaselineId\": \"\",\n \"Name\": \"\",\n \"GlobalFilters\": \"\",\n \"ApprovalRules\": \"\",\n \"ApprovedPatches\": \"\",\n \"ApprovedPatchesComplianceLevel\": \"\",\n \"ApprovedPatchesEnableNonSecurity\": \"\",\n \"RejectedPatches\": \"\",\n \"RejectedPatchesAction\": \"\",\n \"Description\": \"\",\n \"Sources\": \"\",\n \"Replace\": \"\"\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=AmazonSSM.UpdatePatchBaseline")
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 \"BaselineId\": \"\",\n \"Name\": \"\",\n \"GlobalFilters\": \"\",\n \"ApprovalRules\": \"\",\n \"ApprovedPatches\": \"\",\n \"ApprovedPatchesComplianceLevel\": \"\",\n \"ApprovedPatchesEnableNonSecurity\": \"\",\n \"RejectedPatches\": \"\",\n \"RejectedPatchesAction\": \"\",\n \"Description\": \"\",\n \"Sources\": \"\",\n \"Replace\": \"\"\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 \"BaselineId\": \"\",\n \"Name\": \"\",\n \"GlobalFilters\": \"\",\n \"ApprovalRules\": \"\",\n \"ApprovedPatches\": \"\",\n \"ApprovedPatchesComplianceLevel\": \"\",\n \"ApprovedPatchesEnableNonSecurity\": \"\",\n \"RejectedPatches\": \"\",\n \"RejectedPatchesAction\": \"\",\n \"Description\": \"\",\n \"Sources\": \"\",\n \"Replace\": \"\"\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=AmazonSSM.UpdatePatchBaseline";
let payload = json!({
"BaselineId": "",
"Name": "",
"GlobalFilters": "",
"ApprovalRules": "",
"ApprovedPatches": "",
"ApprovedPatchesComplianceLevel": "",
"ApprovedPatchesEnableNonSecurity": "",
"RejectedPatches": "",
"RejectedPatchesAction": "",
"Description": "",
"Sources": "",
"Replace": ""
});
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=AmazonSSM.UpdatePatchBaseline' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"BaselineId": "",
"Name": "",
"GlobalFilters": "",
"ApprovalRules": "",
"ApprovedPatches": "",
"ApprovedPatchesComplianceLevel": "",
"ApprovedPatchesEnableNonSecurity": "",
"RejectedPatches": "",
"RejectedPatchesAction": "",
"Description": "",
"Sources": "",
"Replace": ""
}'
echo '{
"BaselineId": "",
"Name": "",
"GlobalFilters": "",
"ApprovalRules": "",
"ApprovedPatches": "",
"ApprovedPatchesComplianceLevel": "",
"ApprovedPatchesEnableNonSecurity": "",
"RejectedPatches": "",
"RejectedPatchesAction": "",
"Description": "",
"Sources": "",
"Replace": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdatePatchBaseline' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "BaselineId": "",\n "Name": "",\n "GlobalFilters": "",\n "ApprovalRules": "",\n "ApprovedPatches": "",\n "ApprovedPatchesComplianceLevel": "",\n "ApprovedPatchesEnableNonSecurity": "",\n "RejectedPatches": "",\n "RejectedPatchesAction": "",\n "Description": "",\n "Sources": "",\n "Replace": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdatePatchBaseline'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"BaselineId": "",
"Name": "",
"GlobalFilters": "",
"ApprovalRules": "",
"ApprovedPatches": "",
"ApprovedPatchesComplianceLevel": "",
"ApprovedPatchesEnableNonSecurity": "",
"RejectedPatches": "",
"RejectedPatchesAction": "",
"Description": "",
"Sources": "",
"Replace": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdatePatchBaseline")! 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
UpdateResourceDataSync
{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateResourceDataSync
HEADERS
X-Amz-Target
BODY json
{
"SyncName": "",
"SyncType": "",
"SyncSource": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateResourceDataSync");
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 \"SyncName\": \"\",\n \"SyncType\": \"\",\n \"SyncSource\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateResourceDataSync" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:SyncName ""
:SyncType ""
:SyncSource ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateResourceDataSync"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"SyncName\": \"\",\n \"SyncType\": \"\",\n \"SyncSource\": \"\"\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=AmazonSSM.UpdateResourceDataSync"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"SyncName\": \"\",\n \"SyncType\": \"\",\n \"SyncSource\": \"\"\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=AmazonSSM.UpdateResourceDataSync");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"SyncName\": \"\",\n \"SyncType\": \"\",\n \"SyncSource\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateResourceDataSync"
payload := strings.NewReader("{\n \"SyncName\": \"\",\n \"SyncType\": \"\",\n \"SyncSource\": \"\"\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
{
"SyncName": "",
"SyncType": "",
"SyncSource": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateResourceDataSync")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"SyncName\": \"\",\n \"SyncType\": \"\",\n \"SyncSource\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateResourceDataSync"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"SyncName\": \"\",\n \"SyncType\": \"\",\n \"SyncSource\": \"\"\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 \"SyncName\": \"\",\n \"SyncType\": \"\",\n \"SyncSource\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateResourceDataSync")
.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=AmazonSSM.UpdateResourceDataSync")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"SyncName\": \"\",\n \"SyncType\": \"\",\n \"SyncSource\": \"\"\n}")
.asString();
const data = JSON.stringify({
SyncName: '',
SyncType: '',
SyncSource: ''
});
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=AmazonSSM.UpdateResourceDataSync');
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=AmazonSSM.UpdateResourceDataSync',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {SyncName: '', SyncType: '', SyncSource: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateResourceDataSync';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"SyncName":"","SyncType":"","SyncSource":""}'
};
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=AmazonSSM.UpdateResourceDataSync',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "SyncName": "",\n "SyncType": "",\n "SyncSource": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"SyncName\": \"\",\n \"SyncType\": \"\",\n \"SyncSource\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateResourceDataSync")
.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({SyncName: '', SyncType: '', SyncSource: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateResourceDataSync',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {SyncName: '', SyncType: '', SyncSource: ''},
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=AmazonSSM.UpdateResourceDataSync');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
SyncName: '',
SyncType: '',
SyncSource: ''
});
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=AmazonSSM.UpdateResourceDataSync',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {SyncName: '', SyncType: '', SyncSource: ''}
};
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=AmazonSSM.UpdateResourceDataSync';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"SyncName":"","SyncType":"","SyncSource":""}'
};
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 = @{ @"SyncName": @"",
@"SyncType": @"",
@"SyncSource": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateResourceDataSync"]
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=AmazonSSM.UpdateResourceDataSync" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"SyncName\": \"\",\n \"SyncType\": \"\",\n \"SyncSource\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateResourceDataSync",
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([
'SyncName' => '',
'SyncType' => '',
'SyncSource' => ''
]),
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=AmazonSSM.UpdateResourceDataSync', [
'body' => '{
"SyncName": "",
"SyncType": "",
"SyncSource": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateResourceDataSync');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'SyncName' => '',
'SyncType' => '',
'SyncSource' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'SyncName' => '',
'SyncType' => '',
'SyncSource' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateResourceDataSync');
$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=AmazonSSM.UpdateResourceDataSync' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SyncName": "",
"SyncType": "",
"SyncSource": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateResourceDataSync' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SyncName": "",
"SyncType": "",
"SyncSource": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"SyncName\": \"\",\n \"SyncType\": \"\",\n \"SyncSource\": \"\"\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=AmazonSSM.UpdateResourceDataSync"
payload = {
"SyncName": "",
"SyncType": "",
"SyncSource": ""
}
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=AmazonSSM.UpdateResourceDataSync"
payload <- "{\n \"SyncName\": \"\",\n \"SyncType\": \"\",\n \"SyncSource\": \"\"\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=AmazonSSM.UpdateResourceDataSync")
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 \"SyncName\": \"\",\n \"SyncType\": \"\",\n \"SyncSource\": \"\"\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 \"SyncName\": \"\",\n \"SyncType\": \"\",\n \"SyncSource\": \"\"\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=AmazonSSM.UpdateResourceDataSync";
let payload = json!({
"SyncName": "",
"SyncType": "",
"SyncSource": ""
});
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=AmazonSSM.UpdateResourceDataSync' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"SyncName": "",
"SyncType": "",
"SyncSource": ""
}'
echo '{
"SyncName": "",
"SyncType": "",
"SyncSource": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateResourceDataSync' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "SyncName": "",\n "SyncType": "",\n "SyncSource": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateResourceDataSync'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"SyncName": "",
"SyncType": "",
"SyncSource": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateResourceDataSync")! 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
UpdateServiceSetting
{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateServiceSetting
HEADERS
X-Amz-Target
BODY json
{
"SettingId": "",
"SettingValue": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateServiceSetting");
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 \"SettingId\": \"\",\n \"SettingValue\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateServiceSetting" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:SettingId ""
:SettingValue ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateServiceSetting"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"SettingId\": \"\",\n \"SettingValue\": \"\"\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=AmazonSSM.UpdateServiceSetting"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"SettingId\": \"\",\n \"SettingValue\": \"\"\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=AmazonSSM.UpdateServiceSetting");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"SettingId\": \"\",\n \"SettingValue\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateServiceSetting"
payload := strings.NewReader("{\n \"SettingId\": \"\",\n \"SettingValue\": \"\"\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
{
"SettingId": "",
"SettingValue": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateServiceSetting")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"SettingId\": \"\",\n \"SettingValue\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateServiceSetting"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"SettingId\": \"\",\n \"SettingValue\": \"\"\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 \"SettingId\": \"\",\n \"SettingValue\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateServiceSetting")
.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=AmazonSSM.UpdateServiceSetting")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"SettingId\": \"\",\n \"SettingValue\": \"\"\n}")
.asString();
const data = JSON.stringify({
SettingId: '',
SettingValue: ''
});
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=AmazonSSM.UpdateServiceSetting');
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=AmazonSSM.UpdateServiceSetting',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {SettingId: '', SettingValue: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateServiceSetting';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"SettingId":"","SettingValue":""}'
};
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=AmazonSSM.UpdateServiceSetting',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "SettingId": "",\n "SettingValue": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"SettingId\": \"\",\n \"SettingValue\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateServiceSetting")
.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({SettingId: '', SettingValue: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateServiceSetting',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {SettingId: '', SettingValue: ''},
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=AmazonSSM.UpdateServiceSetting');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
SettingId: '',
SettingValue: ''
});
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=AmazonSSM.UpdateServiceSetting',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {SettingId: '', SettingValue: ''}
};
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=AmazonSSM.UpdateServiceSetting';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"SettingId":"","SettingValue":""}'
};
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 = @{ @"SettingId": @"",
@"SettingValue": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateServiceSetting"]
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=AmazonSSM.UpdateServiceSetting" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"SettingId\": \"\",\n \"SettingValue\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateServiceSetting",
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([
'SettingId' => '',
'SettingValue' => ''
]),
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=AmazonSSM.UpdateServiceSetting', [
'body' => '{
"SettingId": "",
"SettingValue": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateServiceSetting');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'SettingId' => '',
'SettingValue' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'SettingId' => '',
'SettingValue' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateServiceSetting');
$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=AmazonSSM.UpdateServiceSetting' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SettingId": "",
"SettingValue": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateServiceSetting' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SettingId": "",
"SettingValue": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"SettingId\": \"\",\n \"SettingValue\": \"\"\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=AmazonSSM.UpdateServiceSetting"
payload = {
"SettingId": "",
"SettingValue": ""
}
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=AmazonSSM.UpdateServiceSetting"
payload <- "{\n \"SettingId\": \"\",\n \"SettingValue\": \"\"\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=AmazonSSM.UpdateServiceSetting")
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 \"SettingId\": \"\",\n \"SettingValue\": \"\"\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 \"SettingId\": \"\",\n \"SettingValue\": \"\"\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=AmazonSSM.UpdateServiceSetting";
let payload = json!({
"SettingId": "",
"SettingValue": ""
});
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=AmazonSSM.UpdateServiceSetting' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"SettingId": "",
"SettingValue": ""
}'
echo '{
"SettingId": "",
"SettingValue": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateServiceSetting' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "SettingId": "",\n "SettingValue": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateServiceSetting'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"SettingId": "",
"SettingValue": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonSSM.UpdateServiceSetting")! 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()