AWS IoT Secure Tunneling
POST
CloseTunnel
{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.CloseTunnel
HEADERS
X-Amz-Target
BODY json
{
"tunnelId": "",
"delete": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.CloseTunnel");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"tunnelId\": \"\",\n \"delete\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.CloseTunnel" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:tunnelId ""
:delete ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.CloseTunnel"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"tunnelId\": \"\",\n \"delete\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.CloseTunnel"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"tunnelId\": \"\",\n \"delete\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.CloseTunnel");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"tunnelId\": \"\",\n \"delete\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.CloseTunnel"
payload := strings.NewReader("{\n \"tunnelId\": \"\",\n \"delete\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 36
{
"tunnelId": "",
"delete": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.CloseTunnel")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"tunnelId\": \"\",\n \"delete\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.CloseTunnel"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"tunnelId\": \"\",\n \"delete\": \"\"\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 \"tunnelId\": \"\",\n \"delete\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.CloseTunnel")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.CloseTunnel")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"tunnelId\": \"\",\n \"delete\": \"\"\n}")
.asString();
const data = JSON.stringify({
tunnelId: '',
delete: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.CloseTunnel');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.CloseTunnel',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {tunnelId: '', delete: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.CloseTunnel';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"tunnelId":"","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}}/#X-Amz-Target=IoTSecuredTunneling.CloseTunnel',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "tunnelId": "",\n "delete": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"tunnelId\": \"\",\n \"delete\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.CloseTunnel")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({tunnelId: '', delete: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.CloseTunnel',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {tunnelId: '', delete: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.CloseTunnel');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
tunnelId: '',
delete: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.CloseTunnel',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {tunnelId: '', delete: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.CloseTunnel';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"tunnelId":"","delete":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"tunnelId": @"",
@"delete": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.CloseTunnel"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.CloseTunnel" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"tunnelId\": \"\",\n \"delete\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.CloseTunnel",
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([
'tunnelId' => '',
'delete' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.CloseTunnel', [
'body' => '{
"tunnelId": "",
"delete": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.CloseTunnel');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'tunnelId' => '',
'delete' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'tunnelId' => '',
'delete' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.CloseTunnel');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.CloseTunnel' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"tunnelId": "",
"delete": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.CloseTunnel' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"tunnelId": "",
"delete": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"tunnelId\": \"\",\n \"delete\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.CloseTunnel"
payload = {
"tunnelId": "",
"delete": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.CloseTunnel"
payload <- "{\n \"tunnelId\": \"\",\n \"delete\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.CloseTunnel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"tunnelId\": \"\",\n \"delete\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"tunnelId\": \"\",\n \"delete\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.CloseTunnel";
let payload = json!({
"tunnelId": "",
"delete": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.CloseTunnel' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"tunnelId": "",
"delete": ""
}'
echo '{
"tunnelId": "",
"delete": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.CloseTunnel' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "tunnelId": "",\n "delete": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.CloseTunnel'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"tunnelId": "",
"delete": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.CloseTunnel")! 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
DescribeTunnel
{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.DescribeTunnel
HEADERS
X-Amz-Target
BODY json
{
"tunnelId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.DescribeTunnel");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"tunnelId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.DescribeTunnel" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:tunnelId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.DescribeTunnel"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"tunnelId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.DescribeTunnel"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"tunnelId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.DescribeTunnel");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"tunnelId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.DescribeTunnel"
payload := strings.NewReader("{\n \"tunnelId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 20
{
"tunnelId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.DescribeTunnel")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"tunnelId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.DescribeTunnel"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"tunnelId\": \"\"\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 \"tunnelId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.DescribeTunnel")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.DescribeTunnel")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"tunnelId\": \"\"\n}")
.asString();
const data = JSON.stringify({
tunnelId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.DescribeTunnel');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.DescribeTunnel',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {tunnelId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.DescribeTunnel';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"tunnelId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.DescribeTunnel',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "tunnelId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"tunnelId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.DescribeTunnel")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({tunnelId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.DescribeTunnel',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {tunnelId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.DescribeTunnel');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
tunnelId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.DescribeTunnel',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {tunnelId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.DescribeTunnel';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"tunnelId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"tunnelId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.DescribeTunnel"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.DescribeTunnel" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"tunnelId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.DescribeTunnel",
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([
'tunnelId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.DescribeTunnel', [
'body' => '{
"tunnelId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.DescribeTunnel');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'tunnelId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'tunnelId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.DescribeTunnel');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.DescribeTunnel' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"tunnelId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.DescribeTunnel' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"tunnelId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"tunnelId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.DescribeTunnel"
payload = { "tunnelId": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.DescribeTunnel"
payload <- "{\n \"tunnelId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.DescribeTunnel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"tunnelId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"tunnelId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.DescribeTunnel";
let payload = json!({"tunnelId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.DescribeTunnel' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"tunnelId": ""
}'
echo '{
"tunnelId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.DescribeTunnel' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "tunnelId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.DescribeTunnel'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["tunnelId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.DescribeTunnel")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
ListTagsForResource
{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTagsForResource
HEADERS
X-Amz-Target
BODY json
{
"resourceArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTagsForResource");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"resourceArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTagsForResource" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:resourceArn ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTagsForResource"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\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}}/#X-Amz-Target=IoTSecuredTunneling.ListTagsForResource"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\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}}/#X-Amz-Target=IoTSecuredTunneling.ListTagsForResource");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"resourceArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTagsForResource"
payload := strings.NewReader("{\n \"resourceArn\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 23
{
"resourceArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTagsForResource")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"resourceArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTagsForResource"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\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 \"resourceArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTagsForResource")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTagsForResource")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"resourceArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
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}}/#X-Amz-Target=IoTSecuredTunneling.ListTagsForResource');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTagsForResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {resourceArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTagsForResource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"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}}/#X-Amz-Target=IoTSecuredTunneling.ListTagsForResource',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\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 \"resourceArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTagsForResource")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({resourceArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTagsForResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {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}}/#X-Amz-Target=IoTSecuredTunneling.ListTagsForResource');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
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}}/#X-Amz-Target=IoTSecuredTunneling.ListTagsForResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {resourceArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTagsForResource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"resourceArn":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"resourceArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTagsForResource"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTagsForResource" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"resourceArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTagsForResource",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'resourceArn' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTagsForResource', [
'body' => '{
"resourceArn": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTagsForResource');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'resourceArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'resourceArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTagsForResource');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTagsForResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"resourceArn": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTagsForResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"resourceArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"resourceArn\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTagsForResource"
payload = { "resourceArn": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTagsForResource"
payload <- "{\n \"resourceArn\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTagsForResource")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"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/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\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}}/#X-Amz-Target=IoTSecuredTunneling.ListTagsForResource";
let payload = json!({"resourceArn": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTagsForResource' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"resourceArn": ""
}'
echo '{
"resourceArn": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTagsForResource' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "resourceArn": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTagsForResource'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["resourceArn": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTagsForResource")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
ListTunnels
{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTunnels
HEADERS
X-Amz-Target
BODY json
{
"thingName": "",
"maxResults": "",
"nextToken": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTunnels");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"thingName\": \"\",\n \"maxResults\": \"\",\n \"nextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTunnels" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:thingName ""
:maxResults ""
:nextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTunnels"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"thingName\": \"\",\n \"maxResults\": \"\",\n \"nextToken\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTunnels"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"thingName\": \"\",\n \"maxResults\": \"\",\n \"nextToken\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTunnels");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"thingName\": \"\",\n \"maxResults\": \"\",\n \"nextToken\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTunnels"
payload := strings.NewReader("{\n \"thingName\": \"\",\n \"maxResults\": \"\",\n \"nextToken\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 60
{
"thingName": "",
"maxResults": "",
"nextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTunnels")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"thingName\": \"\",\n \"maxResults\": \"\",\n \"nextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTunnels"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"thingName\": \"\",\n \"maxResults\": \"\",\n \"nextToken\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"thingName\": \"\",\n \"maxResults\": \"\",\n \"nextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTunnels")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTunnels")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"thingName\": \"\",\n \"maxResults\": \"\",\n \"nextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
thingName: '',
maxResults: '',
nextToken: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTunnels');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTunnels',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {thingName: '', maxResults: '', nextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTunnels';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"thingName":"","maxResults":"","nextToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTunnels',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "thingName": "",\n "maxResults": "",\n "nextToken": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"thingName\": \"\",\n \"maxResults\": \"\",\n \"nextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTunnels")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({thingName: '', maxResults: '', nextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTunnels',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {thingName: '', maxResults: '', nextToken: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTunnels');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
thingName: '',
maxResults: '',
nextToken: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTunnels',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {thingName: '', maxResults: '', nextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTunnels';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"thingName":"","maxResults":"","nextToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"thingName": @"",
@"maxResults": @"",
@"nextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTunnels"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTunnels" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"thingName\": \"\",\n \"maxResults\": \"\",\n \"nextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTunnels",
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([
'thingName' => '',
'maxResults' => '',
'nextToken' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTunnels', [
'body' => '{
"thingName": "",
"maxResults": "",
"nextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTunnels');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'thingName' => '',
'maxResults' => '',
'nextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'thingName' => '',
'maxResults' => '',
'nextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTunnels');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTunnels' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"thingName": "",
"maxResults": "",
"nextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTunnels' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"thingName": "",
"maxResults": "",
"nextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"thingName\": \"\",\n \"maxResults\": \"\",\n \"nextToken\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTunnels"
payload = {
"thingName": "",
"maxResults": "",
"nextToken": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTunnels"
payload <- "{\n \"thingName\": \"\",\n \"maxResults\": \"\",\n \"nextToken\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTunnels")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"thingName\": \"\",\n \"maxResults\": \"\",\n \"nextToken\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"thingName\": \"\",\n \"maxResults\": \"\",\n \"nextToken\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTunnels";
let payload = json!({
"thingName": "",
"maxResults": "",
"nextToken": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTunnels' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"thingName": "",
"maxResults": "",
"nextToken": ""
}'
echo '{
"thingName": "",
"maxResults": "",
"nextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTunnels' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "thingName": "",\n "maxResults": "",\n "nextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTunnels'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"thingName": "",
"maxResults": "",
"nextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.ListTunnels")! 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
OpenTunnel
{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.OpenTunnel
HEADERS
X-Amz-Target
BODY json
{
"description": "",
"tags": "",
"destinationConfig": "",
"timeoutConfig": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.OpenTunnel");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"description\": \"\",\n \"tags\": \"\",\n \"destinationConfig\": \"\",\n \"timeoutConfig\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.OpenTunnel" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:description ""
:tags ""
:destinationConfig ""
:timeoutConfig ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.OpenTunnel"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"description\": \"\",\n \"tags\": \"\",\n \"destinationConfig\": \"\",\n \"timeoutConfig\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.OpenTunnel"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"description\": \"\",\n \"tags\": \"\",\n \"destinationConfig\": \"\",\n \"timeoutConfig\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.OpenTunnel");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"description\": \"\",\n \"tags\": \"\",\n \"destinationConfig\": \"\",\n \"timeoutConfig\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.OpenTunnel"
payload := strings.NewReader("{\n \"description\": \"\",\n \"tags\": \"\",\n \"destinationConfig\": \"\",\n \"timeoutConfig\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 87
{
"description": "",
"tags": "",
"destinationConfig": "",
"timeoutConfig": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.OpenTunnel")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"description\": \"\",\n \"tags\": \"\",\n \"destinationConfig\": \"\",\n \"timeoutConfig\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.OpenTunnel"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"description\": \"\",\n \"tags\": \"\",\n \"destinationConfig\": \"\",\n \"timeoutConfig\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"description\": \"\",\n \"tags\": \"\",\n \"destinationConfig\": \"\",\n \"timeoutConfig\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.OpenTunnel")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.OpenTunnel")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"description\": \"\",\n \"tags\": \"\",\n \"destinationConfig\": \"\",\n \"timeoutConfig\": \"\"\n}")
.asString();
const data = JSON.stringify({
description: '',
tags: '',
destinationConfig: '',
timeoutConfig: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.OpenTunnel');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.OpenTunnel',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {description: '', tags: '', destinationConfig: '', timeoutConfig: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.OpenTunnel';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"description":"","tags":"","destinationConfig":"","timeoutConfig":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.OpenTunnel',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "description": "",\n "tags": "",\n "destinationConfig": "",\n "timeoutConfig": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"description\": \"\",\n \"tags\": \"\",\n \"destinationConfig\": \"\",\n \"timeoutConfig\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.OpenTunnel")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({description: '', tags: '', destinationConfig: '', timeoutConfig: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.OpenTunnel',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {description: '', tags: '', destinationConfig: '', timeoutConfig: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.OpenTunnel');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
description: '',
tags: '',
destinationConfig: '',
timeoutConfig: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.OpenTunnel',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {description: '', tags: '', destinationConfig: '', timeoutConfig: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.OpenTunnel';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"description":"","tags":"","destinationConfig":"","timeoutConfig":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"description": @"",
@"tags": @"",
@"destinationConfig": @"",
@"timeoutConfig": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.OpenTunnel"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.OpenTunnel" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"description\": \"\",\n \"tags\": \"\",\n \"destinationConfig\": \"\",\n \"timeoutConfig\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.OpenTunnel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'description' => '',
'tags' => '',
'destinationConfig' => '',
'timeoutConfig' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.OpenTunnel', [
'body' => '{
"description": "",
"tags": "",
"destinationConfig": "",
"timeoutConfig": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.OpenTunnel');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'description' => '',
'tags' => '',
'destinationConfig' => '',
'timeoutConfig' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'description' => '',
'tags' => '',
'destinationConfig' => '',
'timeoutConfig' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.OpenTunnel');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.OpenTunnel' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"description": "",
"tags": "",
"destinationConfig": "",
"timeoutConfig": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.OpenTunnel' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"description": "",
"tags": "",
"destinationConfig": "",
"timeoutConfig": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"description\": \"\",\n \"tags\": \"\",\n \"destinationConfig\": \"\",\n \"timeoutConfig\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.OpenTunnel"
payload = {
"description": "",
"tags": "",
"destinationConfig": "",
"timeoutConfig": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.OpenTunnel"
payload <- "{\n \"description\": \"\",\n \"tags\": \"\",\n \"destinationConfig\": \"\",\n \"timeoutConfig\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.OpenTunnel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"description\": \"\",\n \"tags\": \"\",\n \"destinationConfig\": \"\",\n \"timeoutConfig\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"description\": \"\",\n \"tags\": \"\",\n \"destinationConfig\": \"\",\n \"timeoutConfig\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.OpenTunnel";
let payload = json!({
"description": "",
"tags": "",
"destinationConfig": "",
"timeoutConfig": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.OpenTunnel' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"description": "",
"tags": "",
"destinationConfig": "",
"timeoutConfig": ""
}'
echo '{
"description": "",
"tags": "",
"destinationConfig": "",
"timeoutConfig": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.OpenTunnel' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "description": "",\n "tags": "",\n "destinationConfig": "",\n "timeoutConfig": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.OpenTunnel'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"description": "",
"tags": "",
"destinationConfig": "",
"timeoutConfig": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.OpenTunnel")! 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
RotateTunnelAccessToken
{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.RotateTunnelAccessToken
HEADERS
X-Amz-Target
BODY json
{
"tunnelId": "",
"clientMode": "",
"destinationConfig": {
"thingName": "",
"services": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.RotateTunnelAccessToken");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"tunnelId\": \"\",\n \"clientMode\": \"\",\n \"destinationConfig\": {\n \"thingName\": \"\",\n \"services\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.RotateTunnelAccessToken" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:tunnelId ""
:clientMode ""
:destinationConfig {:thingName ""
:services ""}}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.RotateTunnelAccessToken"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"tunnelId\": \"\",\n \"clientMode\": \"\",\n \"destinationConfig\": {\n \"thingName\": \"\",\n \"services\": \"\"\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.RotateTunnelAccessToken"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"tunnelId\": \"\",\n \"clientMode\": \"\",\n \"destinationConfig\": {\n \"thingName\": \"\",\n \"services\": \"\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.RotateTunnelAccessToken");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"tunnelId\": \"\",\n \"clientMode\": \"\",\n \"destinationConfig\": {\n \"thingName\": \"\",\n \"services\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.RotateTunnelAccessToken"
payload := strings.NewReader("{\n \"tunnelId\": \"\",\n \"clientMode\": \"\",\n \"destinationConfig\": {\n \"thingName\": \"\",\n \"services\": \"\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 110
{
"tunnelId": "",
"clientMode": "",
"destinationConfig": {
"thingName": "",
"services": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.RotateTunnelAccessToken")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"tunnelId\": \"\",\n \"clientMode\": \"\",\n \"destinationConfig\": {\n \"thingName\": \"\",\n \"services\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.RotateTunnelAccessToken"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"tunnelId\": \"\",\n \"clientMode\": \"\",\n \"destinationConfig\": {\n \"thingName\": \"\",\n \"services\": \"\"\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 \"tunnelId\": \"\",\n \"clientMode\": \"\",\n \"destinationConfig\": {\n \"thingName\": \"\",\n \"services\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.RotateTunnelAccessToken")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.RotateTunnelAccessToken")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"tunnelId\": \"\",\n \"clientMode\": \"\",\n \"destinationConfig\": {\n \"thingName\": \"\",\n \"services\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
tunnelId: '',
clientMode: '',
destinationConfig: {
thingName: '',
services: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.RotateTunnelAccessToken');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.RotateTunnelAccessToken',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {tunnelId: '', clientMode: '', destinationConfig: {thingName: '', services: ''}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.RotateTunnelAccessToken';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"tunnelId":"","clientMode":"","destinationConfig":{"thingName":"","services":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.RotateTunnelAccessToken',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "tunnelId": "",\n "clientMode": "",\n "destinationConfig": {\n "thingName": "",\n "services": ""\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 \"tunnelId\": \"\",\n \"clientMode\": \"\",\n \"destinationConfig\": {\n \"thingName\": \"\",\n \"services\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.RotateTunnelAccessToken")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({tunnelId: '', clientMode: '', destinationConfig: {thingName: '', services: ''}}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.RotateTunnelAccessToken',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {tunnelId: '', clientMode: '', destinationConfig: {thingName: '', services: ''}},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.RotateTunnelAccessToken');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
tunnelId: '',
clientMode: '',
destinationConfig: {
thingName: '',
services: ''
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.RotateTunnelAccessToken',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {tunnelId: '', clientMode: '', destinationConfig: {thingName: '', services: ''}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.RotateTunnelAccessToken';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"tunnelId":"","clientMode":"","destinationConfig":{"thingName":"","services":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"tunnelId": @"",
@"clientMode": @"",
@"destinationConfig": @{ @"thingName": @"", @"services": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.RotateTunnelAccessToken"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.RotateTunnelAccessToken" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"tunnelId\": \"\",\n \"clientMode\": \"\",\n \"destinationConfig\": {\n \"thingName\": \"\",\n \"services\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.RotateTunnelAccessToken",
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([
'tunnelId' => '',
'clientMode' => '',
'destinationConfig' => [
'thingName' => '',
'services' => ''
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.RotateTunnelAccessToken', [
'body' => '{
"tunnelId": "",
"clientMode": "",
"destinationConfig": {
"thingName": "",
"services": ""
}
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.RotateTunnelAccessToken');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'tunnelId' => '',
'clientMode' => '',
'destinationConfig' => [
'thingName' => '',
'services' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'tunnelId' => '',
'clientMode' => '',
'destinationConfig' => [
'thingName' => '',
'services' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.RotateTunnelAccessToken');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.RotateTunnelAccessToken' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"tunnelId": "",
"clientMode": "",
"destinationConfig": {
"thingName": "",
"services": ""
}
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.RotateTunnelAccessToken' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"tunnelId": "",
"clientMode": "",
"destinationConfig": {
"thingName": "",
"services": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"tunnelId\": \"\",\n \"clientMode\": \"\",\n \"destinationConfig\": {\n \"thingName\": \"\",\n \"services\": \"\"\n }\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.RotateTunnelAccessToken"
payload = {
"tunnelId": "",
"clientMode": "",
"destinationConfig": {
"thingName": "",
"services": ""
}
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.RotateTunnelAccessToken"
payload <- "{\n \"tunnelId\": \"\",\n \"clientMode\": \"\",\n \"destinationConfig\": {\n \"thingName\": \"\",\n \"services\": \"\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.RotateTunnelAccessToken")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"tunnelId\": \"\",\n \"clientMode\": \"\",\n \"destinationConfig\": {\n \"thingName\": \"\",\n \"services\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"tunnelId\": \"\",\n \"clientMode\": \"\",\n \"destinationConfig\": {\n \"thingName\": \"\",\n \"services\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.RotateTunnelAccessToken";
let payload = json!({
"tunnelId": "",
"clientMode": "",
"destinationConfig": json!({
"thingName": "",
"services": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.RotateTunnelAccessToken' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"tunnelId": "",
"clientMode": "",
"destinationConfig": {
"thingName": "",
"services": ""
}
}'
echo '{
"tunnelId": "",
"clientMode": "",
"destinationConfig": {
"thingName": "",
"services": ""
}
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.RotateTunnelAccessToken' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "tunnelId": "",\n "clientMode": "",\n "destinationConfig": {\n "thingName": "",\n "services": ""\n }\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.RotateTunnelAccessToken'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"tunnelId": "",
"clientMode": "",
"destinationConfig": [
"thingName": "",
"services": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.RotateTunnelAccessToken")! 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}}/#X-Amz-Target=IoTSecuredTunneling.TagResource
HEADERS
X-Amz-Target
BODY json
{
"resourceArn": "",
"tags": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.TagResource");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"resourceArn\": \"\",\n \"tags\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.TagResource" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:resourceArn ""
:tags ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.TagResource"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"resourceArn\": \"\",\n \"tags\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.TagResource"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"resourceArn\": \"\",\n \"tags\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.TagResource");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"resourceArn\": \"\",\n \"tags\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.TagResource"
payload := strings.NewReader("{\n \"resourceArn\": \"\",\n \"tags\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 37
{
"resourceArn": "",
"tags": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.TagResource")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"resourceArn\": \"\",\n \"tags\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.TagResource"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"resourceArn\": \"\",\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 \"resourceArn\": \"\",\n \"tags\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.TagResource")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.TagResource")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"resourceArn\": \"\",\n \"tags\": \"\"\n}")
.asString();
const data = JSON.stringify({
resourceArn: '',
tags: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.TagResource');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.TagResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {resourceArn: '', tags: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.TagResource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"resourceArn":"","tags":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.TagResource',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "resourceArn": "",\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 \"resourceArn\": \"\",\n \"tags\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.TagResource")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({resourceArn: '', tags: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.TagResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {resourceArn: '', tags: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.TagResource');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
resourceArn: '',
tags: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.TagResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {resourceArn: '', tags: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.TagResource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"resourceArn":"","tags":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"resourceArn": @"",
@"tags": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.TagResource"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.TagResource" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"resourceArn\": \"\",\n \"tags\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.TagResource",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'resourceArn' => '',
'tags' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.TagResource', [
'body' => '{
"resourceArn": "",
"tags": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.TagResource');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'resourceArn' => '',
'tags' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'resourceArn' => '',
'tags' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.TagResource');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.TagResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"resourceArn": "",
"tags": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.TagResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"resourceArn": "",
"tags": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"resourceArn\": \"\",\n \"tags\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.TagResource"
payload = {
"resourceArn": "",
"tags": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.TagResource"
payload <- "{\n \"resourceArn\": \"\",\n \"tags\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.TagResource")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"resourceArn\": \"\",\n \"tags\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"resourceArn\": \"\",\n \"tags\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.TagResource";
let payload = json!({
"resourceArn": "",
"tags": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.TagResource' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"resourceArn": "",
"tags": ""
}'
echo '{
"resourceArn": "",
"tags": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.TagResource' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "resourceArn": "",\n "tags": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.TagResource'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"resourceArn": "",
"tags": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.TagResource")! 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
UntagResource
{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.UntagResource
HEADERS
X-Amz-Target
BODY json
{
"resourceArn": "",
"tagKeys": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.UntagResource");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"resourceArn\": \"\",\n \"tagKeys\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.UntagResource" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:resourceArn ""
:tagKeys ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.UntagResource"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"resourceArn\": \"\",\n \"tagKeys\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.UntagResource"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"resourceArn\": \"\",\n \"tagKeys\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.UntagResource");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"resourceArn\": \"\",\n \"tagKeys\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.UntagResource"
payload := strings.NewReader("{\n \"resourceArn\": \"\",\n \"tagKeys\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 40
{
"resourceArn": "",
"tagKeys": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.UntagResource")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"resourceArn\": \"\",\n \"tagKeys\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.UntagResource"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"resourceArn\": \"\",\n \"tagKeys\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"resourceArn\": \"\",\n \"tagKeys\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.UntagResource")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.UntagResource")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"resourceArn\": \"\",\n \"tagKeys\": \"\"\n}")
.asString();
const data = JSON.stringify({
resourceArn: '',
tagKeys: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.UntagResource');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.UntagResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {resourceArn: '', tagKeys: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.UntagResource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"resourceArn":"","tagKeys":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.UntagResource',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "resourceArn": "",\n "tagKeys": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"resourceArn\": \"\",\n \"tagKeys\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.UntagResource")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({resourceArn: '', tagKeys: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.UntagResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {resourceArn: '', tagKeys: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.UntagResource');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
resourceArn: '',
tagKeys: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.UntagResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {resourceArn: '', tagKeys: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.UntagResource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"resourceArn":"","tagKeys":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"resourceArn": @"",
@"tagKeys": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.UntagResource"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.UntagResource" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"resourceArn\": \"\",\n \"tagKeys\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.UntagResource",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'resourceArn' => '',
'tagKeys' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.UntagResource', [
'body' => '{
"resourceArn": "",
"tagKeys": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.UntagResource');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'resourceArn' => '',
'tagKeys' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'resourceArn' => '',
'tagKeys' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.UntagResource');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.UntagResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"resourceArn": "",
"tagKeys": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.UntagResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"resourceArn": "",
"tagKeys": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"resourceArn\": \"\",\n \"tagKeys\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.UntagResource"
payload = {
"resourceArn": "",
"tagKeys": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.UntagResource"
payload <- "{\n \"resourceArn\": \"\",\n \"tagKeys\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.UntagResource")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"resourceArn\": \"\",\n \"tagKeys\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"resourceArn\": \"\",\n \"tagKeys\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.UntagResource";
let payload = json!({
"resourceArn": "",
"tagKeys": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.UntagResource' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"resourceArn": "",
"tagKeys": ""
}'
echo '{
"resourceArn": "",
"tagKeys": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.UntagResource' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "resourceArn": "",\n "tagKeys": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.UntagResource'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"resourceArn": "",
"tagKeys": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=IoTSecuredTunneling.UntagResource")! 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()