AWS Systems Manager Incident Manager
AWS Systems Manager Incident Managerv2018-05-10
Systems Manager Incident Manager is an incident management console designed to help users mitigate and recover from incidents affecting their Amazon Web Services-hosted applications. An incident is any unplanned interruption or reduction in quality of services. Incident Manager increases incident resolution by notifying responders of impact, highlighting relevant troubleshooting data, and providing collaboration tools to get services back up and running. To achieve the primary goal of reducing the time-to-resolution of critical incidents, Incident Manager automates response plans and enables…
- Endpoints
- 29 (23 POST, 5 GET, 1 DELETE)
- Base URL
http://ssm-incidents.{region}.amazonaws.com- Authentication
- API key
- Spec format
- OpenAPI 3.0.0
- API version
- 2018-05-10
- Provider
- amazonaws.com
- License
- Apache 2.0 License
- Categories
- Cloud & Infrastructure
- Last updated
Use this API in Bruno:
- Download the Bruno collection above and unzip it.
- In Bruno, choose Open Collection and select the unzipped folder.
- Set the
baseUrlvariable (for examplehttp://ssm-incidents.{region}.amazonaws.com) and your API key credentials, then send requests.
POST
CreateReplicationSet
{{baseUrl}}/createReplicationSet
BODY json
{
"clientToken": "",
"regions": {},
"tags": {}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/createReplicationSet");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"clientToken\": \"\",\n \"regions\": {},\n \"tags\": {}\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/createReplicationSet" {:content-type :json
:form-params {:clientToken ""
:regions {}
:tags {}}})
require "http/client"
url = "{{baseUrl}}/createReplicationSet"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"clientToken\": \"\",\n \"regions\": {},\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}}/createReplicationSet"),
Content = new StringContent("{\n \"clientToken\": \"\",\n \"regions\": {},\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}}/createReplicationSet");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"clientToken\": \"\",\n \"regions\": {},\n \"tags\": {}\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/createReplicationSet"
payload := strings.NewReader("{\n \"clientToken\": \"\",\n \"regions\": {},\n \"tags\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
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/createReplicationSet HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 54
{
"clientToken": "",
"regions": {},
"tags": {}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/createReplicationSet")
.setHeader("content-type", "application/json")
.setBody("{\n \"clientToken\": \"\",\n \"regions\": {},\n \"tags\": {}\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/createReplicationSet"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"clientToken\": \"\",\n \"regions\": {},\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 \"clientToken\": \"\",\n \"regions\": {},\n \"tags\": {}\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/createReplicationSet")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/createReplicationSet")
.header("content-type", "application/json")
.body("{\n \"clientToken\": \"\",\n \"regions\": {},\n \"tags\": {}\n}")
.asString();
const data = JSON.stringify({
clientToken: '',
regions: {},
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}}/createReplicationSet');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/createReplicationSet',
headers: {'content-type': 'application/json'},
data: {clientToken: '', regions: {}, tags: {}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/createReplicationSet';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"clientToken":"","regions":{},"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}}/createReplicationSet',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "clientToken": "",\n "regions": {},\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 \"clientToken\": \"\",\n \"regions\": {},\n \"tags\": {}\n}")
val request = Request.Builder()
.url("{{baseUrl}}/createReplicationSet")
.post(body)
.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/createReplicationSet',
headers: {
'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({clientToken: '', regions: {}, tags: {}}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/createReplicationSet',
headers: {'content-type': 'application/json'},
body: {clientToken: '', regions: {}, 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}}/createReplicationSet');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
clientToken: '',
regions: {},
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}}/createReplicationSet',
headers: {'content-type': 'application/json'},
data: {clientToken: '', regions: {}, tags: {}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/createReplicationSet';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"clientToken":"","regions":{},"tags":{}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"clientToken": @"",
@"regions": @{ },
@"tags": @{ } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/createReplicationSet"]
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}}/createReplicationSet" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"clientToken\": \"\",\n \"regions\": {},\n \"tags\": {}\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/createReplicationSet",
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([
'clientToken' => '',
'regions' => [
],
'tags' => [
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/createReplicationSet', [
'body' => '{
"clientToken": "",
"regions": {},
"tags": {}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/createReplicationSet');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'clientToken' => '',
'regions' => [
],
'tags' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'clientToken' => '',
'regions' => [
],
'tags' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/createReplicationSet');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/createReplicationSet' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"clientToken": "",
"regions": {},
"tags": {}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/createReplicationSet' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"clientToken": "",
"regions": {},
"tags": {}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"clientToken\": \"\",\n \"regions\": {},\n \"tags\": {}\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/createReplicationSet", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/createReplicationSet"
payload = {
"clientToken": "",
"regions": {},
"tags": {}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/createReplicationSet"
payload <- "{\n \"clientToken\": \"\",\n \"regions\": {},\n \"tags\": {}\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/createReplicationSet")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"clientToken\": \"\",\n \"regions\": {},\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/createReplicationSet') do |req|
req.body = "{\n \"clientToken\": \"\",\n \"regions\": {},\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}}/createReplicationSet";
let payload = json!({
"clientToken": "",
"regions": json!({}),
"tags": json!({})
});
let mut headers = reqwest::header::HeaderMap::new();
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}}/createReplicationSet \
--header 'content-type: application/json' \
--data '{
"clientToken": "",
"regions": {},
"tags": {}
}'
echo '{
"clientToken": "",
"regions": {},
"tags": {}
}' | \
http POST {{baseUrl}}/createReplicationSet \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "clientToken": "",\n "regions": {},\n "tags": {}\n}' \
--output-document \
- {{baseUrl}}/createReplicationSet
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"clientToken": "",
"regions": [],
"tags": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/createReplicationSet")! 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
CreateResponsePlan
{{baseUrl}}/createResponsePlan
BODY json
{
"actions": [
{
"ssmAutomation": ""
}
],
"chatChannel": {
"chatbotSns": "",
"empty": ""
},
"clientToken": "",
"displayName": "",
"engagements": [],
"incidentTemplate": {
"dedupeString": "",
"impact": "",
"incidentTags": "",
"notificationTargets": "",
"summary": "",
"title": ""
},
"integrations": [
{
"pagerDutyConfiguration": ""
}
],
"name": "",
"tags": {}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/createResponsePlan");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"actions\": [\n {\n \"ssmAutomation\": \"\"\n }\n ],\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"displayName\": \"\",\n \"engagements\": [],\n \"incidentTemplate\": {\n \"dedupeString\": \"\",\n \"impact\": \"\",\n \"incidentTags\": \"\",\n \"notificationTargets\": \"\",\n \"summary\": \"\",\n \"title\": \"\"\n },\n \"integrations\": [\n {\n \"pagerDutyConfiguration\": \"\"\n }\n ],\n \"name\": \"\",\n \"tags\": {}\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/createResponsePlan" {:content-type :json
:form-params {:actions [{:ssmAutomation ""}]
:chatChannel {:chatbotSns ""
:empty ""}
:clientToken ""
:displayName ""
:engagements []
:incidentTemplate {:dedupeString ""
:impact ""
:incidentTags ""
:notificationTargets ""
:summary ""
:title ""}
:integrations [{:pagerDutyConfiguration ""}]
:name ""
:tags {}}})
require "http/client"
url = "{{baseUrl}}/createResponsePlan"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"actions\": [\n {\n \"ssmAutomation\": \"\"\n }\n ],\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"displayName\": \"\",\n \"engagements\": [],\n \"incidentTemplate\": {\n \"dedupeString\": \"\",\n \"impact\": \"\",\n \"incidentTags\": \"\",\n \"notificationTargets\": \"\",\n \"summary\": \"\",\n \"title\": \"\"\n },\n \"integrations\": [\n {\n \"pagerDutyConfiguration\": \"\"\n }\n ],\n \"name\": \"\",\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}}/createResponsePlan"),
Content = new StringContent("{\n \"actions\": [\n {\n \"ssmAutomation\": \"\"\n }\n ],\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"displayName\": \"\",\n \"engagements\": [],\n \"incidentTemplate\": {\n \"dedupeString\": \"\",\n \"impact\": \"\",\n \"incidentTags\": \"\",\n \"notificationTargets\": \"\",\n \"summary\": \"\",\n \"title\": \"\"\n },\n \"integrations\": [\n {\n \"pagerDutyConfiguration\": \"\"\n }\n ],\n \"name\": \"\",\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}}/createResponsePlan");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"actions\": [\n {\n \"ssmAutomation\": \"\"\n }\n ],\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"displayName\": \"\",\n \"engagements\": [],\n \"incidentTemplate\": {\n \"dedupeString\": \"\",\n \"impact\": \"\",\n \"incidentTags\": \"\",\n \"notificationTargets\": \"\",\n \"summary\": \"\",\n \"title\": \"\"\n },\n \"integrations\": [\n {\n \"pagerDutyConfiguration\": \"\"\n }\n ],\n \"name\": \"\",\n \"tags\": {}\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/createResponsePlan"
payload := strings.NewReader("{\n \"actions\": [\n {\n \"ssmAutomation\": \"\"\n }\n ],\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"displayName\": \"\",\n \"engagements\": [],\n \"incidentTemplate\": {\n \"dedupeString\": \"\",\n \"impact\": \"\",\n \"incidentTags\": \"\",\n \"notificationTargets\": \"\",\n \"summary\": \"\",\n \"title\": \"\"\n },\n \"integrations\": [\n {\n \"pagerDutyConfiguration\": \"\"\n }\n ],\n \"name\": \"\",\n \"tags\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
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/createResponsePlan HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 446
{
"actions": [
{
"ssmAutomation": ""
}
],
"chatChannel": {
"chatbotSns": "",
"empty": ""
},
"clientToken": "",
"displayName": "",
"engagements": [],
"incidentTemplate": {
"dedupeString": "",
"impact": "",
"incidentTags": "",
"notificationTargets": "",
"summary": "",
"title": ""
},
"integrations": [
{
"pagerDutyConfiguration": ""
}
],
"name": "",
"tags": {}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/createResponsePlan")
.setHeader("content-type", "application/json")
.setBody("{\n \"actions\": [\n {\n \"ssmAutomation\": \"\"\n }\n ],\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"displayName\": \"\",\n \"engagements\": [],\n \"incidentTemplate\": {\n \"dedupeString\": \"\",\n \"impact\": \"\",\n \"incidentTags\": \"\",\n \"notificationTargets\": \"\",\n \"summary\": \"\",\n \"title\": \"\"\n },\n \"integrations\": [\n {\n \"pagerDutyConfiguration\": \"\"\n }\n ],\n \"name\": \"\",\n \"tags\": {}\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/createResponsePlan"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"actions\": [\n {\n \"ssmAutomation\": \"\"\n }\n ],\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"displayName\": \"\",\n \"engagements\": [],\n \"incidentTemplate\": {\n \"dedupeString\": \"\",\n \"impact\": \"\",\n \"incidentTags\": \"\",\n \"notificationTargets\": \"\",\n \"summary\": \"\",\n \"title\": \"\"\n },\n \"integrations\": [\n {\n \"pagerDutyConfiguration\": \"\"\n }\n ],\n \"name\": \"\",\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 \"actions\": [\n {\n \"ssmAutomation\": \"\"\n }\n ],\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"displayName\": \"\",\n \"engagements\": [],\n \"incidentTemplate\": {\n \"dedupeString\": \"\",\n \"impact\": \"\",\n \"incidentTags\": \"\",\n \"notificationTargets\": \"\",\n \"summary\": \"\",\n \"title\": \"\"\n },\n \"integrations\": [\n {\n \"pagerDutyConfiguration\": \"\"\n }\n ],\n \"name\": \"\",\n \"tags\": {}\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/createResponsePlan")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/createResponsePlan")
.header("content-type", "application/json")
.body("{\n \"actions\": [\n {\n \"ssmAutomation\": \"\"\n }\n ],\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"displayName\": \"\",\n \"engagements\": [],\n \"incidentTemplate\": {\n \"dedupeString\": \"\",\n \"impact\": \"\",\n \"incidentTags\": \"\",\n \"notificationTargets\": \"\",\n \"summary\": \"\",\n \"title\": \"\"\n },\n \"integrations\": [\n {\n \"pagerDutyConfiguration\": \"\"\n }\n ],\n \"name\": \"\",\n \"tags\": {}\n}")
.asString();
const data = JSON.stringify({
actions: [
{
ssmAutomation: ''
}
],
chatChannel: {
chatbotSns: '',
empty: ''
},
clientToken: '',
displayName: '',
engagements: [],
incidentTemplate: {
dedupeString: '',
impact: '',
incidentTags: '',
notificationTargets: '',
summary: '',
title: ''
},
integrations: [
{
pagerDutyConfiguration: ''
}
],
name: '',
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}}/createResponsePlan');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/createResponsePlan',
headers: {'content-type': 'application/json'},
data: {
actions: [{ssmAutomation: ''}],
chatChannel: {chatbotSns: '', empty: ''},
clientToken: '',
displayName: '',
engagements: [],
incidentTemplate: {
dedupeString: '',
impact: '',
incidentTags: '',
notificationTargets: '',
summary: '',
title: ''
},
integrations: [{pagerDutyConfiguration: ''}],
name: '',
tags: {}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/createResponsePlan';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"actions":[{"ssmAutomation":""}],"chatChannel":{"chatbotSns":"","empty":""},"clientToken":"","displayName":"","engagements":[],"incidentTemplate":{"dedupeString":"","impact":"","incidentTags":"","notificationTargets":"","summary":"","title":""},"integrations":[{"pagerDutyConfiguration":""}],"name":"","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}}/createResponsePlan',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "actions": [\n {\n "ssmAutomation": ""\n }\n ],\n "chatChannel": {\n "chatbotSns": "",\n "empty": ""\n },\n "clientToken": "",\n "displayName": "",\n "engagements": [],\n "incidentTemplate": {\n "dedupeString": "",\n "impact": "",\n "incidentTags": "",\n "notificationTargets": "",\n "summary": "",\n "title": ""\n },\n "integrations": [\n {\n "pagerDutyConfiguration": ""\n }\n ],\n "name": "",\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 \"actions\": [\n {\n \"ssmAutomation\": \"\"\n }\n ],\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"displayName\": \"\",\n \"engagements\": [],\n \"incidentTemplate\": {\n \"dedupeString\": \"\",\n \"impact\": \"\",\n \"incidentTags\": \"\",\n \"notificationTargets\": \"\",\n \"summary\": \"\",\n \"title\": \"\"\n },\n \"integrations\": [\n {\n \"pagerDutyConfiguration\": \"\"\n }\n ],\n \"name\": \"\",\n \"tags\": {}\n}")
val request = Request.Builder()
.url("{{baseUrl}}/createResponsePlan")
.post(body)
.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/createResponsePlan',
headers: {
'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({
actions: [{ssmAutomation: ''}],
chatChannel: {chatbotSns: '', empty: ''},
clientToken: '',
displayName: '',
engagements: [],
incidentTemplate: {
dedupeString: '',
impact: '',
incidentTags: '',
notificationTargets: '',
summary: '',
title: ''
},
integrations: [{pagerDutyConfiguration: ''}],
name: '',
tags: {}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/createResponsePlan',
headers: {'content-type': 'application/json'},
body: {
actions: [{ssmAutomation: ''}],
chatChannel: {chatbotSns: '', empty: ''},
clientToken: '',
displayName: '',
engagements: [],
incidentTemplate: {
dedupeString: '',
impact: '',
incidentTags: '',
notificationTargets: '',
summary: '',
title: ''
},
integrations: [{pagerDutyConfiguration: ''}],
name: '',
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}}/createResponsePlan');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
actions: [
{
ssmAutomation: ''
}
],
chatChannel: {
chatbotSns: '',
empty: ''
},
clientToken: '',
displayName: '',
engagements: [],
incidentTemplate: {
dedupeString: '',
impact: '',
incidentTags: '',
notificationTargets: '',
summary: '',
title: ''
},
integrations: [
{
pagerDutyConfiguration: ''
}
],
name: '',
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}}/createResponsePlan',
headers: {'content-type': 'application/json'},
data: {
actions: [{ssmAutomation: ''}],
chatChannel: {chatbotSns: '', empty: ''},
clientToken: '',
displayName: '',
engagements: [],
incidentTemplate: {
dedupeString: '',
impact: '',
incidentTags: '',
notificationTargets: '',
summary: '',
title: ''
},
integrations: [{pagerDutyConfiguration: ''}],
name: '',
tags: {}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/createResponsePlan';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"actions":[{"ssmAutomation":""}],"chatChannel":{"chatbotSns":"","empty":""},"clientToken":"","displayName":"","engagements":[],"incidentTemplate":{"dedupeString":"","impact":"","incidentTags":"","notificationTargets":"","summary":"","title":""},"integrations":[{"pagerDutyConfiguration":""}],"name":"","tags":{}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"actions": @[ @{ @"ssmAutomation": @"" } ],
@"chatChannel": @{ @"chatbotSns": @"", @"empty": @"" },
@"clientToken": @"",
@"displayName": @"",
@"engagements": @[ ],
@"incidentTemplate": @{ @"dedupeString": @"", @"impact": @"", @"incidentTags": @"", @"notificationTargets": @"", @"summary": @"", @"title": @"" },
@"integrations": @[ @{ @"pagerDutyConfiguration": @"" } ],
@"name": @"",
@"tags": @{ } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/createResponsePlan"]
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}}/createResponsePlan" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"actions\": [\n {\n \"ssmAutomation\": \"\"\n }\n ],\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"displayName\": \"\",\n \"engagements\": [],\n \"incidentTemplate\": {\n \"dedupeString\": \"\",\n \"impact\": \"\",\n \"incidentTags\": \"\",\n \"notificationTargets\": \"\",\n \"summary\": \"\",\n \"title\": \"\"\n },\n \"integrations\": [\n {\n \"pagerDutyConfiguration\": \"\"\n }\n ],\n \"name\": \"\",\n \"tags\": {}\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/createResponsePlan",
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([
'actions' => [
[
'ssmAutomation' => ''
]
],
'chatChannel' => [
'chatbotSns' => '',
'empty' => ''
],
'clientToken' => '',
'displayName' => '',
'engagements' => [
],
'incidentTemplate' => [
'dedupeString' => '',
'impact' => '',
'incidentTags' => '',
'notificationTargets' => '',
'summary' => '',
'title' => ''
],
'integrations' => [
[
'pagerDutyConfiguration' => ''
]
],
'name' => '',
'tags' => [
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/createResponsePlan', [
'body' => '{
"actions": [
{
"ssmAutomation": ""
}
],
"chatChannel": {
"chatbotSns": "",
"empty": ""
},
"clientToken": "",
"displayName": "",
"engagements": [],
"incidentTemplate": {
"dedupeString": "",
"impact": "",
"incidentTags": "",
"notificationTargets": "",
"summary": "",
"title": ""
},
"integrations": [
{
"pagerDutyConfiguration": ""
}
],
"name": "",
"tags": {}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/createResponsePlan');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'actions' => [
[
'ssmAutomation' => ''
]
],
'chatChannel' => [
'chatbotSns' => '',
'empty' => ''
],
'clientToken' => '',
'displayName' => '',
'engagements' => [
],
'incidentTemplate' => [
'dedupeString' => '',
'impact' => '',
'incidentTags' => '',
'notificationTargets' => '',
'summary' => '',
'title' => ''
],
'integrations' => [
[
'pagerDutyConfiguration' => ''
]
],
'name' => '',
'tags' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'actions' => [
[
'ssmAutomation' => ''
]
],
'chatChannel' => [
'chatbotSns' => '',
'empty' => ''
],
'clientToken' => '',
'displayName' => '',
'engagements' => [
],
'incidentTemplate' => [
'dedupeString' => '',
'impact' => '',
'incidentTags' => '',
'notificationTargets' => '',
'summary' => '',
'title' => ''
],
'integrations' => [
[
'pagerDutyConfiguration' => ''
]
],
'name' => '',
'tags' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/createResponsePlan');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/createResponsePlan' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"actions": [
{
"ssmAutomation": ""
}
],
"chatChannel": {
"chatbotSns": "",
"empty": ""
},
"clientToken": "",
"displayName": "",
"engagements": [],
"incidentTemplate": {
"dedupeString": "",
"impact": "",
"incidentTags": "",
"notificationTargets": "",
"summary": "",
"title": ""
},
"integrations": [
{
"pagerDutyConfiguration": ""
}
],
"name": "",
"tags": {}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/createResponsePlan' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"actions": [
{
"ssmAutomation": ""
}
],
"chatChannel": {
"chatbotSns": "",
"empty": ""
},
"clientToken": "",
"displayName": "",
"engagements": [],
"incidentTemplate": {
"dedupeString": "",
"impact": "",
"incidentTags": "",
"notificationTargets": "",
"summary": "",
"title": ""
},
"integrations": [
{
"pagerDutyConfiguration": ""
}
],
"name": "",
"tags": {}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"actions\": [\n {\n \"ssmAutomation\": \"\"\n }\n ],\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"displayName\": \"\",\n \"engagements\": [],\n \"incidentTemplate\": {\n \"dedupeString\": \"\",\n \"impact\": \"\",\n \"incidentTags\": \"\",\n \"notificationTargets\": \"\",\n \"summary\": \"\",\n \"title\": \"\"\n },\n \"integrations\": [\n {\n \"pagerDutyConfiguration\": \"\"\n }\n ],\n \"name\": \"\",\n \"tags\": {}\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/createResponsePlan", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/createResponsePlan"
payload = {
"actions": [{ "ssmAutomation": "" }],
"chatChannel": {
"chatbotSns": "",
"empty": ""
},
"clientToken": "",
"displayName": "",
"engagements": [],
"incidentTemplate": {
"dedupeString": "",
"impact": "",
"incidentTags": "",
"notificationTargets": "",
"summary": "",
"title": ""
},
"integrations": [{ "pagerDutyConfiguration": "" }],
"name": "",
"tags": {}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/createResponsePlan"
payload <- "{\n \"actions\": [\n {\n \"ssmAutomation\": \"\"\n }\n ],\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"displayName\": \"\",\n \"engagements\": [],\n \"incidentTemplate\": {\n \"dedupeString\": \"\",\n \"impact\": \"\",\n \"incidentTags\": \"\",\n \"notificationTargets\": \"\",\n \"summary\": \"\",\n \"title\": \"\"\n },\n \"integrations\": [\n {\n \"pagerDutyConfiguration\": \"\"\n }\n ],\n \"name\": \"\",\n \"tags\": {}\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/createResponsePlan")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"actions\": [\n {\n \"ssmAutomation\": \"\"\n }\n ],\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"displayName\": \"\",\n \"engagements\": [],\n \"incidentTemplate\": {\n \"dedupeString\": \"\",\n \"impact\": \"\",\n \"incidentTags\": \"\",\n \"notificationTargets\": \"\",\n \"summary\": \"\",\n \"title\": \"\"\n },\n \"integrations\": [\n {\n \"pagerDutyConfiguration\": \"\"\n }\n ],\n \"name\": \"\",\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/createResponsePlan') do |req|
req.body = "{\n \"actions\": [\n {\n \"ssmAutomation\": \"\"\n }\n ],\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"displayName\": \"\",\n \"engagements\": [],\n \"incidentTemplate\": {\n \"dedupeString\": \"\",\n \"impact\": \"\",\n \"incidentTags\": \"\",\n \"notificationTargets\": \"\",\n \"summary\": \"\",\n \"title\": \"\"\n },\n \"integrations\": [\n {\n \"pagerDutyConfiguration\": \"\"\n }\n ],\n \"name\": \"\",\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}}/createResponsePlan";
let payload = json!({
"actions": (json!({"ssmAutomation": ""})),
"chatChannel": json!({
"chatbotSns": "",
"empty": ""
}),
"clientToken": "",
"displayName": "",
"engagements": (),
"incidentTemplate": json!({
"dedupeString": "",
"impact": "",
"incidentTags": "",
"notificationTargets": "",
"summary": "",
"title": ""
}),
"integrations": (json!({"pagerDutyConfiguration": ""})),
"name": "",
"tags": json!({})
});
let mut headers = reqwest::header::HeaderMap::new();
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}}/createResponsePlan \
--header 'content-type: application/json' \
--data '{
"actions": [
{
"ssmAutomation": ""
}
],
"chatChannel": {
"chatbotSns": "",
"empty": ""
},
"clientToken": "",
"displayName": "",
"engagements": [],
"incidentTemplate": {
"dedupeString": "",
"impact": "",
"incidentTags": "",
"notificationTargets": "",
"summary": "",
"title": ""
},
"integrations": [
{
"pagerDutyConfiguration": ""
}
],
"name": "",
"tags": {}
}'
echo '{
"actions": [
{
"ssmAutomation": ""
}
],
"chatChannel": {
"chatbotSns": "",
"empty": ""
},
"clientToken": "",
"displayName": "",
"engagements": [],
"incidentTemplate": {
"dedupeString": "",
"impact": "",
"incidentTags": "",
"notificationTargets": "",
"summary": "",
"title": ""
},
"integrations": [
{
"pagerDutyConfiguration": ""
}
],
"name": "",
"tags": {}
}' | \
http POST {{baseUrl}}/createResponsePlan \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "actions": [\n {\n "ssmAutomation": ""\n }\n ],\n "chatChannel": {\n "chatbotSns": "",\n "empty": ""\n },\n "clientToken": "",\n "displayName": "",\n "engagements": [],\n "incidentTemplate": {\n "dedupeString": "",\n "impact": "",\n "incidentTags": "",\n "notificationTargets": "",\n "summary": "",\n "title": ""\n },\n "integrations": [\n {\n "pagerDutyConfiguration": ""\n }\n ],\n "name": "",\n "tags": {}\n}' \
--output-document \
- {{baseUrl}}/createResponsePlan
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"actions": [["ssmAutomation": ""]],
"chatChannel": [
"chatbotSns": "",
"empty": ""
],
"clientToken": "",
"displayName": "",
"engagements": [],
"incidentTemplate": [
"dedupeString": "",
"impact": "",
"incidentTags": "",
"notificationTargets": "",
"summary": "",
"title": ""
],
"integrations": [["pagerDutyConfiguration": ""]],
"name": "",
"tags": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/createResponsePlan")! 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
CreateTimelineEvent
{{baseUrl}}/createTimelineEvent
BODY json
{
"clientToken": "",
"eventData": "",
"eventReferences": [
{
"relatedItemId": "",
"resource": ""
}
],
"eventTime": "",
"eventType": "",
"incidentRecordArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/createTimelineEvent");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"clientToken\": \"\",\n \"eventData\": \"\",\n \"eventReferences\": [\n {\n \"relatedItemId\": \"\",\n \"resource\": \"\"\n }\n ],\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"incidentRecordArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/createTimelineEvent" {:content-type :json
:form-params {:clientToken ""
:eventData ""
:eventReferences [{:relatedItemId ""
:resource ""}]
:eventTime ""
:eventType ""
:incidentRecordArn ""}})
require "http/client"
url = "{{baseUrl}}/createTimelineEvent"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"clientToken\": \"\",\n \"eventData\": \"\",\n \"eventReferences\": [\n {\n \"relatedItemId\": \"\",\n \"resource\": \"\"\n }\n ],\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"incidentRecordArn\": \"\"\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}}/createTimelineEvent"),
Content = new StringContent("{\n \"clientToken\": \"\",\n \"eventData\": \"\",\n \"eventReferences\": [\n {\n \"relatedItemId\": \"\",\n \"resource\": \"\"\n }\n ],\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"incidentRecordArn\": \"\"\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}}/createTimelineEvent");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"clientToken\": \"\",\n \"eventData\": \"\",\n \"eventReferences\": [\n {\n \"relatedItemId\": \"\",\n \"resource\": \"\"\n }\n ],\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"incidentRecordArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/createTimelineEvent"
payload := strings.NewReader("{\n \"clientToken\": \"\",\n \"eventData\": \"\",\n \"eventReferences\": [\n {\n \"relatedItemId\": \"\",\n \"resource\": \"\"\n }\n ],\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"incidentRecordArn\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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/createTimelineEvent HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 195
{
"clientToken": "",
"eventData": "",
"eventReferences": [
{
"relatedItemId": "",
"resource": ""
}
],
"eventTime": "",
"eventType": "",
"incidentRecordArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/createTimelineEvent")
.setHeader("content-type", "application/json")
.setBody("{\n \"clientToken\": \"\",\n \"eventData\": \"\",\n \"eventReferences\": [\n {\n \"relatedItemId\": \"\",\n \"resource\": \"\"\n }\n ],\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"incidentRecordArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/createTimelineEvent"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"clientToken\": \"\",\n \"eventData\": \"\",\n \"eventReferences\": [\n {\n \"relatedItemId\": \"\",\n \"resource\": \"\"\n }\n ],\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"incidentRecordArn\": \"\"\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 \"clientToken\": \"\",\n \"eventData\": \"\",\n \"eventReferences\": [\n {\n \"relatedItemId\": \"\",\n \"resource\": \"\"\n }\n ],\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"incidentRecordArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/createTimelineEvent")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/createTimelineEvent")
.header("content-type", "application/json")
.body("{\n \"clientToken\": \"\",\n \"eventData\": \"\",\n \"eventReferences\": [\n {\n \"relatedItemId\": \"\",\n \"resource\": \"\"\n }\n ],\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"incidentRecordArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
clientToken: '',
eventData: '',
eventReferences: [
{
relatedItemId: '',
resource: ''
}
],
eventTime: '',
eventType: '',
incidentRecordArn: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/createTimelineEvent');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/createTimelineEvent',
headers: {'content-type': 'application/json'},
data: {
clientToken: '',
eventData: '',
eventReferences: [{relatedItemId: '', resource: ''}],
eventTime: '',
eventType: '',
incidentRecordArn: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/createTimelineEvent';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"clientToken":"","eventData":"","eventReferences":[{"relatedItemId":"","resource":""}],"eventTime":"","eventType":"","incidentRecordArn":""}'
};
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}}/createTimelineEvent',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "clientToken": "",\n "eventData": "",\n "eventReferences": [\n {\n "relatedItemId": "",\n "resource": ""\n }\n ],\n "eventTime": "",\n "eventType": "",\n "incidentRecordArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"clientToken\": \"\",\n \"eventData\": \"\",\n \"eventReferences\": [\n {\n \"relatedItemId\": \"\",\n \"resource\": \"\"\n }\n ],\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"incidentRecordArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/createTimelineEvent")
.post(body)
.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/createTimelineEvent',
headers: {
'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({
clientToken: '',
eventData: '',
eventReferences: [{relatedItemId: '', resource: ''}],
eventTime: '',
eventType: '',
incidentRecordArn: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/createTimelineEvent',
headers: {'content-type': 'application/json'},
body: {
clientToken: '',
eventData: '',
eventReferences: [{relatedItemId: '', resource: ''}],
eventTime: '',
eventType: '',
incidentRecordArn: ''
},
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}}/createTimelineEvent');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
clientToken: '',
eventData: '',
eventReferences: [
{
relatedItemId: '',
resource: ''
}
],
eventTime: '',
eventType: '',
incidentRecordArn: ''
});
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}}/createTimelineEvent',
headers: {'content-type': 'application/json'},
data: {
clientToken: '',
eventData: '',
eventReferences: [{relatedItemId: '', resource: ''}],
eventTime: '',
eventType: '',
incidentRecordArn: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/createTimelineEvent';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"clientToken":"","eventData":"","eventReferences":[{"relatedItemId":"","resource":""}],"eventTime":"","eventType":"","incidentRecordArn":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"clientToken": @"",
@"eventData": @"",
@"eventReferences": @[ @{ @"relatedItemId": @"", @"resource": @"" } ],
@"eventTime": @"",
@"eventType": @"",
@"incidentRecordArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/createTimelineEvent"]
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}}/createTimelineEvent" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"clientToken\": \"\",\n \"eventData\": \"\",\n \"eventReferences\": [\n {\n \"relatedItemId\": \"\",\n \"resource\": \"\"\n }\n ],\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"incidentRecordArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/createTimelineEvent",
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([
'clientToken' => '',
'eventData' => '',
'eventReferences' => [
[
'relatedItemId' => '',
'resource' => ''
]
],
'eventTime' => '',
'eventType' => '',
'incidentRecordArn' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/createTimelineEvent', [
'body' => '{
"clientToken": "",
"eventData": "",
"eventReferences": [
{
"relatedItemId": "",
"resource": ""
}
],
"eventTime": "",
"eventType": "",
"incidentRecordArn": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/createTimelineEvent');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'clientToken' => '',
'eventData' => '',
'eventReferences' => [
[
'relatedItemId' => '',
'resource' => ''
]
],
'eventTime' => '',
'eventType' => '',
'incidentRecordArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'clientToken' => '',
'eventData' => '',
'eventReferences' => [
[
'relatedItemId' => '',
'resource' => ''
]
],
'eventTime' => '',
'eventType' => '',
'incidentRecordArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/createTimelineEvent');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/createTimelineEvent' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"clientToken": "",
"eventData": "",
"eventReferences": [
{
"relatedItemId": "",
"resource": ""
}
],
"eventTime": "",
"eventType": "",
"incidentRecordArn": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/createTimelineEvent' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"clientToken": "",
"eventData": "",
"eventReferences": [
{
"relatedItemId": "",
"resource": ""
}
],
"eventTime": "",
"eventType": "",
"incidentRecordArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"clientToken\": \"\",\n \"eventData\": \"\",\n \"eventReferences\": [\n {\n \"relatedItemId\": \"\",\n \"resource\": \"\"\n }\n ],\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"incidentRecordArn\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/createTimelineEvent", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/createTimelineEvent"
payload = {
"clientToken": "",
"eventData": "",
"eventReferences": [
{
"relatedItemId": "",
"resource": ""
}
],
"eventTime": "",
"eventType": "",
"incidentRecordArn": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/createTimelineEvent"
payload <- "{\n \"clientToken\": \"\",\n \"eventData\": \"\",\n \"eventReferences\": [\n {\n \"relatedItemId\": \"\",\n \"resource\": \"\"\n }\n ],\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"incidentRecordArn\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/createTimelineEvent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"clientToken\": \"\",\n \"eventData\": \"\",\n \"eventReferences\": [\n {\n \"relatedItemId\": \"\",\n \"resource\": \"\"\n }\n ],\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"incidentRecordArn\": \"\"\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/createTimelineEvent') do |req|
req.body = "{\n \"clientToken\": \"\",\n \"eventData\": \"\",\n \"eventReferences\": [\n {\n \"relatedItemId\": \"\",\n \"resource\": \"\"\n }\n ],\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"incidentRecordArn\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/createTimelineEvent";
let payload = json!({
"clientToken": "",
"eventData": "",
"eventReferences": (
json!({
"relatedItemId": "",
"resource": ""
})
),
"eventTime": "",
"eventType": "",
"incidentRecordArn": ""
});
let mut headers = reqwest::header::HeaderMap::new();
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}}/createTimelineEvent \
--header 'content-type: application/json' \
--data '{
"clientToken": "",
"eventData": "",
"eventReferences": [
{
"relatedItemId": "",
"resource": ""
}
],
"eventTime": "",
"eventType": "",
"incidentRecordArn": ""
}'
echo '{
"clientToken": "",
"eventData": "",
"eventReferences": [
{
"relatedItemId": "",
"resource": ""
}
],
"eventTime": "",
"eventType": "",
"incidentRecordArn": ""
}' | \
http POST {{baseUrl}}/createTimelineEvent \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "clientToken": "",\n "eventData": "",\n "eventReferences": [\n {\n "relatedItemId": "",\n "resource": ""\n }\n ],\n "eventTime": "",\n "eventType": "",\n "incidentRecordArn": ""\n}' \
--output-document \
- {{baseUrl}}/createTimelineEvent
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"clientToken": "",
"eventData": "",
"eventReferences": [
[
"relatedItemId": "",
"resource": ""
]
],
"eventTime": "",
"eventType": "",
"incidentRecordArn": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/createTimelineEvent")! 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
DeleteIncidentRecord
{{baseUrl}}/deleteIncidentRecord
BODY json
{
"arn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/deleteIncidentRecord");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"arn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/deleteIncidentRecord" {:content-type :json
:form-params {:arn ""}})
require "http/client"
url = "{{baseUrl}}/deleteIncidentRecord"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"arn\": \"\"\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}}/deleteIncidentRecord"),
Content = new StringContent("{\n \"arn\": \"\"\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}}/deleteIncidentRecord");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"arn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/deleteIncidentRecord"
payload := strings.NewReader("{\n \"arn\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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/deleteIncidentRecord HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 15
{
"arn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/deleteIncidentRecord")
.setHeader("content-type", "application/json")
.setBody("{\n \"arn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/deleteIncidentRecord"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"arn\": \"\"\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 \"arn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/deleteIncidentRecord")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/deleteIncidentRecord")
.header("content-type", "application/json")
.body("{\n \"arn\": \"\"\n}")
.asString();
const data = JSON.stringify({
arn: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/deleteIncidentRecord');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/deleteIncidentRecord',
headers: {'content-type': 'application/json'},
data: {arn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/deleteIncidentRecord';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"arn":""}'
};
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}}/deleteIncidentRecord',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "arn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"arn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/deleteIncidentRecord")
.post(body)
.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/deleteIncidentRecord',
headers: {
'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({arn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/deleteIncidentRecord',
headers: {'content-type': 'application/json'},
body: {arn: ''},
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}}/deleteIncidentRecord');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
arn: ''
});
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}}/deleteIncidentRecord',
headers: {'content-type': 'application/json'},
data: {arn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/deleteIncidentRecord';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"arn":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"arn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/deleteIncidentRecord"]
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}}/deleteIncidentRecord" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"arn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/deleteIncidentRecord",
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([
'arn' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/deleteIncidentRecord', [
'body' => '{
"arn": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/deleteIncidentRecord');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'arn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'arn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/deleteIncidentRecord');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/deleteIncidentRecord' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"arn": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/deleteIncidentRecord' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"arn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"arn\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/deleteIncidentRecord", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/deleteIncidentRecord"
payload = { "arn": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/deleteIncidentRecord"
payload <- "{\n \"arn\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/deleteIncidentRecord")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"arn\": \"\"\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/deleteIncidentRecord') do |req|
req.body = "{\n \"arn\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/deleteIncidentRecord";
let payload = json!({"arn": ""});
let mut headers = reqwest::header::HeaderMap::new();
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}}/deleteIncidentRecord \
--header 'content-type: application/json' \
--data '{
"arn": ""
}'
echo '{
"arn": ""
}' | \
http POST {{baseUrl}}/deleteIncidentRecord \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "arn": ""\n}' \
--output-document \
- {{baseUrl}}/deleteIncidentRecord
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["arn": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/deleteIncidentRecord")! 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
DeleteReplicationSet
{{baseUrl}}/deleteReplicationSet#arn
QUERY PARAMS
arn
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/deleteReplicationSet?arn=#arn");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/deleteReplicationSet#arn" {:query-params {:arn ""}})
require "http/client"
url = "{{baseUrl}}/deleteReplicationSet?arn=#arn"
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/deleteReplicationSet?arn=#arn"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/deleteReplicationSet?arn=#arn");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/deleteReplicationSet?arn=#arn"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/deleteReplicationSet?arn= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/deleteReplicationSet?arn=#arn")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/deleteReplicationSet?arn=#arn"))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/deleteReplicationSet?arn=#arn")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/deleteReplicationSet?arn=#arn")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/deleteReplicationSet?arn=#arn');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/deleteReplicationSet#arn',
params: {arn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/deleteReplicationSet?arn=#arn';
const options = {method: 'POST'};
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}}/deleteReplicationSet?arn=#arn',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/deleteReplicationSet?arn=#arn")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/deleteReplicationSet?arn=',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/deleteReplicationSet#arn',
qs: {arn: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/deleteReplicationSet#arn');
req.query({
arn: ''
});
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}}/deleteReplicationSet#arn',
params: {arn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/deleteReplicationSet?arn=#arn';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/deleteReplicationSet?arn=#arn"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
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}}/deleteReplicationSet?arn=#arn" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/deleteReplicationSet?arn=#arn",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/deleteReplicationSet?arn=#arn');
echo $response->getBody();
setUrl('{{baseUrl}}/deleteReplicationSet#arn');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'arn' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/deleteReplicationSet#arn');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'arn' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/deleteReplicationSet?arn=#arn' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/deleteReplicationSet?arn=#arn' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/deleteReplicationSet?arn=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/deleteReplicationSet#arn"
querystring = {"arn":""}
response = requests.post(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/deleteReplicationSet#arn"
queryString <- list(arn = "")
response <- VERB("POST", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/deleteReplicationSet?arn=#arn")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/deleteReplicationSet') do |req|
req.params['arn'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/deleteReplicationSet#arn";
let querystring = [
("arn", ""),
];
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/deleteReplicationSet?arn=#arn'
http POST '{{baseUrl}}/deleteReplicationSet?arn=#arn'
wget --quiet \
--method POST \
--output-document \
- '{{baseUrl}}/deleteReplicationSet?arn=#arn'
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/deleteReplicationSet?arn=#arn")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
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}}/deleteResourcePolicy
BODY json
{
"policyId": "",
"resourceArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/deleteResourcePolicy");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"policyId\": \"\",\n \"resourceArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/deleteResourcePolicy" {:content-type :json
:form-params {:policyId ""
:resourceArn ""}})
require "http/client"
url = "{{baseUrl}}/deleteResourcePolicy"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"policyId\": \"\",\n \"resourceArn\": \"\"\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}}/deleteResourcePolicy"),
Content = new StringContent("{\n \"policyId\": \"\",\n \"resourceArn\": \"\"\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}}/deleteResourcePolicy");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"policyId\": \"\",\n \"resourceArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/deleteResourcePolicy"
payload := strings.NewReader("{\n \"policyId\": \"\",\n \"resourceArn\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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/deleteResourcePolicy HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 41
{
"policyId": "",
"resourceArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/deleteResourcePolicy")
.setHeader("content-type", "application/json")
.setBody("{\n \"policyId\": \"\",\n \"resourceArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/deleteResourcePolicy"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"policyId\": \"\",\n \"resourceArn\": \"\"\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 \"policyId\": \"\",\n \"resourceArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/deleteResourcePolicy")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/deleteResourcePolicy")
.header("content-type", "application/json")
.body("{\n \"policyId\": \"\",\n \"resourceArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
policyId: '',
resourceArn: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/deleteResourcePolicy');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/deleteResourcePolicy',
headers: {'content-type': 'application/json'},
data: {policyId: '', resourceArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/deleteResourcePolicy';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"policyId":"","resourceArn":""}'
};
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}}/deleteResourcePolicy',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "policyId": "",\n "resourceArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"policyId\": \"\",\n \"resourceArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/deleteResourcePolicy")
.post(body)
.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/deleteResourcePolicy',
headers: {
'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({policyId: '', resourceArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/deleteResourcePolicy',
headers: {'content-type': 'application/json'},
body: {policyId: '', resourceArn: ''},
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}}/deleteResourcePolicy');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
policyId: '',
resourceArn: ''
});
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}}/deleteResourcePolicy',
headers: {'content-type': 'application/json'},
data: {policyId: '', resourceArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/deleteResourcePolicy';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"policyId":"","resourceArn":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"policyId": @"",
@"resourceArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/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}}/deleteResourcePolicy" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"policyId\": \"\",\n \"resourceArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/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([
'policyId' => '',
'resourceArn' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/deleteResourcePolicy', [
'body' => '{
"policyId": "",
"resourceArn": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/deleteResourcePolicy');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'policyId' => '',
'resourceArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'policyId' => '',
'resourceArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/deleteResourcePolicy');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/deleteResourcePolicy' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"policyId": "",
"resourceArn": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/deleteResourcePolicy' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"policyId": "",
"resourceArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"policyId\": \"\",\n \"resourceArn\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/deleteResourcePolicy", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/deleteResourcePolicy"
payload = {
"policyId": "",
"resourceArn": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/deleteResourcePolicy"
payload <- "{\n \"policyId\": \"\",\n \"resourceArn\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/deleteResourcePolicy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"policyId\": \"\",\n \"resourceArn\": \"\"\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/deleteResourcePolicy') do |req|
req.body = "{\n \"policyId\": \"\",\n \"resourceArn\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/deleteResourcePolicy";
let payload = json!({
"policyId": "",
"resourceArn": ""
});
let mut headers = reqwest::header::HeaderMap::new();
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}}/deleteResourcePolicy \
--header 'content-type: application/json' \
--data '{
"policyId": "",
"resourceArn": ""
}'
echo '{
"policyId": "",
"resourceArn": ""
}' | \
http POST {{baseUrl}}/deleteResourcePolicy \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "policyId": "",\n "resourceArn": ""\n}' \
--output-document \
- {{baseUrl}}/deleteResourcePolicy
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"policyId": "",
"resourceArn": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/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
DeleteResponsePlan
{{baseUrl}}/deleteResponsePlan
BODY json
{
"arn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/deleteResponsePlan");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"arn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/deleteResponsePlan" {:content-type :json
:form-params {:arn ""}})
require "http/client"
url = "{{baseUrl}}/deleteResponsePlan"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"arn\": \"\"\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}}/deleteResponsePlan"),
Content = new StringContent("{\n \"arn\": \"\"\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}}/deleteResponsePlan");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"arn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/deleteResponsePlan"
payload := strings.NewReader("{\n \"arn\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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/deleteResponsePlan HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 15
{
"arn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/deleteResponsePlan")
.setHeader("content-type", "application/json")
.setBody("{\n \"arn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/deleteResponsePlan"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"arn\": \"\"\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 \"arn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/deleteResponsePlan")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/deleteResponsePlan")
.header("content-type", "application/json")
.body("{\n \"arn\": \"\"\n}")
.asString();
const data = JSON.stringify({
arn: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/deleteResponsePlan');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/deleteResponsePlan',
headers: {'content-type': 'application/json'},
data: {arn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/deleteResponsePlan';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"arn":""}'
};
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}}/deleteResponsePlan',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "arn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"arn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/deleteResponsePlan")
.post(body)
.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/deleteResponsePlan',
headers: {
'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({arn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/deleteResponsePlan',
headers: {'content-type': 'application/json'},
body: {arn: ''},
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}}/deleteResponsePlan');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
arn: ''
});
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}}/deleteResponsePlan',
headers: {'content-type': 'application/json'},
data: {arn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/deleteResponsePlan';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"arn":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"arn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/deleteResponsePlan"]
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}}/deleteResponsePlan" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"arn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/deleteResponsePlan",
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([
'arn' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/deleteResponsePlan', [
'body' => '{
"arn": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/deleteResponsePlan');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'arn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'arn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/deleteResponsePlan');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/deleteResponsePlan' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"arn": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/deleteResponsePlan' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"arn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"arn\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/deleteResponsePlan", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/deleteResponsePlan"
payload = { "arn": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/deleteResponsePlan"
payload <- "{\n \"arn\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/deleteResponsePlan")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"arn\": \"\"\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/deleteResponsePlan') do |req|
req.body = "{\n \"arn\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/deleteResponsePlan";
let payload = json!({"arn": ""});
let mut headers = reqwest::header::HeaderMap::new();
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}}/deleteResponsePlan \
--header 'content-type: application/json' \
--data '{
"arn": ""
}'
echo '{
"arn": ""
}' | \
http POST {{baseUrl}}/deleteResponsePlan \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "arn": ""\n}' \
--output-document \
- {{baseUrl}}/deleteResponsePlan
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["arn": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/deleteResponsePlan")! 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
DeleteTimelineEvent
{{baseUrl}}/deleteTimelineEvent
BODY json
{
"eventId": "",
"incidentRecordArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/deleteTimelineEvent");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"eventId\": \"\",\n \"incidentRecordArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/deleteTimelineEvent" {:content-type :json
:form-params {:eventId ""
:incidentRecordArn ""}})
require "http/client"
url = "{{baseUrl}}/deleteTimelineEvent"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"eventId\": \"\",\n \"incidentRecordArn\": \"\"\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}}/deleteTimelineEvent"),
Content = new StringContent("{\n \"eventId\": \"\",\n \"incidentRecordArn\": \"\"\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}}/deleteTimelineEvent");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"eventId\": \"\",\n \"incidentRecordArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/deleteTimelineEvent"
payload := strings.NewReader("{\n \"eventId\": \"\",\n \"incidentRecordArn\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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/deleteTimelineEvent HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 46
{
"eventId": "",
"incidentRecordArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/deleteTimelineEvent")
.setHeader("content-type", "application/json")
.setBody("{\n \"eventId\": \"\",\n \"incidentRecordArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/deleteTimelineEvent"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"eventId\": \"\",\n \"incidentRecordArn\": \"\"\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 \"eventId\": \"\",\n \"incidentRecordArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/deleteTimelineEvent")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/deleteTimelineEvent")
.header("content-type", "application/json")
.body("{\n \"eventId\": \"\",\n \"incidentRecordArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
eventId: '',
incidentRecordArn: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/deleteTimelineEvent');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/deleteTimelineEvent',
headers: {'content-type': 'application/json'},
data: {eventId: '', incidentRecordArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/deleteTimelineEvent';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"eventId":"","incidentRecordArn":""}'
};
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}}/deleteTimelineEvent',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "eventId": "",\n "incidentRecordArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"eventId\": \"\",\n \"incidentRecordArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/deleteTimelineEvent")
.post(body)
.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/deleteTimelineEvent',
headers: {
'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({eventId: '', incidentRecordArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/deleteTimelineEvent',
headers: {'content-type': 'application/json'},
body: {eventId: '', incidentRecordArn: ''},
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}}/deleteTimelineEvent');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
eventId: '',
incidentRecordArn: ''
});
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}}/deleteTimelineEvent',
headers: {'content-type': 'application/json'},
data: {eventId: '', incidentRecordArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/deleteTimelineEvent';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"eventId":"","incidentRecordArn":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"eventId": @"",
@"incidentRecordArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/deleteTimelineEvent"]
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}}/deleteTimelineEvent" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"eventId\": \"\",\n \"incidentRecordArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/deleteTimelineEvent",
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([
'eventId' => '',
'incidentRecordArn' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/deleteTimelineEvent', [
'body' => '{
"eventId": "",
"incidentRecordArn": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/deleteTimelineEvent');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'eventId' => '',
'incidentRecordArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'eventId' => '',
'incidentRecordArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/deleteTimelineEvent');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/deleteTimelineEvent' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"eventId": "",
"incidentRecordArn": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/deleteTimelineEvent' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"eventId": "",
"incidentRecordArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"eventId\": \"\",\n \"incidentRecordArn\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/deleteTimelineEvent", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/deleteTimelineEvent"
payload = {
"eventId": "",
"incidentRecordArn": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/deleteTimelineEvent"
payload <- "{\n \"eventId\": \"\",\n \"incidentRecordArn\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/deleteTimelineEvent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"eventId\": \"\",\n \"incidentRecordArn\": \"\"\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/deleteTimelineEvent') do |req|
req.body = "{\n \"eventId\": \"\",\n \"incidentRecordArn\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/deleteTimelineEvent";
let payload = json!({
"eventId": "",
"incidentRecordArn": ""
});
let mut headers = reqwest::header::HeaderMap::new();
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}}/deleteTimelineEvent \
--header 'content-type: application/json' \
--data '{
"eventId": "",
"incidentRecordArn": ""
}'
echo '{
"eventId": "",
"incidentRecordArn": ""
}' | \
http POST {{baseUrl}}/deleteTimelineEvent \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "eventId": "",\n "incidentRecordArn": ""\n}' \
--output-document \
- {{baseUrl}}/deleteTimelineEvent
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"eventId": "",
"incidentRecordArn": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/deleteTimelineEvent")! 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()
GET
GetIncidentRecord
{{baseUrl}}/getIncidentRecord#arn
QUERY PARAMS
arn
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/getIncidentRecord?arn=#arn");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/getIncidentRecord#arn" {:query-params {:arn ""}})
require "http/client"
url = "{{baseUrl}}/getIncidentRecord?arn=#arn"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/getIncidentRecord?arn=#arn"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/getIncidentRecord?arn=#arn");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/getIncidentRecord?arn=#arn"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/getIncidentRecord?arn= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/getIncidentRecord?arn=#arn")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/getIncidentRecord?arn=#arn"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/getIncidentRecord?arn=#arn")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/getIncidentRecord?arn=#arn")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/getIncidentRecord?arn=#arn');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/getIncidentRecord#arn',
params: {arn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/getIncidentRecord?arn=#arn';
const options = {method: 'GET'};
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}}/getIncidentRecord?arn=#arn',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/getIncidentRecord?arn=#arn")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/getIncidentRecord?arn=',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/getIncidentRecord#arn',
qs: {arn: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/getIncidentRecord#arn');
req.query({
arn: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/getIncidentRecord#arn',
params: {arn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/getIncidentRecord?arn=#arn';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/getIncidentRecord?arn=#arn"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/getIncidentRecord?arn=#arn" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/getIncidentRecord?arn=#arn",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/getIncidentRecord?arn=#arn');
echo $response->getBody();
setUrl('{{baseUrl}}/getIncidentRecord#arn');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'arn' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/getIncidentRecord#arn');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'arn' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/getIncidentRecord?arn=#arn' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/getIncidentRecord?arn=#arn' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/getIncidentRecord?arn=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/getIncidentRecord#arn"
querystring = {"arn":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/getIncidentRecord#arn"
queryString <- list(arn = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/getIncidentRecord?arn=#arn")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/getIncidentRecord') do |req|
req.params['arn'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/getIncidentRecord#arn";
let querystring = [
("arn", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/getIncidentRecord?arn=#arn'
http GET '{{baseUrl}}/getIncidentRecord?arn=#arn'
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/getIncidentRecord?arn=#arn'
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/getIncidentRecord?arn=#arn")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
GET
GetReplicationSet
{{baseUrl}}/getReplicationSet#arn
QUERY PARAMS
arn
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/getReplicationSet?arn=#arn");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/getReplicationSet#arn" {:query-params {:arn ""}})
require "http/client"
url = "{{baseUrl}}/getReplicationSet?arn=#arn"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/getReplicationSet?arn=#arn"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/getReplicationSet?arn=#arn");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/getReplicationSet?arn=#arn"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/getReplicationSet?arn= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/getReplicationSet?arn=#arn")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/getReplicationSet?arn=#arn"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/getReplicationSet?arn=#arn")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/getReplicationSet?arn=#arn")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/getReplicationSet?arn=#arn');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/getReplicationSet#arn',
params: {arn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/getReplicationSet?arn=#arn';
const options = {method: 'GET'};
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}}/getReplicationSet?arn=#arn',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/getReplicationSet?arn=#arn")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/getReplicationSet?arn=',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/getReplicationSet#arn',
qs: {arn: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/getReplicationSet#arn');
req.query({
arn: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/getReplicationSet#arn',
params: {arn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/getReplicationSet?arn=#arn';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/getReplicationSet?arn=#arn"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/getReplicationSet?arn=#arn" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/getReplicationSet?arn=#arn",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/getReplicationSet?arn=#arn');
echo $response->getBody();
setUrl('{{baseUrl}}/getReplicationSet#arn');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'arn' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/getReplicationSet#arn');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'arn' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/getReplicationSet?arn=#arn' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/getReplicationSet?arn=#arn' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/getReplicationSet?arn=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/getReplicationSet#arn"
querystring = {"arn":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/getReplicationSet#arn"
queryString <- list(arn = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/getReplicationSet?arn=#arn")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/getReplicationSet') do |req|
req.params['arn'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/getReplicationSet#arn";
let querystring = [
("arn", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/getReplicationSet?arn=#arn'
http GET '{{baseUrl}}/getReplicationSet?arn=#arn'
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/getReplicationSet?arn=#arn'
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/getReplicationSet?arn=#arn")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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}}/getResourcePolicies#resourceArn
QUERY PARAMS
resourceArn
BODY json
{
"maxResults": 0,
"nextToken": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/getResourcePolicies?resourceArn=#resourceArn");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/getResourcePolicies#resourceArn" {:query-params {:resourceArn ""}
:content-type :json
:form-params {:maxResults 0
:nextToken ""}})
require "http/client"
url = "{{baseUrl}}/getResourcePolicies?resourceArn=#resourceArn"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"maxResults\": 0,\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}}/getResourcePolicies?resourceArn=#resourceArn"),
Content = new StringContent("{\n \"maxResults\": 0,\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}}/getResourcePolicies?resourceArn=#resourceArn");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/getResourcePolicies?resourceArn=#resourceArn"
payload := strings.NewReader("{\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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/getResourcePolicies?resourceArn= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 40
{
"maxResults": 0,
"nextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/getResourcePolicies?resourceArn=#resourceArn")
.setHeader("content-type", "application/json")
.setBody("{\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/getResourcePolicies?resourceArn=#resourceArn"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"maxResults\": 0,\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\": 0,\n \"nextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/getResourcePolicies?resourceArn=#resourceArn")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/getResourcePolicies?resourceArn=#resourceArn")
.header("content-type", "application/json")
.body("{\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
maxResults: 0,
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}}/getResourcePolicies?resourceArn=#resourceArn');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/getResourcePolicies#resourceArn',
params: {resourceArn: ''},
headers: {'content-type': 'application/json'},
data: {maxResults: 0, nextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/getResourcePolicies?resourceArn=#resourceArn';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"maxResults":0,"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}}/getResourcePolicies?resourceArn=#resourceArn',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "maxResults": 0,\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\": 0,\n \"nextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/getResourcePolicies?resourceArn=#resourceArn")
.post(body)
.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/getResourcePolicies?resourceArn=',
headers: {
'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: 0, nextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/getResourcePolicies#resourceArn',
qs: {resourceArn: ''},
headers: {'content-type': 'application/json'},
body: {maxResults: 0, 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}}/getResourcePolicies#resourceArn');
req.query({
resourceArn: ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
maxResults: 0,
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}}/getResourcePolicies#resourceArn',
params: {resourceArn: ''},
headers: {'content-type': 'application/json'},
data: {maxResults: 0, nextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/getResourcePolicies?resourceArn=#resourceArn';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"maxResults":0,"nextToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"maxResults": @0,
@"nextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/getResourcePolicies?resourceArn=#resourceArn"]
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}}/getResourcePolicies?resourceArn=#resourceArn" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/getResourcePolicies?resourceArn=#resourceArn",
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' => 0,
'nextToken' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/getResourcePolicies?resourceArn=#resourceArn', [
'body' => '{
"maxResults": 0,
"nextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/getResourcePolicies#resourceArn');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'resourceArn' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'maxResults' => 0,
'nextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'maxResults' => 0,
'nextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/getResourcePolicies#resourceArn');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'resourceArn' => ''
]));
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/getResourcePolicies?resourceArn=#resourceArn' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"maxResults": 0,
"nextToken": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/getResourcePolicies?resourceArn=#resourceArn' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"maxResults": 0,
"nextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/getResourcePolicies?resourceArn=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/getResourcePolicies#resourceArn"
querystring = {"resourceArn":""}
payload = {
"maxResults": 0,
"nextToken": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/getResourcePolicies#resourceArn"
queryString <- list(resourceArn = "")
payload <- "{\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/getResourcePolicies?resourceArn=#resourceArn")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"maxResults\": 0,\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/getResourcePolicies') do |req|
req.params['resourceArn'] = ''
req.body = "{\n \"maxResults\": 0,\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}}/getResourcePolicies#resourceArn";
let querystring = [
("resourceArn", ""),
];
let payload = json!({
"maxResults": 0,
"nextToken": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/getResourcePolicies?resourceArn=#resourceArn' \
--header 'content-type: application/json' \
--data '{
"maxResults": 0,
"nextToken": ""
}'
echo '{
"maxResults": 0,
"nextToken": ""
}' | \
http POST '{{baseUrl}}/getResourcePolicies?resourceArn=#resourceArn' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "maxResults": 0,\n "nextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/getResourcePolicies?resourceArn=#resourceArn'
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"maxResults": 0,
"nextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/getResourcePolicies?resourceArn=#resourceArn")! 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()
GET
GetResponsePlan
{{baseUrl}}/getResponsePlan#arn
QUERY PARAMS
arn
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/getResponsePlan?arn=#arn");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/getResponsePlan#arn" {:query-params {:arn ""}})
require "http/client"
url = "{{baseUrl}}/getResponsePlan?arn=#arn"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/getResponsePlan?arn=#arn"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/getResponsePlan?arn=#arn");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/getResponsePlan?arn=#arn"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/getResponsePlan?arn= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/getResponsePlan?arn=#arn")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/getResponsePlan?arn=#arn"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/getResponsePlan?arn=#arn")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/getResponsePlan?arn=#arn")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/getResponsePlan?arn=#arn');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/getResponsePlan#arn',
params: {arn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/getResponsePlan?arn=#arn';
const options = {method: 'GET'};
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}}/getResponsePlan?arn=#arn',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/getResponsePlan?arn=#arn")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/getResponsePlan?arn=',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/getResponsePlan#arn',
qs: {arn: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/getResponsePlan#arn');
req.query({
arn: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/getResponsePlan#arn',
params: {arn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/getResponsePlan?arn=#arn';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/getResponsePlan?arn=#arn"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/getResponsePlan?arn=#arn" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/getResponsePlan?arn=#arn",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/getResponsePlan?arn=#arn');
echo $response->getBody();
setUrl('{{baseUrl}}/getResponsePlan#arn');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'arn' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/getResponsePlan#arn');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'arn' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/getResponsePlan?arn=#arn' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/getResponsePlan?arn=#arn' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/getResponsePlan?arn=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/getResponsePlan#arn"
querystring = {"arn":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/getResponsePlan#arn"
queryString <- list(arn = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/getResponsePlan?arn=#arn")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/getResponsePlan') do |req|
req.params['arn'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/getResponsePlan#arn";
let querystring = [
("arn", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/getResponsePlan?arn=#arn'
http GET '{{baseUrl}}/getResponsePlan?arn=#arn'
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/getResponsePlan?arn=#arn'
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/getResponsePlan?arn=#arn")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
GET
GetTimelineEvent
{{baseUrl}}/getTimelineEvent#eventId&incidentRecordArn
QUERY PARAMS
eventId
incidentRecordArn
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/getTimelineEvent?eventId=&incidentRecordArn=#eventId&incidentRecordArn");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/getTimelineEvent#eventId&incidentRecordArn" {:query-params {:eventId ""
:incidentRecordArn ""}})
require "http/client"
url = "{{baseUrl}}/getTimelineEvent?eventId=&incidentRecordArn=#eventId&incidentRecordArn"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/getTimelineEvent?eventId=&incidentRecordArn=#eventId&incidentRecordArn"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/getTimelineEvent?eventId=&incidentRecordArn=#eventId&incidentRecordArn");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/getTimelineEvent?eventId=&incidentRecordArn=#eventId&incidentRecordArn"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/getTimelineEvent?eventId=&incidentRecordArn= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/getTimelineEvent?eventId=&incidentRecordArn=#eventId&incidentRecordArn")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/getTimelineEvent?eventId=&incidentRecordArn=#eventId&incidentRecordArn"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/getTimelineEvent?eventId=&incidentRecordArn=#eventId&incidentRecordArn")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/getTimelineEvent?eventId=&incidentRecordArn=#eventId&incidentRecordArn")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/getTimelineEvent?eventId=&incidentRecordArn=#eventId&incidentRecordArn');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/getTimelineEvent#eventId&incidentRecordArn',
params: {eventId: '', incidentRecordArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/getTimelineEvent?eventId=&incidentRecordArn=#eventId&incidentRecordArn';
const options = {method: 'GET'};
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}}/getTimelineEvent?eventId=&incidentRecordArn=#eventId&incidentRecordArn',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/getTimelineEvent?eventId=&incidentRecordArn=#eventId&incidentRecordArn")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/getTimelineEvent?eventId=&incidentRecordArn=',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/getTimelineEvent#eventId&incidentRecordArn',
qs: {eventId: '', incidentRecordArn: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/getTimelineEvent#eventId&incidentRecordArn');
req.query({
eventId: '',
incidentRecordArn: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/getTimelineEvent#eventId&incidentRecordArn',
params: {eventId: '', incidentRecordArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/getTimelineEvent?eventId=&incidentRecordArn=#eventId&incidentRecordArn';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/getTimelineEvent?eventId=&incidentRecordArn=#eventId&incidentRecordArn"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/getTimelineEvent?eventId=&incidentRecordArn=#eventId&incidentRecordArn" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/getTimelineEvent?eventId=&incidentRecordArn=#eventId&incidentRecordArn",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/getTimelineEvent?eventId=&incidentRecordArn=#eventId&incidentRecordArn');
echo $response->getBody();
setUrl('{{baseUrl}}/getTimelineEvent#eventId&incidentRecordArn');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'eventId' => '',
'incidentRecordArn' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/getTimelineEvent#eventId&incidentRecordArn');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'eventId' => '',
'incidentRecordArn' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/getTimelineEvent?eventId=&incidentRecordArn=#eventId&incidentRecordArn' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/getTimelineEvent?eventId=&incidentRecordArn=#eventId&incidentRecordArn' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/getTimelineEvent?eventId=&incidentRecordArn=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/getTimelineEvent#eventId&incidentRecordArn"
querystring = {"eventId":"","incidentRecordArn":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/getTimelineEvent#eventId&incidentRecordArn"
queryString <- list(
eventId = "",
incidentRecordArn = ""
)
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/getTimelineEvent?eventId=&incidentRecordArn=#eventId&incidentRecordArn")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/getTimelineEvent') do |req|
req.params['eventId'] = ''
req.params['incidentRecordArn'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/getTimelineEvent#eventId&incidentRecordArn";
let querystring = [
("eventId", ""),
("incidentRecordArn", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/getTimelineEvent?eventId=&incidentRecordArn=#eventId&incidentRecordArn'
http GET '{{baseUrl}}/getTimelineEvent?eventId=&incidentRecordArn=#eventId&incidentRecordArn'
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/getTimelineEvent?eventId=&incidentRecordArn=#eventId&incidentRecordArn'
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/getTimelineEvent?eventId=&incidentRecordArn=#eventId&incidentRecordArn")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
ListIncidentRecords
{{baseUrl}}/listIncidentRecords
BODY json
{
"filters": [
{
"condition": "",
"key": ""
}
],
"maxResults": 0,
"nextToken": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/listIncidentRecords");
struct curl_slist *headers = NULL;
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 {\n \"condition\": \"\",\n \"key\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/listIncidentRecords" {:content-type :json
:form-params {:filters [{:condition ""
:key ""}]
:maxResults 0
:nextToken ""}})
require "http/client"
url = "{{baseUrl}}/listIncidentRecords"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"filters\": [\n {\n \"condition\": \"\",\n \"key\": \"\"\n }\n ],\n \"maxResults\": 0,\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}}/listIncidentRecords"),
Content = new StringContent("{\n \"filters\": [\n {\n \"condition\": \"\",\n \"key\": \"\"\n }\n ],\n \"maxResults\": 0,\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}}/listIncidentRecords");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"filters\": [\n {\n \"condition\": \"\",\n \"key\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/listIncidentRecords"
payload := strings.NewReader("{\n \"filters\": [\n {\n \"condition\": \"\",\n \"key\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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/listIncidentRecords HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 111
{
"filters": [
{
"condition": "",
"key": ""
}
],
"maxResults": 0,
"nextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/listIncidentRecords")
.setHeader("content-type", "application/json")
.setBody("{\n \"filters\": [\n {\n \"condition\": \"\",\n \"key\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/listIncidentRecords"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"filters\": [\n {\n \"condition\": \"\",\n \"key\": \"\"\n }\n ],\n \"maxResults\": 0,\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 {\n \"condition\": \"\",\n \"key\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/listIncidentRecords")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/listIncidentRecords")
.header("content-type", "application/json")
.body("{\n \"filters\": [\n {\n \"condition\": \"\",\n \"key\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
filters: [
{
condition: '',
key: ''
}
],
maxResults: 0,
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}}/listIncidentRecords');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/listIncidentRecords',
headers: {'content-type': 'application/json'},
data: {filters: [{condition: '', key: ''}], maxResults: 0, nextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/listIncidentRecords';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"filters":[{"condition":"","key":""}],"maxResults":0,"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}}/listIncidentRecords',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "filters": [\n {\n "condition": "",\n "key": ""\n }\n ],\n "maxResults": 0,\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 {\n \"condition\": \"\",\n \"key\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/listIncidentRecords")
.post(body)
.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/listIncidentRecords',
headers: {
'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: [{condition: '', key: ''}], maxResults: 0, nextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/listIncidentRecords',
headers: {'content-type': 'application/json'},
body: {filters: [{condition: '', key: ''}], maxResults: 0, 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}}/listIncidentRecords');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
filters: [
{
condition: '',
key: ''
}
],
maxResults: 0,
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}}/listIncidentRecords',
headers: {'content-type': 'application/json'},
data: {filters: [{condition: '', key: ''}], maxResults: 0, nextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/listIncidentRecords';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"filters":[{"condition":"","key":""}],"maxResults":0,"nextToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"filters": @[ @{ @"condition": @"", @"key": @"" } ],
@"maxResults": @0,
@"nextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/listIncidentRecords"]
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}}/listIncidentRecords" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"filters\": [\n {\n \"condition\": \"\",\n \"key\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/listIncidentRecords",
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' => [
[
'condition' => '',
'key' => ''
]
],
'maxResults' => 0,
'nextToken' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/listIncidentRecords', [
'body' => '{
"filters": [
{
"condition": "",
"key": ""
}
],
"maxResults": 0,
"nextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/listIncidentRecords');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'filters' => [
[
'condition' => '',
'key' => ''
]
],
'maxResults' => 0,
'nextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'filters' => [
[
'condition' => '',
'key' => ''
]
],
'maxResults' => 0,
'nextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/listIncidentRecords');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/listIncidentRecords' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"filters": [
{
"condition": "",
"key": ""
}
],
"maxResults": 0,
"nextToken": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/listIncidentRecords' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"filters": [
{
"condition": "",
"key": ""
}
],
"maxResults": 0,
"nextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"filters\": [\n {\n \"condition\": \"\",\n \"key\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/listIncidentRecords", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/listIncidentRecords"
payload = {
"filters": [
{
"condition": "",
"key": ""
}
],
"maxResults": 0,
"nextToken": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/listIncidentRecords"
payload <- "{\n \"filters\": [\n {\n \"condition\": \"\",\n \"key\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/listIncidentRecords")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"filters\": [\n {\n \"condition\": \"\",\n \"key\": \"\"\n }\n ],\n \"maxResults\": 0,\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/listIncidentRecords') do |req|
req.body = "{\n \"filters\": [\n {\n \"condition\": \"\",\n \"key\": \"\"\n }\n ],\n \"maxResults\": 0,\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}}/listIncidentRecords";
let payload = json!({
"filters": (
json!({
"condition": "",
"key": ""
})
),
"maxResults": 0,
"nextToken": ""
});
let mut headers = reqwest::header::HeaderMap::new();
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}}/listIncidentRecords \
--header 'content-type: application/json' \
--data '{
"filters": [
{
"condition": "",
"key": ""
}
],
"maxResults": 0,
"nextToken": ""
}'
echo '{
"filters": [
{
"condition": "",
"key": ""
}
],
"maxResults": 0,
"nextToken": ""
}' | \
http POST {{baseUrl}}/listIncidentRecords \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "filters": [\n {\n "condition": "",\n "key": ""\n }\n ],\n "maxResults": 0,\n "nextToken": ""\n}' \
--output-document \
- {{baseUrl}}/listIncidentRecords
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"filters": [
[
"condition": "",
"key": ""
]
],
"maxResults": 0,
"nextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/listIncidentRecords")! 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}}/listRelatedItems");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"incidentRecordArn\": \"\",\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/listRelatedItems" {:content-type :json
:form-params {:incidentRecordArn ""
:maxResults 0
:nextToken ""}})
require "http/client"
url = "{{baseUrl}}/listRelatedItems"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"incidentRecordArn\": \"\",\n \"maxResults\": 0,\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}}/listRelatedItems"),
Content = new StringContent("{\n \"incidentRecordArn\": \"\",\n \"maxResults\": 0,\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}}/listRelatedItems");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"incidentRecordArn\": \"\",\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/listRelatedItems"
payload := strings.NewReader("{\n \"incidentRecordArn\": \"\",\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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/listRelatedItems HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 67
{
"incidentRecordArn": "",
"maxResults": 0,
"nextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/listRelatedItems")
.setHeader("content-type", "application/json")
.setBody("{\n \"incidentRecordArn\": \"\",\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/listRelatedItems"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"incidentRecordArn\": \"\",\n \"maxResults\": 0,\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 \"incidentRecordArn\": \"\",\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/listRelatedItems")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/listRelatedItems")
.header("content-type", "application/json")
.body("{\n \"incidentRecordArn\": \"\",\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
incidentRecordArn: '',
maxResults: 0,
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}}/listRelatedItems');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/listRelatedItems',
headers: {'content-type': 'application/json'},
data: {incidentRecordArn: '', maxResults: 0, nextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/listRelatedItems';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"incidentRecordArn":"","maxResults":0,"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}}/listRelatedItems',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "incidentRecordArn": "",\n "maxResults": 0,\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 \"incidentRecordArn\": \"\",\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/listRelatedItems")
.post(body)
.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/listRelatedItems',
headers: {
'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({incidentRecordArn: '', maxResults: 0, nextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/listRelatedItems',
headers: {'content-type': 'application/json'},
body: {incidentRecordArn: '', maxResults: 0, 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}}/listRelatedItems');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
incidentRecordArn: '',
maxResults: 0,
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}}/listRelatedItems',
headers: {'content-type': 'application/json'},
data: {incidentRecordArn: '', maxResults: 0, nextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/listRelatedItems';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"incidentRecordArn":"","maxResults":0,"nextToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"incidentRecordArn": @"",
@"maxResults": @0,
@"nextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/listRelatedItems"]
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}}/listRelatedItems" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"incidentRecordArn\": \"\",\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/listRelatedItems",
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([
'incidentRecordArn' => '',
'maxResults' => 0,
'nextToken' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/listRelatedItems', [
'body' => '{
"incidentRecordArn": "",
"maxResults": 0,
"nextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/listRelatedItems');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'incidentRecordArn' => '',
'maxResults' => 0,
'nextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'incidentRecordArn' => '',
'maxResults' => 0,
'nextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/listRelatedItems');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/listRelatedItems' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"incidentRecordArn": "",
"maxResults": 0,
"nextToken": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/listRelatedItems' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"incidentRecordArn": "",
"maxResults": 0,
"nextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"incidentRecordArn\": \"\",\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/listRelatedItems", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/listRelatedItems"
payload = {
"incidentRecordArn": "",
"maxResults": 0,
"nextToken": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/listRelatedItems"
payload <- "{\n \"incidentRecordArn\": \"\",\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/listRelatedItems")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"incidentRecordArn\": \"\",\n \"maxResults\": 0,\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/listRelatedItems') do |req|
req.body = "{\n \"incidentRecordArn\": \"\",\n \"maxResults\": 0,\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}}/listRelatedItems";
let payload = json!({
"incidentRecordArn": "",
"maxResults": 0,
"nextToken": ""
});
let mut headers = reqwest::header::HeaderMap::new();
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}}/listRelatedItems \
--header 'content-type: application/json' \
--data '{
"incidentRecordArn": "",
"maxResults": 0,
"nextToken": ""
}'
echo '{
"incidentRecordArn": "",
"maxResults": 0,
"nextToken": ""
}' | \
http POST {{baseUrl}}/listRelatedItems \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "incidentRecordArn": "",\n "maxResults": 0,\n "nextToken": ""\n}' \
--output-document \
- {{baseUrl}}/listRelatedItems
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"incidentRecordArn": "",
"maxResults": 0,
"nextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/listRelatedItems")! 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
ListReplicationSets
{{baseUrl}}/listReplicationSets
BODY json
{
"maxResults": 0,
"nextToken": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/listReplicationSets");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/listReplicationSets" {:content-type :json
:form-params {:maxResults 0
:nextToken ""}})
require "http/client"
url = "{{baseUrl}}/listReplicationSets"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"maxResults\": 0,\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}}/listReplicationSets"),
Content = new StringContent("{\n \"maxResults\": 0,\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}}/listReplicationSets");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/listReplicationSets"
payload := strings.NewReader("{\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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/listReplicationSets HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 40
{
"maxResults": 0,
"nextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/listReplicationSets")
.setHeader("content-type", "application/json")
.setBody("{\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/listReplicationSets"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"maxResults\": 0,\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\": 0,\n \"nextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/listReplicationSets")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/listReplicationSets")
.header("content-type", "application/json")
.body("{\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
maxResults: 0,
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}}/listReplicationSets');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/listReplicationSets',
headers: {'content-type': 'application/json'},
data: {maxResults: 0, nextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/listReplicationSets';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"maxResults":0,"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}}/listReplicationSets',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "maxResults": 0,\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\": 0,\n \"nextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/listReplicationSets")
.post(body)
.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/listReplicationSets',
headers: {
'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: 0, nextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/listReplicationSets',
headers: {'content-type': 'application/json'},
body: {maxResults: 0, 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}}/listReplicationSets');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
maxResults: 0,
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}}/listReplicationSets',
headers: {'content-type': 'application/json'},
data: {maxResults: 0, nextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/listReplicationSets';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"maxResults":0,"nextToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"maxResults": @0,
@"nextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/listReplicationSets"]
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}}/listReplicationSets" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/listReplicationSets",
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' => 0,
'nextToken' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/listReplicationSets', [
'body' => '{
"maxResults": 0,
"nextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/listReplicationSets');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'maxResults' => 0,
'nextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'maxResults' => 0,
'nextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/listReplicationSets');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/listReplicationSets' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"maxResults": 0,
"nextToken": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/listReplicationSets' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"maxResults": 0,
"nextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/listReplicationSets", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/listReplicationSets"
payload = {
"maxResults": 0,
"nextToken": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/listReplicationSets"
payload <- "{\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/listReplicationSets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"maxResults\": 0,\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/listReplicationSets') do |req|
req.body = "{\n \"maxResults\": 0,\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}}/listReplicationSets";
let payload = json!({
"maxResults": 0,
"nextToken": ""
});
let mut headers = reqwest::header::HeaderMap::new();
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}}/listReplicationSets \
--header 'content-type: application/json' \
--data '{
"maxResults": 0,
"nextToken": ""
}'
echo '{
"maxResults": 0,
"nextToken": ""
}' | \
http POST {{baseUrl}}/listReplicationSets \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "maxResults": 0,\n "nextToken": ""\n}' \
--output-document \
- {{baseUrl}}/listReplicationSets
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"maxResults": 0,
"nextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/listReplicationSets")! 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
ListResponsePlans
{{baseUrl}}/listResponsePlans
BODY json
{
"maxResults": 0,
"nextToken": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/listResponsePlans");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/listResponsePlans" {:content-type :json
:form-params {:maxResults 0
:nextToken ""}})
require "http/client"
url = "{{baseUrl}}/listResponsePlans"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"maxResults\": 0,\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}}/listResponsePlans"),
Content = new StringContent("{\n \"maxResults\": 0,\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}}/listResponsePlans");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/listResponsePlans"
payload := strings.NewReader("{\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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/listResponsePlans HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 40
{
"maxResults": 0,
"nextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/listResponsePlans")
.setHeader("content-type", "application/json")
.setBody("{\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/listResponsePlans"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"maxResults\": 0,\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\": 0,\n \"nextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/listResponsePlans")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/listResponsePlans")
.header("content-type", "application/json")
.body("{\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
maxResults: 0,
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}}/listResponsePlans');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/listResponsePlans',
headers: {'content-type': 'application/json'},
data: {maxResults: 0, nextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/listResponsePlans';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"maxResults":0,"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}}/listResponsePlans',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "maxResults": 0,\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\": 0,\n \"nextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/listResponsePlans")
.post(body)
.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/listResponsePlans',
headers: {
'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: 0, nextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/listResponsePlans',
headers: {'content-type': 'application/json'},
body: {maxResults: 0, 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}}/listResponsePlans');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
maxResults: 0,
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}}/listResponsePlans',
headers: {'content-type': 'application/json'},
data: {maxResults: 0, nextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/listResponsePlans';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"maxResults":0,"nextToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"maxResults": @0,
@"nextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/listResponsePlans"]
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}}/listResponsePlans" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/listResponsePlans",
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' => 0,
'nextToken' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/listResponsePlans', [
'body' => '{
"maxResults": 0,
"nextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/listResponsePlans');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'maxResults' => 0,
'nextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'maxResults' => 0,
'nextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/listResponsePlans');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/listResponsePlans' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"maxResults": 0,
"nextToken": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/listResponsePlans' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"maxResults": 0,
"nextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/listResponsePlans", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/listResponsePlans"
payload = {
"maxResults": 0,
"nextToken": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/listResponsePlans"
payload <- "{\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/listResponsePlans")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"maxResults\": 0,\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/listResponsePlans') do |req|
req.body = "{\n \"maxResults\": 0,\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}}/listResponsePlans";
let payload = json!({
"maxResults": 0,
"nextToken": ""
});
let mut headers = reqwest::header::HeaderMap::new();
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}}/listResponsePlans \
--header 'content-type: application/json' \
--data '{
"maxResults": 0,
"nextToken": ""
}'
echo '{
"maxResults": 0,
"nextToken": ""
}' | \
http POST {{baseUrl}}/listResponsePlans \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "maxResults": 0,\n "nextToken": ""\n}' \
--output-document \
- {{baseUrl}}/listResponsePlans
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"maxResults": 0,
"nextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/listResponsePlans")! 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()
GET
ListTagsForResource
{{baseUrl}}/tags/:resourceArn
QUERY PARAMS
resourceArn
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/tags/:resourceArn");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/tags/:resourceArn")
require "http/client"
url = "{{baseUrl}}/tags/:resourceArn"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/tags/:resourceArn"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/tags/:resourceArn");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/tags/:resourceArn"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/tags/:resourceArn HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/tags/:resourceArn")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/tags/:resourceArn"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/tags/:resourceArn")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/tags/:resourceArn")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/tags/:resourceArn');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/tags/:resourceArn'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/tags/:resourceArn';
const options = {method: 'GET'};
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}}/tags/:resourceArn',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/tags/:resourceArn")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/tags/:resourceArn',
headers: {}
};
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.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/tags/:resourceArn'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/tags/:resourceArn');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/tags/:resourceArn'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/tags/:resourceArn';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/tags/:resourceArn"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/tags/:resourceArn" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/tags/:resourceArn",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/tags/:resourceArn');
echo $response->getBody();
setUrl('{{baseUrl}}/tags/:resourceArn');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/tags/:resourceArn');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/tags/:resourceArn' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/tags/:resourceArn' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/tags/:resourceArn")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/tags/:resourceArn"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/tags/:resourceArn"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/tags/:resourceArn")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/tags/:resourceArn') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/tags/:resourceArn";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/tags/:resourceArn
http GET {{baseUrl}}/tags/:resourceArn
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/tags/:resourceArn
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/tags/:resourceArn")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
ListTimelineEvents
{{baseUrl}}/listTimelineEvents
BODY json
{
"filters": [
{
"condition": "",
"key": ""
}
],
"incidentRecordArn": "",
"maxResults": 0,
"nextToken": "",
"sortBy": "",
"sortOrder": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/listTimelineEvents");
struct curl_slist *headers = NULL;
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 {\n \"condition\": \"\",\n \"key\": \"\"\n }\n ],\n \"incidentRecordArn\": \"\",\n \"maxResults\": 0,\n \"nextToken\": \"\",\n \"sortBy\": \"\",\n \"sortOrder\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/listTimelineEvents" {:content-type :json
:form-params {:filters [{:condition ""
:key ""}]
:incidentRecordArn ""
:maxResults 0
:nextToken ""
:sortBy ""
:sortOrder ""}})
require "http/client"
url = "{{baseUrl}}/listTimelineEvents"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"filters\": [\n {\n \"condition\": \"\",\n \"key\": \"\"\n }\n ],\n \"incidentRecordArn\": \"\",\n \"maxResults\": 0,\n \"nextToken\": \"\",\n \"sortBy\": \"\",\n \"sortOrder\": \"\"\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}}/listTimelineEvents"),
Content = new StringContent("{\n \"filters\": [\n {\n \"condition\": \"\",\n \"key\": \"\"\n }\n ],\n \"incidentRecordArn\": \"\",\n \"maxResults\": 0,\n \"nextToken\": \"\",\n \"sortBy\": \"\",\n \"sortOrder\": \"\"\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}}/listTimelineEvents");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"filters\": [\n {\n \"condition\": \"\",\n \"key\": \"\"\n }\n ],\n \"incidentRecordArn\": \"\",\n \"maxResults\": 0,\n \"nextToken\": \"\",\n \"sortBy\": \"\",\n \"sortOrder\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/listTimelineEvents"
payload := strings.NewReader("{\n \"filters\": [\n {\n \"condition\": \"\",\n \"key\": \"\"\n }\n ],\n \"incidentRecordArn\": \"\",\n \"maxResults\": 0,\n \"nextToken\": \"\",\n \"sortBy\": \"\",\n \"sortOrder\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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/listTimelineEvents HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 173
{
"filters": [
{
"condition": "",
"key": ""
}
],
"incidentRecordArn": "",
"maxResults": 0,
"nextToken": "",
"sortBy": "",
"sortOrder": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/listTimelineEvents")
.setHeader("content-type", "application/json")
.setBody("{\n \"filters\": [\n {\n \"condition\": \"\",\n \"key\": \"\"\n }\n ],\n \"incidentRecordArn\": \"\",\n \"maxResults\": 0,\n \"nextToken\": \"\",\n \"sortBy\": \"\",\n \"sortOrder\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/listTimelineEvents"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"filters\": [\n {\n \"condition\": \"\",\n \"key\": \"\"\n }\n ],\n \"incidentRecordArn\": \"\",\n \"maxResults\": 0,\n \"nextToken\": \"\",\n \"sortBy\": \"\",\n \"sortOrder\": \"\"\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 {\n \"condition\": \"\",\n \"key\": \"\"\n }\n ],\n \"incidentRecordArn\": \"\",\n \"maxResults\": 0,\n \"nextToken\": \"\",\n \"sortBy\": \"\",\n \"sortOrder\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/listTimelineEvents")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/listTimelineEvents")
.header("content-type", "application/json")
.body("{\n \"filters\": [\n {\n \"condition\": \"\",\n \"key\": \"\"\n }\n ],\n \"incidentRecordArn\": \"\",\n \"maxResults\": 0,\n \"nextToken\": \"\",\n \"sortBy\": \"\",\n \"sortOrder\": \"\"\n}")
.asString();
const data = JSON.stringify({
filters: [
{
condition: '',
key: ''
}
],
incidentRecordArn: '',
maxResults: 0,
nextToken: '',
sortBy: '',
sortOrder: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/listTimelineEvents');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/listTimelineEvents',
headers: {'content-type': 'application/json'},
data: {
filters: [{condition: '', key: ''}],
incidentRecordArn: '',
maxResults: 0,
nextToken: '',
sortBy: '',
sortOrder: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/listTimelineEvents';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"filters":[{"condition":"","key":""}],"incidentRecordArn":"","maxResults":0,"nextToken":"","sortBy":"","sortOrder":""}'
};
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}}/listTimelineEvents',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "filters": [\n {\n "condition": "",\n "key": ""\n }\n ],\n "incidentRecordArn": "",\n "maxResults": 0,\n "nextToken": "",\n "sortBy": "",\n "sortOrder": ""\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 {\n \"condition\": \"\",\n \"key\": \"\"\n }\n ],\n \"incidentRecordArn\": \"\",\n \"maxResults\": 0,\n \"nextToken\": \"\",\n \"sortBy\": \"\",\n \"sortOrder\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/listTimelineEvents")
.post(body)
.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/listTimelineEvents',
headers: {
'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: [{condition: '', key: ''}],
incidentRecordArn: '',
maxResults: 0,
nextToken: '',
sortBy: '',
sortOrder: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/listTimelineEvents',
headers: {'content-type': 'application/json'},
body: {
filters: [{condition: '', key: ''}],
incidentRecordArn: '',
maxResults: 0,
nextToken: '',
sortBy: '',
sortOrder: ''
},
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}}/listTimelineEvents');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
filters: [
{
condition: '',
key: ''
}
],
incidentRecordArn: '',
maxResults: 0,
nextToken: '',
sortBy: '',
sortOrder: ''
});
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}}/listTimelineEvents',
headers: {'content-type': 'application/json'},
data: {
filters: [{condition: '', key: ''}],
incidentRecordArn: '',
maxResults: 0,
nextToken: '',
sortBy: '',
sortOrder: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/listTimelineEvents';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"filters":[{"condition":"","key":""}],"incidentRecordArn":"","maxResults":0,"nextToken":"","sortBy":"","sortOrder":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"filters": @[ @{ @"condition": @"", @"key": @"" } ],
@"incidentRecordArn": @"",
@"maxResults": @0,
@"nextToken": @"",
@"sortBy": @"",
@"sortOrder": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/listTimelineEvents"]
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}}/listTimelineEvents" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"filters\": [\n {\n \"condition\": \"\",\n \"key\": \"\"\n }\n ],\n \"incidentRecordArn\": \"\",\n \"maxResults\": 0,\n \"nextToken\": \"\",\n \"sortBy\": \"\",\n \"sortOrder\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/listTimelineEvents",
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' => [
[
'condition' => '',
'key' => ''
]
],
'incidentRecordArn' => '',
'maxResults' => 0,
'nextToken' => '',
'sortBy' => '',
'sortOrder' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/listTimelineEvents', [
'body' => '{
"filters": [
{
"condition": "",
"key": ""
}
],
"incidentRecordArn": "",
"maxResults": 0,
"nextToken": "",
"sortBy": "",
"sortOrder": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/listTimelineEvents');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'filters' => [
[
'condition' => '',
'key' => ''
]
],
'incidentRecordArn' => '',
'maxResults' => 0,
'nextToken' => '',
'sortBy' => '',
'sortOrder' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'filters' => [
[
'condition' => '',
'key' => ''
]
],
'incidentRecordArn' => '',
'maxResults' => 0,
'nextToken' => '',
'sortBy' => '',
'sortOrder' => ''
]));
$request->setRequestUrl('{{baseUrl}}/listTimelineEvents');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/listTimelineEvents' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"filters": [
{
"condition": "",
"key": ""
}
],
"incidentRecordArn": "",
"maxResults": 0,
"nextToken": "",
"sortBy": "",
"sortOrder": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/listTimelineEvents' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"filters": [
{
"condition": "",
"key": ""
}
],
"incidentRecordArn": "",
"maxResults": 0,
"nextToken": "",
"sortBy": "",
"sortOrder": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"filters\": [\n {\n \"condition\": \"\",\n \"key\": \"\"\n }\n ],\n \"incidentRecordArn\": \"\",\n \"maxResults\": 0,\n \"nextToken\": \"\",\n \"sortBy\": \"\",\n \"sortOrder\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/listTimelineEvents", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/listTimelineEvents"
payload = {
"filters": [
{
"condition": "",
"key": ""
}
],
"incidentRecordArn": "",
"maxResults": 0,
"nextToken": "",
"sortBy": "",
"sortOrder": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/listTimelineEvents"
payload <- "{\n \"filters\": [\n {\n \"condition\": \"\",\n \"key\": \"\"\n }\n ],\n \"incidentRecordArn\": \"\",\n \"maxResults\": 0,\n \"nextToken\": \"\",\n \"sortBy\": \"\",\n \"sortOrder\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/listTimelineEvents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"filters\": [\n {\n \"condition\": \"\",\n \"key\": \"\"\n }\n ],\n \"incidentRecordArn\": \"\",\n \"maxResults\": 0,\n \"nextToken\": \"\",\n \"sortBy\": \"\",\n \"sortOrder\": \"\"\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/listTimelineEvents') do |req|
req.body = "{\n \"filters\": [\n {\n \"condition\": \"\",\n \"key\": \"\"\n }\n ],\n \"incidentRecordArn\": \"\",\n \"maxResults\": 0,\n \"nextToken\": \"\",\n \"sortBy\": \"\",\n \"sortOrder\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/listTimelineEvents";
let payload = json!({
"filters": (
json!({
"condition": "",
"key": ""
})
),
"incidentRecordArn": "",
"maxResults": 0,
"nextToken": "",
"sortBy": "",
"sortOrder": ""
});
let mut headers = reqwest::header::HeaderMap::new();
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}}/listTimelineEvents \
--header 'content-type: application/json' \
--data '{
"filters": [
{
"condition": "",
"key": ""
}
],
"incidentRecordArn": "",
"maxResults": 0,
"nextToken": "",
"sortBy": "",
"sortOrder": ""
}'
echo '{
"filters": [
{
"condition": "",
"key": ""
}
],
"incidentRecordArn": "",
"maxResults": 0,
"nextToken": "",
"sortBy": "",
"sortOrder": ""
}' | \
http POST {{baseUrl}}/listTimelineEvents \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "filters": [\n {\n "condition": "",\n "key": ""\n }\n ],\n "incidentRecordArn": "",\n "maxResults": 0,\n "nextToken": "",\n "sortBy": "",\n "sortOrder": ""\n}' \
--output-document \
- {{baseUrl}}/listTimelineEvents
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"filters": [
[
"condition": "",
"key": ""
]
],
"incidentRecordArn": "",
"maxResults": 0,
"nextToken": "",
"sortBy": "",
"sortOrder": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/listTimelineEvents")! 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}}/putResourcePolicy
BODY json
{
"policy": "",
"resourceArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/putResourcePolicy");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"policy\": \"\",\n \"resourceArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/putResourcePolicy" {:content-type :json
:form-params {:policy ""
:resourceArn ""}})
require "http/client"
url = "{{baseUrl}}/putResourcePolicy"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"policy\": \"\",\n \"resourceArn\": \"\"\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}}/putResourcePolicy"),
Content = new StringContent("{\n \"policy\": \"\",\n \"resourceArn\": \"\"\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}}/putResourcePolicy");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"policy\": \"\",\n \"resourceArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/putResourcePolicy"
payload := strings.NewReader("{\n \"policy\": \"\",\n \"resourceArn\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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/putResourcePolicy HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 39
{
"policy": "",
"resourceArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/putResourcePolicy")
.setHeader("content-type", "application/json")
.setBody("{\n \"policy\": \"\",\n \"resourceArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/putResourcePolicy"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"policy\": \"\",\n \"resourceArn\": \"\"\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 \"policy\": \"\",\n \"resourceArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/putResourcePolicy")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/putResourcePolicy")
.header("content-type", "application/json")
.body("{\n \"policy\": \"\",\n \"resourceArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
policy: '',
resourceArn: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/putResourcePolicy');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/putResourcePolicy',
headers: {'content-type': 'application/json'},
data: {policy: '', resourceArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/putResourcePolicy';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"policy":"","resourceArn":""}'
};
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}}/putResourcePolicy',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "policy": "",\n "resourceArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"policy\": \"\",\n \"resourceArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/putResourcePolicy")
.post(body)
.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/putResourcePolicy',
headers: {
'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({policy: '', resourceArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/putResourcePolicy',
headers: {'content-type': 'application/json'},
body: {policy: '', resourceArn: ''},
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}}/putResourcePolicy');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
policy: '',
resourceArn: ''
});
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}}/putResourcePolicy',
headers: {'content-type': 'application/json'},
data: {policy: '', resourceArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/putResourcePolicy';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"policy":"","resourceArn":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"policy": @"",
@"resourceArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/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}}/putResourcePolicy" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"policy\": \"\",\n \"resourceArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/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([
'policy' => '',
'resourceArn' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/putResourcePolicy', [
'body' => '{
"policy": "",
"resourceArn": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/putResourcePolicy');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'policy' => '',
'resourceArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'policy' => '',
'resourceArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/putResourcePolicy');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/putResourcePolicy' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"policy": "",
"resourceArn": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/putResourcePolicy' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"policy": "",
"resourceArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"policy\": \"\",\n \"resourceArn\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/putResourcePolicy", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/putResourcePolicy"
payload = {
"policy": "",
"resourceArn": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/putResourcePolicy"
payload <- "{\n \"policy\": \"\",\n \"resourceArn\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/putResourcePolicy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"policy\": \"\",\n \"resourceArn\": \"\"\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/putResourcePolicy') do |req|
req.body = "{\n \"policy\": \"\",\n \"resourceArn\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/putResourcePolicy";
let payload = json!({
"policy": "",
"resourceArn": ""
});
let mut headers = reqwest::header::HeaderMap::new();
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}}/putResourcePolicy \
--header 'content-type: application/json' \
--data '{
"policy": "",
"resourceArn": ""
}'
echo '{
"policy": "",
"resourceArn": ""
}' | \
http POST {{baseUrl}}/putResourcePolicy \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "policy": "",\n "resourceArn": ""\n}' \
--output-document \
- {{baseUrl}}/putResourcePolicy
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"policy": "",
"resourceArn": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/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
StartIncident
{{baseUrl}}/startIncident
BODY json
{
"clientToken": "",
"impact": 0,
"relatedItems": [
{
"generatedId": "",
"identifier": "",
"title": ""
}
],
"responsePlanArn": "",
"title": "",
"triggerDetails": {
"rawData": "",
"source": "",
"timestamp": "",
"triggerArn": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/startIncident");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"clientToken\": \"\",\n \"impact\": 0,\n \"relatedItems\": [\n {\n \"generatedId\": \"\",\n \"identifier\": \"\",\n \"title\": \"\"\n }\n ],\n \"responsePlanArn\": \"\",\n \"title\": \"\",\n \"triggerDetails\": {\n \"rawData\": \"\",\n \"source\": \"\",\n \"timestamp\": \"\",\n \"triggerArn\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/startIncident" {:content-type :json
:form-params {:clientToken ""
:impact 0
:relatedItems [{:generatedId ""
:identifier ""
:title ""}]
:responsePlanArn ""
:title ""
:triggerDetails {:rawData ""
:source ""
:timestamp ""
:triggerArn ""}}})
require "http/client"
url = "{{baseUrl}}/startIncident"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"clientToken\": \"\",\n \"impact\": 0,\n \"relatedItems\": [\n {\n \"generatedId\": \"\",\n \"identifier\": \"\",\n \"title\": \"\"\n }\n ],\n \"responsePlanArn\": \"\",\n \"title\": \"\",\n \"triggerDetails\": {\n \"rawData\": \"\",\n \"source\": \"\",\n \"timestamp\": \"\",\n \"triggerArn\": \"\"\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}}/startIncident"),
Content = new StringContent("{\n \"clientToken\": \"\",\n \"impact\": 0,\n \"relatedItems\": [\n {\n \"generatedId\": \"\",\n \"identifier\": \"\",\n \"title\": \"\"\n }\n ],\n \"responsePlanArn\": \"\",\n \"title\": \"\",\n \"triggerDetails\": {\n \"rawData\": \"\",\n \"source\": \"\",\n \"timestamp\": \"\",\n \"triggerArn\": \"\"\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}}/startIncident");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"clientToken\": \"\",\n \"impact\": 0,\n \"relatedItems\": [\n {\n \"generatedId\": \"\",\n \"identifier\": \"\",\n \"title\": \"\"\n }\n ],\n \"responsePlanArn\": \"\",\n \"title\": \"\",\n \"triggerDetails\": {\n \"rawData\": \"\",\n \"source\": \"\",\n \"timestamp\": \"\",\n \"triggerArn\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/startIncident"
payload := strings.NewReader("{\n \"clientToken\": \"\",\n \"impact\": 0,\n \"relatedItems\": [\n {\n \"generatedId\": \"\",\n \"identifier\": \"\",\n \"title\": \"\"\n }\n ],\n \"responsePlanArn\": \"\",\n \"title\": \"\",\n \"triggerDetails\": {\n \"rawData\": \"\",\n \"source\": \"\",\n \"timestamp\": \"\",\n \"triggerArn\": \"\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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/startIncident HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 288
{
"clientToken": "",
"impact": 0,
"relatedItems": [
{
"generatedId": "",
"identifier": "",
"title": ""
}
],
"responsePlanArn": "",
"title": "",
"triggerDetails": {
"rawData": "",
"source": "",
"timestamp": "",
"triggerArn": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/startIncident")
.setHeader("content-type", "application/json")
.setBody("{\n \"clientToken\": \"\",\n \"impact\": 0,\n \"relatedItems\": [\n {\n \"generatedId\": \"\",\n \"identifier\": \"\",\n \"title\": \"\"\n }\n ],\n \"responsePlanArn\": \"\",\n \"title\": \"\",\n \"triggerDetails\": {\n \"rawData\": \"\",\n \"source\": \"\",\n \"timestamp\": \"\",\n \"triggerArn\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/startIncident"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"clientToken\": \"\",\n \"impact\": 0,\n \"relatedItems\": [\n {\n \"generatedId\": \"\",\n \"identifier\": \"\",\n \"title\": \"\"\n }\n ],\n \"responsePlanArn\": \"\",\n \"title\": \"\",\n \"triggerDetails\": {\n \"rawData\": \"\",\n \"source\": \"\",\n \"timestamp\": \"\",\n \"triggerArn\": \"\"\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 \"clientToken\": \"\",\n \"impact\": 0,\n \"relatedItems\": [\n {\n \"generatedId\": \"\",\n \"identifier\": \"\",\n \"title\": \"\"\n }\n ],\n \"responsePlanArn\": \"\",\n \"title\": \"\",\n \"triggerDetails\": {\n \"rawData\": \"\",\n \"source\": \"\",\n \"timestamp\": \"\",\n \"triggerArn\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/startIncident")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/startIncident")
.header("content-type", "application/json")
.body("{\n \"clientToken\": \"\",\n \"impact\": 0,\n \"relatedItems\": [\n {\n \"generatedId\": \"\",\n \"identifier\": \"\",\n \"title\": \"\"\n }\n ],\n \"responsePlanArn\": \"\",\n \"title\": \"\",\n \"triggerDetails\": {\n \"rawData\": \"\",\n \"source\": \"\",\n \"timestamp\": \"\",\n \"triggerArn\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
clientToken: '',
impact: 0,
relatedItems: [
{
generatedId: '',
identifier: '',
title: ''
}
],
responsePlanArn: '',
title: '',
triggerDetails: {
rawData: '',
source: '',
timestamp: '',
triggerArn: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/startIncident');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/startIncident',
headers: {'content-type': 'application/json'},
data: {
clientToken: '',
impact: 0,
relatedItems: [{generatedId: '', identifier: '', title: ''}],
responsePlanArn: '',
title: '',
triggerDetails: {rawData: '', source: '', timestamp: '', triggerArn: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/startIncident';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"clientToken":"","impact":0,"relatedItems":[{"generatedId":"","identifier":"","title":""}],"responsePlanArn":"","title":"","triggerDetails":{"rawData":"","source":"","timestamp":"","triggerArn":""}}'
};
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}}/startIncident',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "clientToken": "",\n "impact": 0,\n "relatedItems": [\n {\n "generatedId": "",\n "identifier": "",\n "title": ""\n }\n ],\n "responsePlanArn": "",\n "title": "",\n "triggerDetails": {\n "rawData": "",\n "source": "",\n "timestamp": "",\n "triggerArn": ""\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 \"clientToken\": \"\",\n \"impact\": 0,\n \"relatedItems\": [\n {\n \"generatedId\": \"\",\n \"identifier\": \"\",\n \"title\": \"\"\n }\n ],\n \"responsePlanArn\": \"\",\n \"title\": \"\",\n \"triggerDetails\": {\n \"rawData\": \"\",\n \"source\": \"\",\n \"timestamp\": \"\",\n \"triggerArn\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/startIncident")
.post(body)
.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/startIncident',
headers: {
'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({
clientToken: '',
impact: 0,
relatedItems: [{generatedId: '', identifier: '', title: ''}],
responsePlanArn: '',
title: '',
triggerDetails: {rawData: '', source: '', timestamp: '', triggerArn: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/startIncident',
headers: {'content-type': 'application/json'},
body: {
clientToken: '',
impact: 0,
relatedItems: [{generatedId: '', identifier: '', title: ''}],
responsePlanArn: '',
title: '',
triggerDetails: {rawData: '', source: '', timestamp: '', triggerArn: ''}
},
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}}/startIncident');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
clientToken: '',
impact: 0,
relatedItems: [
{
generatedId: '',
identifier: '',
title: ''
}
],
responsePlanArn: '',
title: '',
triggerDetails: {
rawData: '',
source: '',
timestamp: '',
triggerArn: ''
}
});
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}}/startIncident',
headers: {'content-type': 'application/json'},
data: {
clientToken: '',
impact: 0,
relatedItems: [{generatedId: '', identifier: '', title: ''}],
responsePlanArn: '',
title: '',
triggerDetails: {rawData: '', source: '', timestamp: '', triggerArn: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/startIncident';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"clientToken":"","impact":0,"relatedItems":[{"generatedId":"","identifier":"","title":""}],"responsePlanArn":"","title":"","triggerDetails":{"rawData":"","source":"","timestamp":"","triggerArn":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"clientToken": @"",
@"impact": @0,
@"relatedItems": @[ @{ @"generatedId": @"", @"identifier": @"", @"title": @"" } ],
@"responsePlanArn": @"",
@"title": @"",
@"triggerDetails": @{ @"rawData": @"", @"source": @"", @"timestamp": @"", @"triggerArn": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/startIncident"]
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}}/startIncident" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"clientToken\": \"\",\n \"impact\": 0,\n \"relatedItems\": [\n {\n \"generatedId\": \"\",\n \"identifier\": \"\",\n \"title\": \"\"\n }\n ],\n \"responsePlanArn\": \"\",\n \"title\": \"\",\n \"triggerDetails\": {\n \"rawData\": \"\",\n \"source\": \"\",\n \"timestamp\": \"\",\n \"triggerArn\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/startIncident",
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([
'clientToken' => '',
'impact' => 0,
'relatedItems' => [
[
'generatedId' => '',
'identifier' => '',
'title' => ''
]
],
'responsePlanArn' => '',
'title' => '',
'triggerDetails' => [
'rawData' => '',
'source' => '',
'timestamp' => '',
'triggerArn' => ''
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/startIncident', [
'body' => '{
"clientToken": "",
"impact": 0,
"relatedItems": [
{
"generatedId": "",
"identifier": "",
"title": ""
}
],
"responsePlanArn": "",
"title": "",
"triggerDetails": {
"rawData": "",
"source": "",
"timestamp": "",
"triggerArn": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/startIncident');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'clientToken' => '',
'impact' => 0,
'relatedItems' => [
[
'generatedId' => '',
'identifier' => '',
'title' => ''
]
],
'responsePlanArn' => '',
'title' => '',
'triggerDetails' => [
'rawData' => '',
'source' => '',
'timestamp' => '',
'triggerArn' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'clientToken' => '',
'impact' => 0,
'relatedItems' => [
[
'generatedId' => '',
'identifier' => '',
'title' => ''
]
],
'responsePlanArn' => '',
'title' => '',
'triggerDetails' => [
'rawData' => '',
'source' => '',
'timestamp' => '',
'triggerArn' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/startIncident');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/startIncident' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"clientToken": "",
"impact": 0,
"relatedItems": [
{
"generatedId": "",
"identifier": "",
"title": ""
}
],
"responsePlanArn": "",
"title": "",
"triggerDetails": {
"rawData": "",
"source": "",
"timestamp": "",
"triggerArn": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/startIncident' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"clientToken": "",
"impact": 0,
"relatedItems": [
{
"generatedId": "",
"identifier": "",
"title": ""
}
],
"responsePlanArn": "",
"title": "",
"triggerDetails": {
"rawData": "",
"source": "",
"timestamp": "",
"triggerArn": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"clientToken\": \"\",\n \"impact\": 0,\n \"relatedItems\": [\n {\n \"generatedId\": \"\",\n \"identifier\": \"\",\n \"title\": \"\"\n }\n ],\n \"responsePlanArn\": \"\",\n \"title\": \"\",\n \"triggerDetails\": {\n \"rawData\": \"\",\n \"source\": \"\",\n \"timestamp\": \"\",\n \"triggerArn\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/startIncident", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/startIncident"
payload = {
"clientToken": "",
"impact": 0,
"relatedItems": [
{
"generatedId": "",
"identifier": "",
"title": ""
}
],
"responsePlanArn": "",
"title": "",
"triggerDetails": {
"rawData": "",
"source": "",
"timestamp": "",
"triggerArn": ""
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/startIncident"
payload <- "{\n \"clientToken\": \"\",\n \"impact\": 0,\n \"relatedItems\": [\n {\n \"generatedId\": \"\",\n \"identifier\": \"\",\n \"title\": \"\"\n }\n ],\n \"responsePlanArn\": \"\",\n \"title\": \"\",\n \"triggerDetails\": {\n \"rawData\": \"\",\n \"source\": \"\",\n \"timestamp\": \"\",\n \"triggerArn\": \"\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/startIncident")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"clientToken\": \"\",\n \"impact\": 0,\n \"relatedItems\": [\n {\n \"generatedId\": \"\",\n \"identifier\": \"\",\n \"title\": \"\"\n }\n ],\n \"responsePlanArn\": \"\",\n \"title\": \"\",\n \"triggerDetails\": {\n \"rawData\": \"\",\n \"source\": \"\",\n \"timestamp\": \"\",\n \"triggerArn\": \"\"\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/startIncident') do |req|
req.body = "{\n \"clientToken\": \"\",\n \"impact\": 0,\n \"relatedItems\": [\n {\n \"generatedId\": \"\",\n \"identifier\": \"\",\n \"title\": \"\"\n }\n ],\n \"responsePlanArn\": \"\",\n \"title\": \"\",\n \"triggerDetails\": {\n \"rawData\": \"\",\n \"source\": \"\",\n \"timestamp\": \"\",\n \"triggerArn\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/startIncident";
let payload = json!({
"clientToken": "",
"impact": 0,
"relatedItems": (
json!({
"generatedId": "",
"identifier": "",
"title": ""
})
),
"responsePlanArn": "",
"title": "",
"triggerDetails": json!({
"rawData": "",
"source": "",
"timestamp": "",
"triggerArn": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
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}}/startIncident \
--header 'content-type: application/json' \
--data '{
"clientToken": "",
"impact": 0,
"relatedItems": [
{
"generatedId": "",
"identifier": "",
"title": ""
}
],
"responsePlanArn": "",
"title": "",
"triggerDetails": {
"rawData": "",
"source": "",
"timestamp": "",
"triggerArn": ""
}
}'
echo '{
"clientToken": "",
"impact": 0,
"relatedItems": [
{
"generatedId": "",
"identifier": "",
"title": ""
}
],
"responsePlanArn": "",
"title": "",
"triggerDetails": {
"rawData": "",
"source": "",
"timestamp": "",
"triggerArn": ""
}
}' | \
http POST {{baseUrl}}/startIncident \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "clientToken": "",\n "impact": 0,\n "relatedItems": [\n {\n "generatedId": "",\n "identifier": "",\n "title": ""\n }\n ],\n "responsePlanArn": "",\n "title": "",\n "triggerDetails": {\n "rawData": "",\n "source": "",\n "timestamp": "",\n "triggerArn": ""\n }\n}' \
--output-document \
- {{baseUrl}}/startIncident
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"clientToken": "",
"impact": 0,
"relatedItems": [
[
"generatedId": "",
"identifier": "",
"title": ""
]
],
"responsePlanArn": "",
"title": "",
"triggerDetails": [
"rawData": "",
"source": "",
"timestamp": "",
"triggerArn": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/startIncident")! 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
TagResource
{{baseUrl}}/tags/:resourceArn
QUERY PARAMS
resourceArn
BODY json
{
"tags": {}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/tags/:resourceArn");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"tags\": {}\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/tags/:resourceArn" {:content-type :json
:form-params {:tags {}}})
require "http/client"
url = "{{baseUrl}}/tags/:resourceArn"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\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}}/tags/:resourceArn"),
Content = new StringContent("{\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}}/tags/:resourceArn");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"tags\": {}\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/tags/:resourceArn"
payload := strings.NewReader("{\n \"tags\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
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/tags/:resourceArn HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 16
{
"tags": {}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/tags/:resourceArn")
.setHeader("content-type", "application/json")
.setBody("{\n \"tags\": {}\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/tags/:resourceArn"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\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 \"tags\": {}\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/tags/:resourceArn")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/tags/:resourceArn")
.header("content-type", "application/json")
.body("{\n \"tags\": {}\n}")
.asString();
const data = JSON.stringify({
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}}/tags/:resourceArn');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/tags/:resourceArn',
headers: {'content-type': 'application/json'},
data: {tags: {}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/tags/:resourceArn';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"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}}/tags/:resourceArn',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\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 \"tags\": {}\n}")
val request = Request.Builder()
.url("{{baseUrl}}/tags/:resourceArn")
.post(body)
.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/tags/:resourceArn',
headers: {
'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({tags: {}}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/tags/:resourceArn',
headers: {'content-type': 'application/json'},
body: {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}}/tags/:resourceArn');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
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}}/tags/:resourceArn',
headers: {'content-type': 'application/json'},
data: {tags: {}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/tags/:resourceArn';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"tags":{}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"tags": @{ } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/tags/:resourceArn"]
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}}/tags/:resourceArn" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"tags\": {}\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/tags/:resourceArn",
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([
'tags' => [
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/tags/:resourceArn', [
'body' => '{
"tags": {}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/tags/:resourceArn');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'tags' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'tags' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/tags/:resourceArn');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/tags/:resourceArn' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"tags": {}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/tags/:resourceArn' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"tags": {}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"tags\": {}\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/tags/:resourceArn", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/tags/:resourceArn"
payload = { "tags": {} }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/tags/:resourceArn"
payload <- "{\n \"tags\": {}\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/tags/:resourceArn")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\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/tags/:resourceArn') do |req|
req.body = "{\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}}/tags/:resourceArn";
let payload = json!({"tags": json!({})});
let mut headers = reqwest::header::HeaderMap::new();
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}}/tags/:resourceArn \
--header 'content-type: application/json' \
--data '{
"tags": {}
}'
echo '{
"tags": {}
}' | \
http POST {{baseUrl}}/tags/:resourceArn \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "tags": {}\n}' \
--output-document \
- {{baseUrl}}/tags/:resourceArn
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["tags": []] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/tags/:resourceArn")! 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()
DELETE
UntagResource
{{baseUrl}}/tags/:resourceArn#tagKeys
QUERY PARAMS
tagKeys
resourceArn
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/tags/:resourceArn#tagKeys" {:query-params {:tagKeys ""}})
require "http/client"
url = "{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/tags/:resourceArn?tagKeys= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/tags/:resourceArn#tagKeys',
params: {tagKeys: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys';
const options = {method: 'DELETE'};
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}}/tags/:resourceArn?tagKeys=#tagKeys',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/tags/:resourceArn?tagKeys=',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/tags/:resourceArn#tagKeys',
qs: {tagKeys: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/tags/:resourceArn#tagKeys');
req.query({
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: 'DELETE',
url: '{{baseUrl}}/tags/:resourceArn#tagKeys',
params: {tagKeys: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
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}}/tags/:resourceArn?tagKeys=#tagKeys" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys');
echo $response->getBody();
setUrl('{{baseUrl}}/tags/:resourceArn#tagKeys');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'tagKeys' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/tags/:resourceArn#tagKeys');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'tagKeys' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/tags/:resourceArn?tagKeys=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/tags/:resourceArn#tagKeys"
querystring = {"tagKeys":""}
response = requests.delete(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/tags/:resourceArn#tagKeys"
queryString <- list(tagKeys = "")
response <- VERB("DELETE", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/tags/:resourceArn') do |req|
req.params['tagKeys'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/tags/:resourceArn#tagKeys";
let querystring = [
("tagKeys", ""),
];
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url '{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys'
http DELETE '{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys'
wget --quiet \
--method DELETE \
--output-document \
- '{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys'
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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
UpdateDeletionProtection
{{baseUrl}}/updateDeletionProtection
BODY json
{
"arn": "",
"clientToken": "",
"deletionProtected": false
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/updateDeletionProtection");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"arn\": \"\",\n \"clientToken\": \"\",\n \"deletionProtected\": false\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/updateDeletionProtection" {:content-type :json
:form-params {:arn ""
:clientToken ""
:deletionProtected false}})
require "http/client"
url = "{{baseUrl}}/updateDeletionProtection"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"arn\": \"\",\n \"clientToken\": \"\",\n \"deletionProtected\": false\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}}/updateDeletionProtection"),
Content = new StringContent("{\n \"arn\": \"\",\n \"clientToken\": \"\",\n \"deletionProtected\": false\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}}/updateDeletionProtection");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"arn\": \"\",\n \"clientToken\": \"\",\n \"deletionProtected\": false\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/updateDeletionProtection"
payload := strings.NewReader("{\n \"arn\": \"\",\n \"clientToken\": \"\",\n \"deletionProtected\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
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/updateDeletionProtection HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 66
{
"arn": "",
"clientToken": "",
"deletionProtected": false
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/updateDeletionProtection")
.setHeader("content-type", "application/json")
.setBody("{\n \"arn\": \"\",\n \"clientToken\": \"\",\n \"deletionProtected\": false\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/updateDeletionProtection"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"arn\": \"\",\n \"clientToken\": \"\",\n \"deletionProtected\": false\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 \"arn\": \"\",\n \"clientToken\": \"\",\n \"deletionProtected\": false\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/updateDeletionProtection")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/updateDeletionProtection")
.header("content-type", "application/json")
.body("{\n \"arn\": \"\",\n \"clientToken\": \"\",\n \"deletionProtected\": false\n}")
.asString();
const data = JSON.stringify({
arn: '',
clientToken: '',
deletionProtected: false
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/updateDeletionProtection');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/updateDeletionProtection',
headers: {'content-type': 'application/json'},
data: {arn: '', clientToken: '', deletionProtected: false}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/updateDeletionProtection';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"arn":"","clientToken":"","deletionProtected":false}'
};
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}}/updateDeletionProtection',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "arn": "",\n "clientToken": "",\n "deletionProtected": false\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"arn\": \"\",\n \"clientToken\": \"\",\n \"deletionProtected\": false\n}")
val request = Request.Builder()
.url("{{baseUrl}}/updateDeletionProtection")
.post(body)
.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/updateDeletionProtection',
headers: {
'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({arn: '', clientToken: '', deletionProtected: false}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/updateDeletionProtection',
headers: {'content-type': 'application/json'},
body: {arn: '', clientToken: '', deletionProtected: false},
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}}/updateDeletionProtection');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
arn: '',
clientToken: '',
deletionProtected: false
});
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}}/updateDeletionProtection',
headers: {'content-type': 'application/json'},
data: {arn: '', clientToken: '', deletionProtected: false}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/updateDeletionProtection';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"arn":"","clientToken":"","deletionProtected":false}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"arn": @"",
@"clientToken": @"",
@"deletionProtected": @NO };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/updateDeletionProtection"]
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}}/updateDeletionProtection" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"arn\": \"\",\n \"clientToken\": \"\",\n \"deletionProtected\": false\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/updateDeletionProtection",
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([
'arn' => '',
'clientToken' => '',
'deletionProtected' => null
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/updateDeletionProtection', [
'body' => '{
"arn": "",
"clientToken": "",
"deletionProtected": false
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/updateDeletionProtection');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'arn' => '',
'clientToken' => '',
'deletionProtected' => null
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'arn' => '',
'clientToken' => '',
'deletionProtected' => null
]));
$request->setRequestUrl('{{baseUrl}}/updateDeletionProtection');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/updateDeletionProtection' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"arn": "",
"clientToken": "",
"deletionProtected": false
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/updateDeletionProtection' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"arn": "",
"clientToken": "",
"deletionProtected": false
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"arn\": \"\",\n \"clientToken\": \"\",\n \"deletionProtected\": false\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/updateDeletionProtection", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/updateDeletionProtection"
payload = {
"arn": "",
"clientToken": "",
"deletionProtected": False
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/updateDeletionProtection"
payload <- "{\n \"arn\": \"\",\n \"clientToken\": \"\",\n \"deletionProtected\": false\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/updateDeletionProtection")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"arn\": \"\",\n \"clientToken\": \"\",\n \"deletionProtected\": false\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/updateDeletionProtection') do |req|
req.body = "{\n \"arn\": \"\",\n \"clientToken\": \"\",\n \"deletionProtected\": false\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/updateDeletionProtection";
let payload = json!({
"arn": "",
"clientToken": "",
"deletionProtected": false
});
let mut headers = reqwest::header::HeaderMap::new();
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}}/updateDeletionProtection \
--header 'content-type: application/json' \
--data '{
"arn": "",
"clientToken": "",
"deletionProtected": false
}'
echo '{
"arn": "",
"clientToken": "",
"deletionProtected": false
}' | \
http POST {{baseUrl}}/updateDeletionProtection \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "arn": "",\n "clientToken": "",\n "deletionProtected": false\n}' \
--output-document \
- {{baseUrl}}/updateDeletionProtection
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"arn": "",
"clientToken": "",
"deletionProtected": false
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/updateDeletionProtection")! 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
UpdateIncidentRecord
{{baseUrl}}/updateIncidentRecord
BODY json
{
"arn": "",
"chatChannel": {
"chatbotSns": "",
"empty": ""
},
"clientToken": "",
"impact": 0,
"notificationTargets": [
{
"snsTopicArn": ""
}
],
"status": "",
"summary": "",
"title": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/updateIncidentRecord");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"arn\": \"\",\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"impact\": 0,\n \"notificationTargets\": [\n {\n \"snsTopicArn\": \"\"\n }\n ],\n \"status\": \"\",\n \"summary\": \"\",\n \"title\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/updateIncidentRecord" {:content-type :json
:form-params {:arn ""
:chatChannel {:chatbotSns ""
:empty ""}
:clientToken ""
:impact 0
:notificationTargets [{:snsTopicArn ""}]
:status ""
:summary ""
:title ""}})
require "http/client"
url = "{{baseUrl}}/updateIncidentRecord"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"arn\": \"\",\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"impact\": 0,\n \"notificationTargets\": [\n {\n \"snsTopicArn\": \"\"\n }\n ],\n \"status\": \"\",\n \"summary\": \"\",\n \"title\": \"\"\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}}/updateIncidentRecord"),
Content = new StringContent("{\n \"arn\": \"\",\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"impact\": 0,\n \"notificationTargets\": [\n {\n \"snsTopicArn\": \"\"\n }\n ],\n \"status\": \"\",\n \"summary\": \"\",\n \"title\": \"\"\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}}/updateIncidentRecord");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"arn\": \"\",\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"impact\": 0,\n \"notificationTargets\": [\n {\n \"snsTopicArn\": \"\"\n }\n ],\n \"status\": \"\",\n \"summary\": \"\",\n \"title\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/updateIncidentRecord"
payload := strings.NewReader("{\n \"arn\": \"\",\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"impact\": 0,\n \"notificationTargets\": [\n {\n \"snsTopicArn\": \"\"\n }\n ],\n \"status\": \"\",\n \"summary\": \"\",\n \"title\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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/updateIncidentRecord HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 229
{
"arn": "",
"chatChannel": {
"chatbotSns": "",
"empty": ""
},
"clientToken": "",
"impact": 0,
"notificationTargets": [
{
"snsTopicArn": ""
}
],
"status": "",
"summary": "",
"title": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/updateIncidentRecord")
.setHeader("content-type", "application/json")
.setBody("{\n \"arn\": \"\",\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"impact\": 0,\n \"notificationTargets\": [\n {\n \"snsTopicArn\": \"\"\n }\n ],\n \"status\": \"\",\n \"summary\": \"\",\n \"title\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/updateIncidentRecord"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"arn\": \"\",\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"impact\": 0,\n \"notificationTargets\": [\n {\n \"snsTopicArn\": \"\"\n }\n ],\n \"status\": \"\",\n \"summary\": \"\",\n \"title\": \"\"\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 \"arn\": \"\",\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"impact\": 0,\n \"notificationTargets\": [\n {\n \"snsTopicArn\": \"\"\n }\n ],\n \"status\": \"\",\n \"summary\": \"\",\n \"title\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/updateIncidentRecord")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/updateIncidentRecord")
.header("content-type", "application/json")
.body("{\n \"arn\": \"\",\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"impact\": 0,\n \"notificationTargets\": [\n {\n \"snsTopicArn\": \"\"\n }\n ],\n \"status\": \"\",\n \"summary\": \"\",\n \"title\": \"\"\n}")
.asString();
const data = JSON.stringify({
arn: '',
chatChannel: {
chatbotSns: '',
empty: ''
},
clientToken: '',
impact: 0,
notificationTargets: [
{
snsTopicArn: ''
}
],
status: '',
summary: '',
title: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/updateIncidentRecord');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/updateIncidentRecord',
headers: {'content-type': 'application/json'},
data: {
arn: '',
chatChannel: {chatbotSns: '', empty: ''},
clientToken: '',
impact: 0,
notificationTargets: [{snsTopicArn: ''}],
status: '',
summary: '',
title: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/updateIncidentRecord';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"arn":"","chatChannel":{"chatbotSns":"","empty":""},"clientToken":"","impact":0,"notificationTargets":[{"snsTopicArn":""}],"status":"","summary":"","title":""}'
};
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}}/updateIncidentRecord',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "arn": "",\n "chatChannel": {\n "chatbotSns": "",\n "empty": ""\n },\n "clientToken": "",\n "impact": 0,\n "notificationTargets": [\n {\n "snsTopicArn": ""\n }\n ],\n "status": "",\n "summary": "",\n "title": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"arn\": \"\",\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"impact\": 0,\n \"notificationTargets\": [\n {\n \"snsTopicArn\": \"\"\n }\n ],\n \"status\": \"\",\n \"summary\": \"\",\n \"title\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/updateIncidentRecord")
.post(body)
.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/updateIncidentRecord',
headers: {
'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({
arn: '',
chatChannel: {chatbotSns: '', empty: ''},
clientToken: '',
impact: 0,
notificationTargets: [{snsTopicArn: ''}],
status: '',
summary: '',
title: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/updateIncidentRecord',
headers: {'content-type': 'application/json'},
body: {
arn: '',
chatChannel: {chatbotSns: '', empty: ''},
clientToken: '',
impact: 0,
notificationTargets: [{snsTopicArn: ''}],
status: '',
summary: '',
title: ''
},
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}}/updateIncidentRecord');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
arn: '',
chatChannel: {
chatbotSns: '',
empty: ''
},
clientToken: '',
impact: 0,
notificationTargets: [
{
snsTopicArn: ''
}
],
status: '',
summary: '',
title: ''
});
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}}/updateIncidentRecord',
headers: {'content-type': 'application/json'},
data: {
arn: '',
chatChannel: {chatbotSns: '', empty: ''},
clientToken: '',
impact: 0,
notificationTargets: [{snsTopicArn: ''}],
status: '',
summary: '',
title: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/updateIncidentRecord';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"arn":"","chatChannel":{"chatbotSns":"","empty":""},"clientToken":"","impact":0,"notificationTargets":[{"snsTopicArn":""}],"status":"","summary":"","title":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"arn": @"",
@"chatChannel": @{ @"chatbotSns": @"", @"empty": @"" },
@"clientToken": @"",
@"impact": @0,
@"notificationTargets": @[ @{ @"snsTopicArn": @"" } ],
@"status": @"",
@"summary": @"",
@"title": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/updateIncidentRecord"]
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}}/updateIncidentRecord" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"arn\": \"\",\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"impact\": 0,\n \"notificationTargets\": [\n {\n \"snsTopicArn\": \"\"\n }\n ],\n \"status\": \"\",\n \"summary\": \"\",\n \"title\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/updateIncidentRecord",
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([
'arn' => '',
'chatChannel' => [
'chatbotSns' => '',
'empty' => ''
],
'clientToken' => '',
'impact' => 0,
'notificationTargets' => [
[
'snsTopicArn' => ''
]
],
'status' => '',
'summary' => '',
'title' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/updateIncidentRecord', [
'body' => '{
"arn": "",
"chatChannel": {
"chatbotSns": "",
"empty": ""
},
"clientToken": "",
"impact": 0,
"notificationTargets": [
{
"snsTopicArn": ""
}
],
"status": "",
"summary": "",
"title": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/updateIncidentRecord');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'arn' => '',
'chatChannel' => [
'chatbotSns' => '',
'empty' => ''
],
'clientToken' => '',
'impact' => 0,
'notificationTargets' => [
[
'snsTopicArn' => ''
]
],
'status' => '',
'summary' => '',
'title' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'arn' => '',
'chatChannel' => [
'chatbotSns' => '',
'empty' => ''
],
'clientToken' => '',
'impact' => 0,
'notificationTargets' => [
[
'snsTopicArn' => ''
]
],
'status' => '',
'summary' => '',
'title' => ''
]));
$request->setRequestUrl('{{baseUrl}}/updateIncidentRecord');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/updateIncidentRecord' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"arn": "",
"chatChannel": {
"chatbotSns": "",
"empty": ""
},
"clientToken": "",
"impact": 0,
"notificationTargets": [
{
"snsTopicArn": ""
}
],
"status": "",
"summary": "",
"title": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/updateIncidentRecord' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"arn": "",
"chatChannel": {
"chatbotSns": "",
"empty": ""
},
"clientToken": "",
"impact": 0,
"notificationTargets": [
{
"snsTopicArn": ""
}
],
"status": "",
"summary": "",
"title": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"arn\": \"\",\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"impact\": 0,\n \"notificationTargets\": [\n {\n \"snsTopicArn\": \"\"\n }\n ],\n \"status\": \"\",\n \"summary\": \"\",\n \"title\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/updateIncidentRecord", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/updateIncidentRecord"
payload = {
"arn": "",
"chatChannel": {
"chatbotSns": "",
"empty": ""
},
"clientToken": "",
"impact": 0,
"notificationTargets": [{ "snsTopicArn": "" }],
"status": "",
"summary": "",
"title": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/updateIncidentRecord"
payload <- "{\n \"arn\": \"\",\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"impact\": 0,\n \"notificationTargets\": [\n {\n \"snsTopicArn\": \"\"\n }\n ],\n \"status\": \"\",\n \"summary\": \"\",\n \"title\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/updateIncidentRecord")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"arn\": \"\",\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"impact\": 0,\n \"notificationTargets\": [\n {\n \"snsTopicArn\": \"\"\n }\n ],\n \"status\": \"\",\n \"summary\": \"\",\n \"title\": \"\"\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/updateIncidentRecord') do |req|
req.body = "{\n \"arn\": \"\",\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"impact\": 0,\n \"notificationTargets\": [\n {\n \"snsTopicArn\": \"\"\n }\n ],\n \"status\": \"\",\n \"summary\": \"\",\n \"title\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/updateIncidentRecord";
let payload = json!({
"arn": "",
"chatChannel": json!({
"chatbotSns": "",
"empty": ""
}),
"clientToken": "",
"impact": 0,
"notificationTargets": (json!({"snsTopicArn": ""})),
"status": "",
"summary": "",
"title": ""
});
let mut headers = reqwest::header::HeaderMap::new();
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}}/updateIncidentRecord \
--header 'content-type: application/json' \
--data '{
"arn": "",
"chatChannel": {
"chatbotSns": "",
"empty": ""
},
"clientToken": "",
"impact": 0,
"notificationTargets": [
{
"snsTopicArn": ""
}
],
"status": "",
"summary": "",
"title": ""
}'
echo '{
"arn": "",
"chatChannel": {
"chatbotSns": "",
"empty": ""
},
"clientToken": "",
"impact": 0,
"notificationTargets": [
{
"snsTopicArn": ""
}
],
"status": "",
"summary": "",
"title": ""
}' | \
http POST {{baseUrl}}/updateIncidentRecord \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "arn": "",\n "chatChannel": {\n "chatbotSns": "",\n "empty": ""\n },\n "clientToken": "",\n "impact": 0,\n "notificationTargets": [\n {\n "snsTopicArn": ""\n }\n ],\n "status": "",\n "summary": "",\n "title": ""\n}' \
--output-document \
- {{baseUrl}}/updateIncidentRecord
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"arn": "",
"chatChannel": [
"chatbotSns": "",
"empty": ""
],
"clientToken": "",
"impact": 0,
"notificationTargets": [["snsTopicArn": ""]],
"status": "",
"summary": "",
"title": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/updateIncidentRecord")! 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}}/updateRelatedItems");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"clientToken\": \"\",\n \"incidentRecordArn\": \"\",\n \"relatedItemsUpdate\": {\n \"itemToAdd\": \"\",\n \"itemToRemove\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/updateRelatedItems" {:content-type :json
:form-params {:clientToken ""
:incidentRecordArn ""
:relatedItemsUpdate {:itemToAdd ""
:itemToRemove ""}}})
require "http/client"
url = "{{baseUrl}}/updateRelatedItems"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"clientToken\": \"\",\n \"incidentRecordArn\": \"\",\n \"relatedItemsUpdate\": {\n \"itemToAdd\": \"\",\n \"itemToRemove\": \"\"\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}}/updateRelatedItems"),
Content = new StringContent("{\n \"clientToken\": \"\",\n \"incidentRecordArn\": \"\",\n \"relatedItemsUpdate\": {\n \"itemToAdd\": \"\",\n \"itemToRemove\": \"\"\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}}/updateRelatedItems");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"clientToken\": \"\",\n \"incidentRecordArn\": \"\",\n \"relatedItemsUpdate\": {\n \"itemToAdd\": \"\",\n \"itemToRemove\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/updateRelatedItems"
payload := strings.NewReader("{\n \"clientToken\": \"\",\n \"incidentRecordArn\": \"\",\n \"relatedItemsUpdate\": {\n \"itemToAdd\": \"\",\n \"itemToRemove\": \"\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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/updateRelatedItems HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 125
{
"clientToken": "",
"incidentRecordArn": "",
"relatedItemsUpdate": {
"itemToAdd": "",
"itemToRemove": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/updateRelatedItems")
.setHeader("content-type", "application/json")
.setBody("{\n \"clientToken\": \"\",\n \"incidentRecordArn\": \"\",\n \"relatedItemsUpdate\": {\n \"itemToAdd\": \"\",\n \"itemToRemove\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/updateRelatedItems"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"clientToken\": \"\",\n \"incidentRecordArn\": \"\",\n \"relatedItemsUpdate\": {\n \"itemToAdd\": \"\",\n \"itemToRemove\": \"\"\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 \"clientToken\": \"\",\n \"incidentRecordArn\": \"\",\n \"relatedItemsUpdate\": {\n \"itemToAdd\": \"\",\n \"itemToRemove\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/updateRelatedItems")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/updateRelatedItems")
.header("content-type", "application/json")
.body("{\n \"clientToken\": \"\",\n \"incidentRecordArn\": \"\",\n \"relatedItemsUpdate\": {\n \"itemToAdd\": \"\",\n \"itemToRemove\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
clientToken: '',
incidentRecordArn: '',
relatedItemsUpdate: {
itemToAdd: '',
itemToRemove: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/updateRelatedItems');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/updateRelatedItems',
headers: {'content-type': 'application/json'},
data: {
clientToken: '',
incidentRecordArn: '',
relatedItemsUpdate: {itemToAdd: '', itemToRemove: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/updateRelatedItems';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"clientToken":"","incidentRecordArn":"","relatedItemsUpdate":{"itemToAdd":"","itemToRemove":""}}'
};
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}}/updateRelatedItems',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "clientToken": "",\n "incidentRecordArn": "",\n "relatedItemsUpdate": {\n "itemToAdd": "",\n "itemToRemove": ""\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 \"clientToken\": \"\",\n \"incidentRecordArn\": \"\",\n \"relatedItemsUpdate\": {\n \"itemToAdd\": \"\",\n \"itemToRemove\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/updateRelatedItems")
.post(body)
.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/updateRelatedItems',
headers: {
'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({
clientToken: '',
incidentRecordArn: '',
relatedItemsUpdate: {itemToAdd: '', itemToRemove: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/updateRelatedItems',
headers: {'content-type': 'application/json'},
body: {
clientToken: '',
incidentRecordArn: '',
relatedItemsUpdate: {itemToAdd: '', itemToRemove: ''}
},
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}}/updateRelatedItems');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
clientToken: '',
incidentRecordArn: '',
relatedItemsUpdate: {
itemToAdd: '',
itemToRemove: ''
}
});
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}}/updateRelatedItems',
headers: {'content-type': 'application/json'},
data: {
clientToken: '',
incidentRecordArn: '',
relatedItemsUpdate: {itemToAdd: '', itemToRemove: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/updateRelatedItems';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"clientToken":"","incidentRecordArn":"","relatedItemsUpdate":{"itemToAdd":"","itemToRemove":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"clientToken": @"",
@"incidentRecordArn": @"",
@"relatedItemsUpdate": @{ @"itemToAdd": @"", @"itemToRemove": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/updateRelatedItems"]
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}}/updateRelatedItems" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"clientToken\": \"\",\n \"incidentRecordArn\": \"\",\n \"relatedItemsUpdate\": {\n \"itemToAdd\": \"\",\n \"itemToRemove\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/updateRelatedItems",
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([
'clientToken' => '',
'incidentRecordArn' => '',
'relatedItemsUpdate' => [
'itemToAdd' => '',
'itemToRemove' => ''
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/updateRelatedItems', [
'body' => '{
"clientToken": "",
"incidentRecordArn": "",
"relatedItemsUpdate": {
"itemToAdd": "",
"itemToRemove": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/updateRelatedItems');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'clientToken' => '',
'incidentRecordArn' => '',
'relatedItemsUpdate' => [
'itemToAdd' => '',
'itemToRemove' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'clientToken' => '',
'incidentRecordArn' => '',
'relatedItemsUpdate' => [
'itemToAdd' => '',
'itemToRemove' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/updateRelatedItems');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/updateRelatedItems' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"clientToken": "",
"incidentRecordArn": "",
"relatedItemsUpdate": {
"itemToAdd": "",
"itemToRemove": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/updateRelatedItems' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"clientToken": "",
"incidentRecordArn": "",
"relatedItemsUpdate": {
"itemToAdd": "",
"itemToRemove": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"clientToken\": \"\",\n \"incidentRecordArn\": \"\",\n \"relatedItemsUpdate\": {\n \"itemToAdd\": \"\",\n \"itemToRemove\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/updateRelatedItems", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/updateRelatedItems"
payload = {
"clientToken": "",
"incidentRecordArn": "",
"relatedItemsUpdate": {
"itemToAdd": "",
"itemToRemove": ""
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/updateRelatedItems"
payload <- "{\n \"clientToken\": \"\",\n \"incidentRecordArn\": \"\",\n \"relatedItemsUpdate\": {\n \"itemToAdd\": \"\",\n \"itemToRemove\": \"\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/updateRelatedItems")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"clientToken\": \"\",\n \"incidentRecordArn\": \"\",\n \"relatedItemsUpdate\": {\n \"itemToAdd\": \"\",\n \"itemToRemove\": \"\"\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/updateRelatedItems') do |req|
req.body = "{\n \"clientToken\": \"\",\n \"incidentRecordArn\": \"\",\n \"relatedItemsUpdate\": {\n \"itemToAdd\": \"\",\n \"itemToRemove\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/updateRelatedItems";
let payload = json!({
"clientToken": "",
"incidentRecordArn": "",
"relatedItemsUpdate": json!({
"itemToAdd": "",
"itemToRemove": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
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}}/updateRelatedItems \
--header 'content-type: application/json' \
--data '{
"clientToken": "",
"incidentRecordArn": "",
"relatedItemsUpdate": {
"itemToAdd": "",
"itemToRemove": ""
}
}'
echo '{
"clientToken": "",
"incidentRecordArn": "",
"relatedItemsUpdate": {
"itemToAdd": "",
"itemToRemove": ""
}
}' | \
http POST {{baseUrl}}/updateRelatedItems \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "clientToken": "",\n "incidentRecordArn": "",\n "relatedItemsUpdate": {\n "itemToAdd": "",\n "itemToRemove": ""\n }\n}' \
--output-document \
- {{baseUrl}}/updateRelatedItems
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"clientToken": "",
"incidentRecordArn": "",
"relatedItemsUpdate": [
"itemToAdd": "",
"itemToRemove": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/updateRelatedItems")! 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
UpdateReplicationSet
{{baseUrl}}/updateReplicationSet
BODY json
{
"actions": [
{
"addRegionAction": "",
"deleteRegionAction": ""
}
],
"arn": "",
"clientToken": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/updateReplicationSet");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"actions\": [\n {\n \"addRegionAction\": \"\",\n \"deleteRegionAction\": \"\"\n }\n ],\n \"arn\": \"\",\n \"clientToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/updateReplicationSet" {:content-type :json
:form-params {:actions [{:addRegionAction ""
:deleteRegionAction ""}]
:arn ""
:clientToken ""}})
require "http/client"
url = "{{baseUrl}}/updateReplicationSet"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"actions\": [\n {\n \"addRegionAction\": \"\",\n \"deleteRegionAction\": \"\"\n }\n ],\n \"arn\": \"\",\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}}/updateReplicationSet"),
Content = new StringContent("{\n \"actions\": [\n {\n \"addRegionAction\": \"\",\n \"deleteRegionAction\": \"\"\n }\n ],\n \"arn\": \"\",\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}}/updateReplicationSet");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"actions\": [\n {\n \"addRegionAction\": \"\",\n \"deleteRegionAction\": \"\"\n }\n ],\n \"arn\": \"\",\n \"clientToken\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/updateReplicationSet"
payload := strings.NewReader("{\n \"actions\": [\n {\n \"addRegionAction\": \"\",\n \"deleteRegionAction\": \"\"\n }\n ],\n \"arn\": \"\",\n \"clientToken\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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/updateReplicationSet HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 128
{
"actions": [
{
"addRegionAction": "",
"deleteRegionAction": ""
}
],
"arn": "",
"clientToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/updateReplicationSet")
.setHeader("content-type", "application/json")
.setBody("{\n \"actions\": [\n {\n \"addRegionAction\": \"\",\n \"deleteRegionAction\": \"\"\n }\n ],\n \"arn\": \"\",\n \"clientToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/updateReplicationSet"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"actions\": [\n {\n \"addRegionAction\": \"\",\n \"deleteRegionAction\": \"\"\n }\n ],\n \"arn\": \"\",\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 \"actions\": [\n {\n \"addRegionAction\": \"\",\n \"deleteRegionAction\": \"\"\n }\n ],\n \"arn\": \"\",\n \"clientToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/updateReplicationSet")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/updateReplicationSet")
.header("content-type", "application/json")
.body("{\n \"actions\": [\n {\n \"addRegionAction\": \"\",\n \"deleteRegionAction\": \"\"\n }\n ],\n \"arn\": \"\",\n \"clientToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
actions: [
{
addRegionAction: '',
deleteRegionAction: ''
}
],
arn: '',
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}}/updateReplicationSet');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/updateReplicationSet',
headers: {'content-type': 'application/json'},
data: {
actions: [{addRegionAction: '', deleteRegionAction: ''}],
arn: '',
clientToken: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/updateReplicationSet';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"actions":[{"addRegionAction":"","deleteRegionAction":""}],"arn":"","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}}/updateReplicationSet',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "actions": [\n {\n "addRegionAction": "",\n "deleteRegionAction": ""\n }\n ],\n "arn": "",\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 \"actions\": [\n {\n \"addRegionAction\": \"\",\n \"deleteRegionAction\": \"\"\n }\n ],\n \"arn\": \"\",\n \"clientToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/updateReplicationSet")
.post(body)
.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/updateReplicationSet',
headers: {
'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({
actions: [{addRegionAction: '', deleteRegionAction: ''}],
arn: '',
clientToken: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/updateReplicationSet',
headers: {'content-type': 'application/json'},
body: {
actions: [{addRegionAction: '', deleteRegionAction: ''}],
arn: '',
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}}/updateReplicationSet');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
actions: [
{
addRegionAction: '',
deleteRegionAction: ''
}
],
arn: '',
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}}/updateReplicationSet',
headers: {'content-type': 'application/json'},
data: {
actions: [{addRegionAction: '', deleteRegionAction: ''}],
arn: '',
clientToken: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/updateReplicationSet';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"actions":[{"addRegionAction":"","deleteRegionAction":""}],"arn":"","clientToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"actions": @[ @{ @"addRegionAction": @"", @"deleteRegionAction": @"" } ],
@"arn": @"",
@"clientToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/updateReplicationSet"]
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}}/updateReplicationSet" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"actions\": [\n {\n \"addRegionAction\": \"\",\n \"deleteRegionAction\": \"\"\n }\n ],\n \"arn\": \"\",\n \"clientToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/updateReplicationSet",
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([
'actions' => [
[
'addRegionAction' => '',
'deleteRegionAction' => ''
]
],
'arn' => '',
'clientToken' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/updateReplicationSet', [
'body' => '{
"actions": [
{
"addRegionAction": "",
"deleteRegionAction": ""
}
],
"arn": "",
"clientToken": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/updateReplicationSet');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'actions' => [
[
'addRegionAction' => '',
'deleteRegionAction' => ''
]
],
'arn' => '',
'clientToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'actions' => [
[
'addRegionAction' => '',
'deleteRegionAction' => ''
]
],
'arn' => '',
'clientToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/updateReplicationSet');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/updateReplicationSet' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"actions": [
{
"addRegionAction": "",
"deleteRegionAction": ""
}
],
"arn": "",
"clientToken": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/updateReplicationSet' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"actions": [
{
"addRegionAction": "",
"deleteRegionAction": ""
}
],
"arn": "",
"clientToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"actions\": [\n {\n \"addRegionAction\": \"\",\n \"deleteRegionAction\": \"\"\n }\n ],\n \"arn\": \"\",\n \"clientToken\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/updateReplicationSet", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/updateReplicationSet"
payload = {
"actions": [
{
"addRegionAction": "",
"deleteRegionAction": ""
}
],
"arn": "",
"clientToken": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/updateReplicationSet"
payload <- "{\n \"actions\": [\n {\n \"addRegionAction\": \"\",\n \"deleteRegionAction\": \"\"\n }\n ],\n \"arn\": \"\",\n \"clientToken\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/updateReplicationSet")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"actions\": [\n {\n \"addRegionAction\": \"\",\n \"deleteRegionAction\": \"\"\n }\n ],\n \"arn\": \"\",\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/updateReplicationSet') do |req|
req.body = "{\n \"actions\": [\n {\n \"addRegionAction\": \"\",\n \"deleteRegionAction\": \"\"\n }\n ],\n \"arn\": \"\",\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}}/updateReplicationSet";
let payload = json!({
"actions": (
json!({
"addRegionAction": "",
"deleteRegionAction": ""
})
),
"arn": "",
"clientToken": ""
});
let mut headers = reqwest::header::HeaderMap::new();
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}}/updateReplicationSet \
--header 'content-type: application/json' \
--data '{
"actions": [
{
"addRegionAction": "",
"deleteRegionAction": ""
}
],
"arn": "",
"clientToken": ""
}'
echo '{
"actions": [
{
"addRegionAction": "",
"deleteRegionAction": ""
}
],
"arn": "",
"clientToken": ""
}' | \
http POST {{baseUrl}}/updateReplicationSet \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "actions": [\n {\n "addRegionAction": "",\n "deleteRegionAction": ""\n }\n ],\n "arn": "",\n "clientToken": ""\n}' \
--output-document \
- {{baseUrl}}/updateReplicationSet
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"actions": [
[
"addRegionAction": "",
"deleteRegionAction": ""
]
],
"arn": "",
"clientToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/updateReplicationSet")! 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
UpdateResponsePlan
{{baseUrl}}/updateResponsePlan
BODY json
{
"actions": [
{
"ssmAutomation": ""
}
],
"arn": "",
"chatChannel": {
"chatbotSns": "",
"empty": ""
},
"clientToken": "",
"displayName": "",
"engagements": [],
"incidentTemplateDedupeString": "",
"incidentTemplateImpact": 0,
"incidentTemplateNotificationTargets": [
{
"snsTopicArn": ""
}
],
"incidentTemplateSummary": "",
"incidentTemplateTags": {},
"incidentTemplateTitle": "",
"integrations": [
{
"pagerDutyConfiguration": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/updateResponsePlan");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"actions\": [\n {\n \"ssmAutomation\": \"\"\n }\n ],\n \"arn\": \"\",\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"displayName\": \"\",\n \"engagements\": [],\n \"incidentTemplateDedupeString\": \"\",\n \"incidentTemplateImpact\": 0,\n \"incidentTemplateNotificationTargets\": [\n {\n \"snsTopicArn\": \"\"\n }\n ],\n \"incidentTemplateSummary\": \"\",\n \"incidentTemplateTags\": {},\n \"incidentTemplateTitle\": \"\",\n \"integrations\": [\n {\n \"pagerDutyConfiguration\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/updateResponsePlan" {:content-type :json
:form-params {:actions [{:ssmAutomation ""}]
:arn ""
:chatChannel {:chatbotSns ""
:empty ""}
:clientToken ""
:displayName ""
:engagements []
:incidentTemplateDedupeString ""
:incidentTemplateImpact 0
:incidentTemplateNotificationTargets [{:snsTopicArn ""}]
:incidentTemplateSummary ""
:incidentTemplateTags {}
:incidentTemplateTitle ""
:integrations [{:pagerDutyConfiguration ""}]}})
require "http/client"
url = "{{baseUrl}}/updateResponsePlan"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"actions\": [\n {\n \"ssmAutomation\": \"\"\n }\n ],\n \"arn\": \"\",\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"displayName\": \"\",\n \"engagements\": [],\n \"incidentTemplateDedupeString\": \"\",\n \"incidentTemplateImpact\": 0,\n \"incidentTemplateNotificationTargets\": [\n {\n \"snsTopicArn\": \"\"\n }\n ],\n \"incidentTemplateSummary\": \"\",\n \"incidentTemplateTags\": {},\n \"incidentTemplateTitle\": \"\",\n \"integrations\": [\n {\n \"pagerDutyConfiguration\": \"\"\n }\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}}/updateResponsePlan"),
Content = new StringContent("{\n \"actions\": [\n {\n \"ssmAutomation\": \"\"\n }\n ],\n \"arn\": \"\",\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"displayName\": \"\",\n \"engagements\": [],\n \"incidentTemplateDedupeString\": \"\",\n \"incidentTemplateImpact\": 0,\n \"incidentTemplateNotificationTargets\": [\n {\n \"snsTopicArn\": \"\"\n }\n ],\n \"incidentTemplateSummary\": \"\",\n \"incidentTemplateTags\": {},\n \"incidentTemplateTitle\": \"\",\n \"integrations\": [\n {\n \"pagerDutyConfiguration\": \"\"\n }\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}}/updateResponsePlan");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"actions\": [\n {\n \"ssmAutomation\": \"\"\n }\n ],\n \"arn\": \"\",\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"displayName\": \"\",\n \"engagements\": [],\n \"incidentTemplateDedupeString\": \"\",\n \"incidentTemplateImpact\": 0,\n \"incidentTemplateNotificationTargets\": [\n {\n \"snsTopicArn\": \"\"\n }\n ],\n \"incidentTemplateSummary\": \"\",\n \"incidentTemplateTags\": {},\n \"incidentTemplateTitle\": \"\",\n \"integrations\": [\n {\n \"pagerDutyConfiguration\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/updateResponsePlan"
payload := strings.NewReader("{\n \"actions\": [\n {\n \"ssmAutomation\": \"\"\n }\n ],\n \"arn\": \"\",\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"displayName\": \"\",\n \"engagements\": [],\n \"incidentTemplateDedupeString\": \"\",\n \"incidentTemplateImpact\": 0,\n \"incidentTemplateNotificationTargets\": [\n {\n \"snsTopicArn\": \"\"\n }\n ],\n \"incidentTemplateSummary\": \"\",\n \"incidentTemplateTags\": {},\n \"incidentTemplateTitle\": \"\",\n \"integrations\": [\n {\n \"pagerDutyConfiguration\": \"\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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/updateResponsePlan HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 517
{
"actions": [
{
"ssmAutomation": ""
}
],
"arn": "",
"chatChannel": {
"chatbotSns": "",
"empty": ""
},
"clientToken": "",
"displayName": "",
"engagements": [],
"incidentTemplateDedupeString": "",
"incidentTemplateImpact": 0,
"incidentTemplateNotificationTargets": [
{
"snsTopicArn": ""
}
],
"incidentTemplateSummary": "",
"incidentTemplateTags": {},
"incidentTemplateTitle": "",
"integrations": [
{
"pagerDutyConfiguration": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/updateResponsePlan")
.setHeader("content-type", "application/json")
.setBody("{\n \"actions\": [\n {\n \"ssmAutomation\": \"\"\n }\n ],\n \"arn\": \"\",\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"displayName\": \"\",\n \"engagements\": [],\n \"incidentTemplateDedupeString\": \"\",\n \"incidentTemplateImpact\": 0,\n \"incidentTemplateNotificationTargets\": [\n {\n \"snsTopicArn\": \"\"\n }\n ],\n \"incidentTemplateSummary\": \"\",\n \"incidentTemplateTags\": {},\n \"incidentTemplateTitle\": \"\",\n \"integrations\": [\n {\n \"pagerDutyConfiguration\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/updateResponsePlan"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"actions\": [\n {\n \"ssmAutomation\": \"\"\n }\n ],\n \"arn\": \"\",\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"displayName\": \"\",\n \"engagements\": [],\n \"incidentTemplateDedupeString\": \"\",\n \"incidentTemplateImpact\": 0,\n \"incidentTemplateNotificationTargets\": [\n {\n \"snsTopicArn\": \"\"\n }\n ],\n \"incidentTemplateSummary\": \"\",\n \"incidentTemplateTags\": {},\n \"incidentTemplateTitle\": \"\",\n \"integrations\": [\n {\n \"pagerDutyConfiguration\": \"\"\n }\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 \"actions\": [\n {\n \"ssmAutomation\": \"\"\n }\n ],\n \"arn\": \"\",\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"displayName\": \"\",\n \"engagements\": [],\n \"incidentTemplateDedupeString\": \"\",\n \"incidentTemplateImpact\": 0,\n \"incidentTemplateNotificationTargets\": [\n {\n \"snsTopicArn\": \"\"\n }\n ],\n \"incidentTemplateSummary\": \"\",\n \"incidentTemplateTags\": {},\n \"incidentTemplateTitle\": \"\",\n \"integrations\": [\n {\n \"pagerDutyConfiguration\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/updateResponsePlan")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/updateResponsePlan")
.header("content-type", "application/json")
.body("{\n \"actions\": [\n {\n \"ssmAutomation\": \"\"\n }\n ],\n \"arn\": \"\",\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"displayName\": \"\",\n \"engagements\": [],\n \"incidentTemplateDedupeString\": \"\",\n \"incidentTemplateImpact\": 0,\n \"incidentTemplateNotificationTargets\": [\n {\n \"snsTopicArn\": \"\"\n }\n ],\n \"incidentTemplateSummary\": \"\",\n \"incidentTemplateTags\": {},\n \"incidentTemplateTitle\": \"\",\n \"integrations\": [\n {\n \"pagerDutyConfiguration\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
actions: [
{
ssmAutomation: ''
}
],
arn: '',
chatChannel: {
chatbotSns: '',
empty: ''
},
clientToken: '',
displayName: '',
engagements: [],
incidentTemplateDedupeString: '',
incidentTemplateImpact: 0,
incidentTemplateNotificationTargets: [
{
snsTopicArn: ''
}
],
incidentTemplateSummary: '',
incidentTemplateTags: {},
incidentTemplateTitle: '',
integrations: [
{
pagerDutyConfiguration: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/updateResponsePlan');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/updateResponsePlan',
headers: {'content-type': 'application/json'},
data: {
actions: [{ssmAutomation: ''}],
arn: '',
chatChannel: {chatbotSns: '', empty: ''},
clientToken: '',
displayName: '',
engagements: [],
incidentTemplateDedupeString: '',
incidentTemplateImpact: 0,
incidentTemplateNotificationTargets: [{snsTopicArn: ''}],
incidentTemplateSummary: '',
incidentTemplateTags: {},
incidentTemplateTitle: '',
integrations: [{pagerDutyConfiguration: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/updateResponsePlan';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"actions":[{"ssmAutomation":""}],"arn":"","chatChannel":{"chatbotSns":"","empty":""},"clientToken":"","displayName":"","engagements":[],"incidentTemplateDedupeString":"","incidentTemplateImpact":0,"incidentTemplateNotificationTargets":[{"snsTopicArn":""}],"incidentTemplateSummary":"","incidentTemplateTags":{},"incidentTemplateTitle":"","integrations":[{"pagerDutyConfiguration":""}]}'
};
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}}/updateResponsePlan',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "actions": [\n {\n "ssmAutomation": ""\n }\n ],\n "arn": "",\n "chatChannel": {\n "chatbotSns": "",\n "empty": ""\n },\n "clientToken": "",\n "displayName": "",\n "engagements": [],\n "incidentTemplateDedupeString": "",\n "incidentTemplateImpact": 0,\n "incidentTemplateNotificationTargets": [\n {\n "snsTopicArn": ""\n }\n ],\n "incidentTemplateSummary": "",\n "incidentTemplateTags": {},\n "incidentTemplateTitle": "",\n "integrations": [\n {\n "pagerDutyConfiguration": ""\n }\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 \"actions\": [\n {\n \"ssmAutomation\": \"\"\n }\n ],\n \"arn\": \"\",\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"displayName\": \"\",\n \"engagements\": [],\n \"incidentTemplateDedupeString\": \"\",\n \"incidentTemplateImpact\": 0,\n \"incidentTemplateNotificationTargets\": [\n {\n \"snsTopicArn\": \"\"\n }\n ],\n \"incidentTemplateSummary\": \"\",\n \"incidentTemplateTags\": {},\n \"incidentTemplateTitle\": \"\",\n \"integrations\": [\n {\n \"pagerDutyConfiguration\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/updateResponsePlan")
.post(body)
.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/updateResponsePlan',
headers: {
'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({
actions: [{ssmAutomation: ''}],
arn: '',
chatChannel: {chatbotSns: '', empty: ''},
clientToken: '',
displayName: '',
engagements: [],
incidentTemplateDedupeString: '',
incidentTemplateImpact: 0,
incidentTemplateNotificationTargets: [{snsTopicArn: ''}],
incidentTemplateSummary: '',
incidentTemplateTags: {},
incidentTemplateTitle: '',
integrations: [{pagerDutyConfiguration: ''}]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/updateResponsePlan',
headers: {'content-type': 'application/json'},
body: {
actions: [{ssmAutomation: ''}],
arn: '',
chatChannel: {chatbotSns: '', empty: ''},
clientToken: '',
displayName: '',
engagements: [],
incidentTemplateDedupeString: '',
incidentTemplateImpact: 0,
incidentTemplateNotificationTargets: [{snsTopicArn: ''}],
incidentTemplateSummary: '',
incidentTemplateTags: {},
incidentTemplateTitle: '',
integrations: [{pagerDutyConfiguration: ''}]
},
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}}/updateResponsePlan');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
actions: [
{
ssmAutomation: ''
}
],
arn: '',
chatChannel: {
chatbotSns: '',
empty: ''
},
clientToken: '',
displayName: '',
engagements: [],
incidentTemplateDedupeString: '',
incidentTemplateImpact: 0,
incidentTemplateNotificationTargets: [
{
snsTopicArn: ''
}
],
incidentTemplateSummary: '',
incidentTemplateTags: {},
incidentTemplateTitle: '',
integrations: [
{
pagerDutyConfiguration: ''
}
]
});
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}}/updateResponsePlan',
headers: {'content-type': 'application/json'},
data: {
actions: [{ssmAutomation: ''}],
arn: '',
chatChannel: {chatbotSns: '', empty: ''},
clientToken: '',
displayName: '',
engagements: [],
incidentTemplateDedupeString: '',
incidentTemplateImpact: 0,
incidentTemplateNotificationTargets: [{snsTopicArn: ''}],
incidentTemplateSummary: '',
incidentTemplateTags: {},
incidentTemplateTitle: '',
integrations: [{pagerDutyConfiguration: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/updateResponsePlan';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"actions":[{"ssmAutomation":""}],"arn":"","chatChannel":{"chatbotSns":"","empty":""},"clientToken":"","displayName":"","engagements":[],"incidentTemplateDedupeString":"","incidentTemplateImpact":0,"incidentTemplateNotificationTargets":[{"snsTopicArn":""}],"incidentTemplateSummary":"","incidentTemplateTags":{},"incidentTemplateTitle":"","integrations":[{"pagerDutyConfiguration":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"actions": @[ @{ @"ssmAutomation": @"" } ],
@"arn": @"",
@"chatChannel": @{ @"chatbotSns": @"", @"empty": @"" },
@"clientToken": @"",
@"displayName": @"",
@"engagements": @[ ],
@"incidentTemplateDedupeString": @"",
@"incidentTemplateImpact": @0,
@"incidentTemplateNotificationTargets": @[ @{ @"snsTopicArn": @"" } ],
@"incidentTemplateSummary": @"",
@"incidentTemplateTags": @{ },
@"incidentTemplateTitle": @"",
@"integrations": @[ @{ @"pagerDutyConfiguration": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/updateResponsePlan"]
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}}/updateResponsePlan" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"actions\": [\n {\n \"ssmAutomation\": \"\"\n }\n ],\n \"arn\": \"\",\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"displayName\": \"\",\n \"engagements\": [],\n \"incidentTemplateDedupeString\": \"\",\n \"incidentTemplateImpact\": 0,\n \"incidentTemplateNotificationTargets\": [\n {\n \"snsTopicArn\": \"\"\n }\n ],\n \"incidentTemplateSummary\": \"\",\n \"incidentTemplateTags\": {},\n \"incidentTemplateTitle\": \"\",\n \"integrations\": [\n {\n \"pagerDutyConfiguration\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/updateResponsePlan",
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([
'actions' => [
[
'ssmAutomation' => ''
]
],
'arn' => '',
'chatChannel' => [
'chatbotSns' => '',
'empty' => ''
],
'clientToken' => '',
'displayName' => '',
'engagements' => [
],
'incidentTemplateDedupeString' => '',
'incidentTemplateImpact' => 0,
'incidentTemplateNotificationTargets' => [
[
'snsTopicArn' => ''
]
],
'incidentTemplateSummary' => '',
'incidentTemplateTags' => [
],
'incidentTemplateTitle' => '',
'integrations' => [
[
'pagerDutyConfiguration' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/updateResponsePlan', [
'body' => '{
"actions": [
{
"ssmAutomation": ""
}
],
"arn": "",
"chatChannel": {
"chatbotSns": "",
"empty": ""
},
"clientToken": "",
"displayName": "",
"engagements": [],
"incidentTemplateDedupeString": "",
"incidentTemplateImpact": 0,
"incidentTemplateNotificationTargets": [
{
"snsTopicArn": ""
}
],
"incidentTemplateSummary": "",
"incidentTemplateTags": {},
"incidentTemplateTitle": "",
"integrations": [
{
"pagerDutyConfiguration": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/updateResponsePlan');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'actions' => [
[
'ssmAutomation' => ''
]
],
'arn' => '',
'chatChannel' => [
'chatbotSns' => '',
'empty' => ''
],
'clientToken' => '',
'displayName' => '',
'engagements' => [
],
'incidentTemplateDedupeString' => '',
'incidentTemplateImpact' => 0,
'incidentTemplateNotificationTargets' => [
[
'snsTopicArn' => ''
]
],
'incidentTemplateSummary' => '',
'incidentTemplateTags' => [
],
'incidentTemplateTitle' => '',
'integrations' => [
[
'pagerDutyConfiguration' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'actions' => [
[
'ssmAutomation' => ''
]
],
'arn' => '',
'chatChannel' => [
'chatbotSns' => '',
'empty' => ''
],
'clientToken' => '',
'displayName' => '',
'engagements' => [
],
'incidentTemplateDedupeString' => '',
'incidentTemplateImpact' => 0,
'incidentTemplateNotificationTargets' => [
[
'snsTopicArn' => ''
]
],
'incidentTemplateSummary' => '',
'incidentTemplateTags' => [
],
'incidentTemplateTitle' => '',
'integrations' => [
[
'pagerDutyConfiguration' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/updateResponsePlan');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/updateResponsePlan' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"actions": [
{
"ssmAutomation": ""
}
],
"arn": "",
"chatChannel": {
"chatbotSns": "",
"empty": ""
},
"clientToken": "",
"displayName": "",
"engagements": [],
"incidentTemplateDedupeString": "",
"incidentTemplateImpact": 0,
"incidentTemplateNotificationTargets": [
{
"snsTopicArn": ""
}
],
"incidentTemplateSummary": "",
"incidentTemplateTags": {},
"incidentTemplateTitle": "",
"integrations": [
{
"pagerDutyConfiguration": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/updateResponsePlan' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"actions": [
{
"ssmAutomation": ""
}
],
"arn": "",
"chatChannel": {
"chatbotSns": "",
"empty": ""
},
"clientToken": "",
"displayName": "",
"engagements": [],
"incidentTemplateDedupeString": "",
"incidentTemplateImpact": 0,
"incidentTemplateNotificationTargets": [
{
"snsTopicArn": ""
}
],
"incidentTemplateSummary": "",
"incidentTemplateTags": {},
"incidentTemplateTitle": "",
"integrations": [
{
"pagerDutyConfiguration": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"actions\": [\n {\n \"ssmAutomation\": \"\"\n }\n ],\n \"arn\": \"\",\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"displayName\": \"\",\n \"engagements\": [],\n \"incidentTemplateDedupeString\": \"\",\n \"incidentTemplateImpact\": 0,\n \"incidentTemplateNotificationTargets\": [\n {\n \"snsTopicArn\": \"\"\n }\n ],\n \"incidentTemplateSummary\": \"\",\n \"incidentTemplateTags\": {},\n \"incidentTemplateTitle\": \"\",\n \"integrations\": [\n {\n \"pagerDutyConfiguration\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/updateResponsePlan", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/updateResponsePlan"
payload = {
"actions": [{ "ssmAutomation": "" }],
"arn": "",
"chatChannel": {
"chatbotSns": "",
"empty": ""
},
"clientToken": "",
"displayName": "",
"engagements": [],
"incidentTemplateDedupeString": "",
"incidentTemplateImpact": 0,
"incidentTemplateNotificationTargets": [{ "snsTopicArn": "" }],
"incidentTemplateSummary": "",
"incidentTemplateTags": {},
"incidentTemplateTitle": "",
"integrations": [{ "pagerDutyConfiguration": "" }]
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/updateResponsePlan"
payload <- "{\n \"actions\": [\n {\n \"ssmAutomation\": \"\"\n }\n ],\n \"arn\": \"\",\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"displayName\": \"\",\n \"engagements\": [],\n \"incidentTemplateDedupeString\": \"\",\n \"incidentTemplateImpact\": 0,\n \"incidentTemplateNotificationTargets\": [\n {\n \"snsTopicArn\": \"\"\n }\n ],\n \"incidentTemplateSummary\": \"\",\n \"incidentTemplateTags\": {},\n \"incidentTemplateTitle\": \"\",\n \"integrations\": [\n {\n \"pagerDutyConfiguration\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/updateResponsePlan")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"actions\": [\n {\n \"ssmAutomation\": \"\"\n }\n ],\n \"arn\": \"\",\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"displayName\": \"\",\n \"engagements\": [],\n \"incidentTemplateDedupeString\": \"\",\n \"incidentTemplateImpact\": 0,\n \"incidentTemplateNotificationTargets\": [\n {\n \"snsTopicArn\": \"\"\n }\n ],\n \"incidentTemplateSummary\": \"\",\n \"incidentTemplateTags\": {},\n \"incidentTemplateTitle\": \"\",\n \"integrations\": [\n {\n \"pagerDutyConfiguration\": \"\"\n }\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/updateResponsePlan') do |req|
req.body = "{\n \"actions\": [\n {\n \"ssmAutomation\": \"\"\n }\n ],\n \"arn\": \"\",\n \"chatChannel\": {\n \"chatbotSns\": \"\",\n \"empty\": \"\"\n },\n \"clientToken\": \"\",\n \"displayName\": \"\",\n \"engagements\": [],\n \"incidentTemplateDedupeString\": \"\",\n \"incidentTemplateImpact\": 0,\n \"incidentTemplateNotificationTargets\": [\n {\n \"snsTopicArn\": \"\"\n }\n ],\n \"incidentTemplateSummary\": \"\",\n \"incidentTemplateTags\": {},\n \"incidentTemplateTitle\": \"\",\n \"integrations\": [\n {\n \"pagerDutyConfiguration\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/updateResponsePlan";
let payload = json!({
"actions": (json!({"ssmAutomation": ""})),
"arn": "",
"chatChannel": json!({
"chatbotSns": "",
"empty": ""
}),
"clientToken": "",
"displayName": "",
"engagements": (),
"incidentTemplateDedupeString": "",
"incidentTemplateImpact": 0,
"incidentTemplateNotificationTargets": (json!({"snsTopicArn": ""})),
"incidentTemplateSummary": "",
"incidentTemplateTags": json!({}),
"incidentTemplateTitle": "",
"integrations": (json!({"pagerDutyConfiguration": ""}))
});
let mut headers = reqwest::header::HeaderMap::new();
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}}/updateResponsePlan \
--header 'content-type: application/json' \
--data '{
"actions": [
{
"ssmAutomation": ""
}
],
"arn": "",
"chatChannel": {
"chatbotSns": "",
"empty": ""
},
"clientToken": "",
"displayName": "",
"engagements": [],
"incidentTemplateDedupeString": "",
"incidentTemplateImpact": 0,
"incidentTemplateNotificationTargets": [
{
"snsTopicArn": ""
}
],
"incidentTemplateSummary": "",
"incidentTemplateTags": {},
"incidentTemplateTitle": "",
"integrations": [
{
"pagerDutyConfiguration": ""
}
]
}'
echo '{
"actions": [
{
"ssmAutomation": ""
}
],
"arn": "",
"chatChannel": {
"chatbotSns": "",
"empty": ""
},
"clientToken": "",
"displayName": "",
"engagements": [],
"incidentTemplateDedupeString": "",
"incidentTemplateImpact": 0,
"incidentTemplateNotificationTargets": [
{
"snsTopicArn": ""
}
],
"incidentTemplateSummary": "",
"incidentTemplateTags": {},
"incidentTemplateTitle": "",
"integrations": [
{
"pagerDutyConfiguration": ""
}
]
}' | \
http POST {{baseUrl}}/updateResponsePlan \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "actions": [\n {\n "ssmAutomation": ""\n }\n ],\n "arn": "",\n "chatChannel": {\n "chatbotSns": "",\n "empty": ""\n },\n "clientToken": "",\n "displayName": "",\n "engagements": [],\n "incidentTemplateDedupeString": "",\n "incidentTemplateImpact": 0,\n "incidentTemplateNotificationTargets": [\n {\n "snsTopicArn": ""\n }\n ],\n "incidentTemplateSummary": "",\n "incidentTemplateTags": {},\n "incidentTemplateTitle": "",\n "integrations": [\n {\n "pagerDutyConfiguration": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/updateResponsePlan
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"actions": [["ssmAutomation": ""]],
"arn": "",
"chatChannel": [
"chatbotSns": "",
"empty": ""
],
"clientToken": "",
"displayName": "",
"engagements": [],
"incidentTemplateDedupeString": "",
"incidentTemplateImpact": 0,
"incidentTemplateNotificationTargets": [["snsTopicArn": ""]],
"incidentTemplateSummary": "",
"incidentTemplateTags": [],
"incidentTemplateTitle": "",
"integrations": [["pagerDutyConfiguration": ""]]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/updateResponsePlan")! 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
UpdateTimelineEvent
{{baseUrl}}/updateTimelineEvent
BODY json
{
"clientToken": "",
"eventData": "",
"eventId": "",
"eventReferences": [
{
"relatedItemId": "",
"resource": ""
}
],
"eventTime": "",
"eventType": "",
"incidentRecordArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/updateTimelineEvent");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"clientToken\": \"\",\n \"eventData\": \"\",\n \"eventId\": \"\",\n \"eventReferences\": [\n {\n \"relatedItemId\": \"\",\n \"resource\": \"\"\n }\n ],\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"incidentRecordArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/updateTimelineEvent" {:content-type :json
:form-params {:clientToken ""
:eventData ""
:eventId ""
:eventReferences [{:relatedItemId ""
:resource ""}]
:eventTime ""
:eventType ""
:incidentRecordArn ""}})
require "http/client"
url = "{{baseUrl}}/updateTimelineEvent"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"clientToken\": \"\",\n \"eventData\": \"\",\n \"eventId\": \"\",\n \"eventReferences\": [\n {\n \"relatedItemId\": \"\",\n \"resource\": \"\"\n }\n ],\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"incidentRecordArn\": \"\"\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}}/updateTimelineEvent"),
Content = new StringContent("{\n \"clientToken\": \"\",\n \"eventData\": \"\",\n \"eventId\": \"\",\n \"eventReferences\": [\n {\n \"relatedItemId\": \"\",\n \"resource\": \"\"\n }\n ],\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"incidentRecordArn\": \"\"\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}}/updateTimelineEvent");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"clientToken\": \"\",\n \"eventData\": \"\",\n \"eventId\": \"\",\n \"eventReferences\": [\n {\n \"relatedItemId\": \"\",\n \"resource\": \"\"\n }\n ],\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"incidentRecordArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/updateTimelineEvent"
payload := strings.NewReader("{\n \"clientToken\": \"\",\n \"eventData\": \"\",\n \"eventId\": \"\",\n \"eventReferences\": [\n {\n \"relatedItemId\": \"\",\n \"resource\": \"\"\n }\n ],\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"incidentRecordArn\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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/updateTimelineEvent HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 212
{
"clientToken": "",
"eventData": "",
"eventId": "",
"eventReferences": [
{
"relatedItemId": "",
"resource": ""
}
],
"eventTime": "",
"eventType": "",
"incidentRecordArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/updateTimelineEvent")
.setHeader("content-type", "application/json")
.setBody("{\n \"clientToken\": \"\",\n \"eventData\": \"\",\n \"eventId\": \"\",\n \"eventReferences\": [\n {\n \"relatedItemId\": \"\",\n \"resource\": \"\"\n }\n ],\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"incidentRecordArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/updateTimelineEvent"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"clientToken\": \"\",\n \"eventData\": \"\",\n \"eventId\": \"\",\n \"eventReferences\": [\n {\n \"relatedItemId\": \"\",\n \"resource\": \"\"\n }\n ],\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"incidentRecordArn\": \"\"\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 \"clientToken\": \"\",\n \"eventData\": \"\",\n \"eventId\": \"\",\n \"eventReferences\": [\n {\n \"relatedItemId\": \"\",\n \"resource\": \"\"\n }\n ],\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"incidentRecordArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/updateTimelineEvent")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/updateTimelineEvent")
.header("content-type", "application/json")
.body("{\n \"clientToken\": \"\",\n \"eventData\": \"\",\n \"eventId\": \"\",\n \"eventReferences\": [\n {\n \"relatedItemId\": \"\",\n \"resource\": \"\"\n }\n ],\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"incidentRecordArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
clientToken: '',
eventData: '',
eventId: '',
eventReferences: [
{
relatedItemId: '',
resource: ''
}
],
eventTime: '',
eventType: '',
incidentRecordArn: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/updateTimelineEvent');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/updateTimelineEvent',
headers: {'content-type': 'application/json'},
data: {
clientToken: '',
eventData: '',
eventId: '',
eventReferences: [{relatedItemId: '', resource: ''}],
eventTime: '',
eventType: '',
incidentRecordArn: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/updateTimelineEvent';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"clientToken":"","eventData":"","eventId":"","eventReferences":[{"relatedItemId":"","resource":""}],"eventTime":"","eventType":"","incidentRecordArn":""}'
};
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}}/updateTimelineEvent',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "clientToken": "",\n "eventData": "",\n "eventId": "",\n "eventReferences": [\n {\n "relatedItemId": "",\n "resource": ""\n }\n ],\n "eventTime": "",\n "eventType": "",\n "incidentRecordArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"clientToken\": \"\",\n \"eventData\": \"\",\n \"eventId\": \"\",\n \"eventReferences\": [\n {\n \"relatedItemId\": \"\",\n \"resource\": \"\"\n }\n ],\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"incidentRecordArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/updateTimelineEvent")
.post(body)
.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/updateTimelineEvent',
headers: {
'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({
clientToken: '',
eventData: '',
eventId: '',
eventReferences: [{relatedItemId: '', resource: ''}],
eventTime: '',
eventType: '',
incidentRecordArn: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/updateTimelineEvent',
headers: {'content-type': 'application/json'},
body: {
clientToken: '',
eventData: '',
eventId: '',
eventReferences: [{relatedItemId: '', resource: ''}],
eventTime: '',
eventType: '',
incidentRecordArn: ''
},
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}}/updateTimelineEvent');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
clientToken: '',
eventData: '',
eventId: '',
eventReferences: [
{
relatedItemId: '',
resource: ''
}
],
eventTime: '',
eventType: '',
incidentRecordArn: ''
});
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}}/updateTimelineEvent',
headers: {'content-type': 'application/json'},
data: {
clientToken: '',
eventData: '',
eventId: '',
eventReferences: [{relatedItemId: '', resource: ''}],
eventTime: '',
eventType: '',
incidentRecordArn: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/updateTimelineEvent';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"clientToken":"","eventData":"","eventId":"","eventReferences":[{"relatedItemId":"","resource":""}],"eventTime":"","eventType":"","incidentRecordArn":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"clientToken": @"",
@"eventData": @"",
@"eventId": @"",
@"eventReferences": @[ @{ @"relatedItemId": @"", @"resource": @"" } ],
@"eventTime": @"",
@"eventType": @"",
@"incidentRecordArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/updateTimelineEvent"]
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}}/updateTimelineEvent" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"clientToken\": \"\",\n \"eventData\": \"\",\n \"eventId\": \"\",\n \"eventReferences\": [\n {\n \"relatedItemId\": \"\",\n \"resource\": \"\"\n }\n ],\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"incidentRecordArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/updateTimelineEvent",
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([
'clientToken' => '',
'eventData' => '',
'eventId' => '',
'eventReferences' => [
[
'relatedItemId' => '',
'resource' => ''
]
],
'eventTime' => '',
'eventType' => '',
'incidentRecordArn' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/updateTimelineEvent', [
'body' => '{
"clientToken": "",
"eventData": "",
"eventId": "",
"eventReferences": [
{
"relatedItemId": "",
"resource": ""
}
],
"eventTime": "",
"eventType": "",
"incidentRecordArn": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/updateTimelineEvent');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'clientToken' => '',
'eventData' => '',
'eventId' => '',
'eventReferences' => [
[
'relatedItemId' => '',
'resource' => ''
]
],
'eventTime' => '',
'eventType' => '',
'incidentRecordArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'clientToken' => '',
'eventData' => '',
'eventId' => '',
'eventReferences' => [
[
'relatedItemId' => '',
'resource' => ''
]
],
'eventTime' => '',
'eventType' => '',
'incidentRecordArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/updateTimelineEvent');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/updateTimelineEvent' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"clientToken": "",
"eventData": "",
"eventId": "",
"eventReferences": [
{
"relatedItemId": "",
"resource": ""
}
],
"eventTime": "",
"eventType": "",
"incidentRecordArn": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/updateTimelineEvent' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"clientToken": "",
"eventData": "",
"eventId": "",
"eventReferences": [
{
"relatedItemId": "",
"resource": ""
}
],
"eventTime": "",
"eventType": "",
"incidentRecordArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"clientToken\": \"\",\n \"eventData\": \"\",\n \"eventId\": \"\",\n \"eventReferences\": [\n {\n \"relatedItemId\": \"\",\n \"resource\": \"\"\n }\n ],\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"incidentRecordArn\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/updateTimelineEvent", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/updateTimelineEvent"
payload = {
"clientToken": "",
"eventData": "",
"eventId": "",
"eventReferences": [
{
"relatedItemId": "",
"resource": ""
}
],
"eventTime": "",
"eventType": "",
"incidentRecordArn": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/updateTimelineEvent"
payload <- "{\n \"clientToken\": \"\",\n \"eventData\": \"\",\n \"eventId\": \"\",\n \"eventReferences\": [\n {\n \"relatedItemId\": \"\",\n \"resource\": \"\"\n }\n ],\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"incidentRecordArn\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/updateTimelineEvent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"clientToken\": \"\",\n \"eventData\": \"\",\n \"eventId\": \"\",\n \"eventReferences\": [\n {\n \"relatedItemId\": \"\",\n \"resource\": \"\"\n }\n ],\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"incidentRecordArn\": \"\"\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/updateTimelineEvent') do |req|
req.body = "{\n \"clientToken\": \"\",\n \"eventData\": \"\",\n \"eventId\": \"\",\n \"eventReferences\": [\n {\n \"relatedItemId\": \"\",\n \"resource\": \"\"\n }\n ],\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"incidentRecordArn\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/updateTimelineEvent";
let payload = json!({
"clientToken": "",
"eventData": "",
"eventId": "",
"eventReferences": (
json!({
"relatedItemId": "",
"resource": ""
})
),
"eventTime": "",
"eventType": "",
"incidentRecordArn": ""
});
let mut headers = reqwest::header::HeaderMap::new();
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}}/updateTimelineEvent \
--header 'content-type: application/json' \
--data '{
"clientToken": "",
"eventData": "",
"eventId": "",
"eventReferences": [
{
"relatedItemId": "",
"resource": ""
}
],
"eventTime": "",
"eventType": "",
"incidentRecordArn": ""
}'
echo '{
"clientToken": "",
"eventData": "",
"eventId": "",
"eventReferences": [
{
"relatedItemId": "",
"resource": ""
}
],
"eventTime": "",
"eventType": "",
"incidentRecordArn": ""
}' | \
http POST {{baseUrl}}/updateTimelineEvent \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "clientToken": "",\n "eventData": "",\n "eventId": "",\n "eventReferences": [\n {\n "relatedItemId": "",\n "resource": ""\n }\n ],\n "eventTime": "",\n "eventType": "",\n "incidentRecordArn": ""\n}' \
--output-document \
- {{baseUrl}}/updateTimelineEvent
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"clientToken": "",
"eventData": "",
"eventId": "",
"eventReferences": [
[
"relatedItemId": "",
"resource": ""
]
],
"eventTime": "",
"eventType": "",
"incidentRecordArn": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/updateTimelineEvent")! 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()