AWS Savings Plans
POST
CreateSavingsPlan
{{baseUrl}}/CreateSavingsPlan
BODY json
{
"savingsPlanOfferingId": "",
"commitment": "",
"upfrontPaymentAmount": "",
"purchaseTime": "",
"clientToken": "",
"tags": {}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/CreateSavingsPlan");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"savingsPlanOfferingId\": \"\",\n \"commitment\": \"\",\n \"upfrontPaymentAmount\": \"\",\n \"purchaseTime\": \"\",\n \"clientToken\": \"\",\n \"tags\": {}\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/CreateSavingsPlan" {:content-type :json
:form-params {:savingsPlanOfferingId ""
:commitment ""
:upfrontPaymentAmount ""
:purchaseTime ""
:clientToken ""
:tags {}}})
require "http/client"
url = "{{baseUrl}}/CreateSavingsPlan"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"savingsPlanOfferingId\": \"\",\n \"commitment\": \"\",\n \"upfrontPaymentAmount\": \"\",\n \"purchaseTime\": \"\",\n \"clientToken\": \"\",\n \"tags\": {}\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/CreateSavingsPlan"),
Content = new StringContent("{\n \"savingsPlanOfferingId\": \"\",\n \"commitment\": \"\",\n \"upfrontPaymentAmount\": \"\",\n \"purchaseTime\": \"\",\n \"clientToken\": \"\",\n \"tags\": {}\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/CreateSavingsPlan");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"savingsPlanOfferingId\": \"\",\n \"commitment\": \"\",\n \"upfrontPaymentAmount\": \"\",\n \"purchaseTime\": \"\",\n \"clientToken\": \"\",\n \"tags\": {}\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/CreateSavingsPlan"
payload := strings.NewReader("{\n \"savingsPlanOfferingId\": \"\",\n \"commitment\": \"\",\n \"upfrontPaymentAmount\": \"\",\n \"purchaseTime\": \"\",\n \"clientToken\": \"\",\n \"tags\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/CreateSavingsPlan HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 140
{
"savingsPlanOfferingId": "",
"commitment": "",
"upfrontPaymentAmount": "",
"purchaseTime": "",
"clientToken": "",
"tags": {}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/CreateSavingsPlan")
.setHeader("content-type", "application/json")
.setBody("{\n \"savingsPlanOfferingId\": \"\",\n \"commitment\": \"\",\n \"upfrontPaymentAmount\": \"\",\n \"purchaseTime\": \"\",\n \"clientToken\": \"\",\n \"tags\": {}\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/CreateSavingsPlan"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"savingsPlanOfferingId\": \"\",\n \"commitment\": \"\",\n \"upfrontPaymentAmount\": \"\",\n \"purchaseTime\": \"\",\n \"clientToken\": \"\",\n \"tags\": {}\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"savingsPlanOfferingId\": \"\",\n \"commitment\": \"\",\n \"upfrontPaymentAmount\": \"\",\n \"purchaseTime\": \"\",\n \"clientToken\": \"\",\n \"tags\": {}\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/CreateSavingsPlan")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/CreateSavingsPlan")
.header("content-type", "application/json")
.body("{\n \"savingsPlanOfferingId\": \"\",\n \"commitment\": \"\",\n \"upfrontPaymentAmount\": \"\",\n \"purchaseTime\": \"\",\n \"clientToken\": \"\",\n \"tags\": {}\n}")
.asString();
const data = JSON.stringify({
savingsPlanOfferingId: '',
commitment: '',
upfrontPaymentAmount: '',
purchaseTime: '',
clientToken: '',
tags: {}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/CreateSavingsPlan');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/CreateSavingsPlan',
headers: {'content-type': 'application/json'},
data: {
savingsPlanOfferingId: '',
commitment: '',
upfrontPaymentAmount: '',
purchaseTime: '',
clientToken: '',
tags: {}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/CreateSavingsPlan';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"savingsPlanOfferingId":"","commitment":"","upfrontPaymentAmount":"","purchaseTime":"","clientToken":"","tags":{}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/CreateSavingsPlan',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "savingsPlanOfferingId": "",\n "commitment": "",\n "upfrontPaymentAmount": "",\n "purchaseTime": "",\n "clientToken": "",\n "tags": {}\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"savingsPlanOfferingId\": \"\",\n \"commitment\": \"\",\n \"upfrontPaymentAmount\": \"\",\n \"purchaseTime\": \"\",\n \"clientToken\": \"\",\n \"tags\": {}\n}")
val request = Request.Builder()
.url("{{baseUrl}}/CreateSavingsPlan")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/CreateSavingsPlan',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
savingsPlanOfferingId: '',
commitment: '',
upfrontPaymentAmount: '',
purchaseTime: '',
clientToken: '',
tags: {}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/CreateSavingsPlan',
headers: {'content-type': 'application/json'},
body: {
savingsPlanOfferingId: '',
commitment: '',
upfrontPaymentAmount: '',
purchaseTime: '',
clientToken: '',
tags: {}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/CreateSavingsPlan');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
savingsPlanOfferingId: '',
commitment: '',
upfrontPaymentAmount: '',
purchaseTime: '',
clientToken: '',
tags: {}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/CreateSavingsPlan',
headers: {'content-type': 'application/json'},
data: {
savingsPlanOfferingId: '',
commitment: '',
upfrontPaymentAmount: '',
purchaseTime: '',
clientToken: '',
tags: {}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/CreateSavingsPlan';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"savingsPlanOfferingId":"","commitment":"","upfrontPaymentAmount":"","purchaseTime":"","clientToken":"","tags":{}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"savingsPlanOfferingId": @"",
@"commitment": @"",
@"upfrontPaymentAmount": @"",
@"purchaseTime": @"",
@"clientToken": @"",
@"tags": @{ } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/CreateSavingsPlan"]
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}}/CreateSavingsPlan" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"savingsPlanOfferingId\": \"\",\n \"commitment\": \"\",\n \"upfrontPaymentAmount\": \"\",\n \"purchaseTime\": \"\",\n \"clientToken\": \"\",\n \"tags\": {}\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/CreateSavingsPlan",
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([
'savingsPlanOfferingId' => '',
'commitment' => '',
'upfrontPaymentAmount' => '',
'purchaseTime' => '',
'clientToken' => '',
'tags' => [
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/CreateSavingsPlan', [
'body' => '{
"savingsPlanOfferingId": "",
"commitment": "",
"upfrontPaymentAmount": "",
"purchaseTime": "",
"clientToken": "",
"tags": {}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/CreateSavingsPlan');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'savingsPlanOfferingId' => '',
'commitment' => '',
'upfrontPaymentAmount' => '',
'purchaseTime' => '',
'clientToken' => '',
'tags' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'savingsPlanOfferingId' => '',
'commitment' => '',
'upfrontPaymentAmount' => '',
'purchaseTime' => '',
'clientToken' => '',
'tags' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/CreateSavingsPlan');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/CreateSavingsPlan' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"savingsPlanOfferingId": "",
"commitment": "",
"upfrontPaymentAmount": "",
"purchaseTime": "",
"clientToken": "",
"tags": {}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/CreateSavingsPlan' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"savingsPlanOfferingId": "",
"commitment": "",
"upfrontPaymentAmount": "",
"purchaseTime": "",
"clientToken": "",
"tags": {}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"savingsPlanOfferingId\": \"\",\n \"commitment\": \"\",\n \"upfrontPaymentAmount\": \"\",\n \"purchaseTime\": \"\",\n \"clientToken\": \"\",\n \"tags\": {}\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/CreateSavingsPlan", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/CreateSavingsPlan"
payload = {
"savingsPlanOfferingId": "",
"commitment": "",
"upfrontPaymentAmount": "",
"purchaseTime": "",
"clientToken": "",
"tags": {}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/CreateSavingsPlan"
payload <- "{\n \"savingsPlanOfferingId\": \"\",\n \"commitment\": \"\",\n \"upfrontPaymentAmount\": \"\",\n \"purchaseTime\": \"\",\n \"clientToken\": \"\",\n \"tags\": {}\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/CreateSavingsPlan")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"savingsPlanOfferingId\": \"\",\n \"commitment\": \"\",\n \"upfrontPaymentAmount\": \"\",\n \"purchaseTime\": \"\",\n \"clientToken\": \"\",\n \"tags\": {}\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/CreateSavingsPlan') do |req|
req.body = "{\n \"savingsPlanOfferingId\": \"\",\n \"commitment\": \"\",\n \"upfrontPaymentAmount\": \"\",\n \"purchaseTime\": \"\",\n \"clientToken\": \"\",\n \"tags\": {}\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/CreateSavingsPlan";
let payload = json!({
"savingsPlanOfferingId": "",
"commitment": "",
"upfrontPaymentAmount": "",
"purchaseTime": "",
"clientToken": "",
"tags": json!({})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/CreateSavingsPlan \
--header 'content-type: application/json' \
--data '{
"savingsPlanOfferingId": "",
"commitment": "",
"upfrontPaymentAmount": "",
"purchaseTime": "",
"clientToken": "",
"tags": {}
}'
echo '{
"savingsPlanOfferingId": "",
"commitment": "",
"upfrontPaymentAmount": "",
"purchaseTime": "",
"clientToken": "",
"tags": {}
}' | \
http POST {{baseUrl}}/CreateSavingsPlan \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "savingsPlanOfferingId": "",\n "commitment": "",\n "upfrontPaymentAmount": "",\n "purchaseTime": "",\n "clientToken": "",\n "tags": {}\n}' \
--output-document \
- {{baseUrl}}/CreateSavingsPlan
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"savingsPlanOfferingId": "",
"commitment": "",
"upfrontPaymentAmount": "",
"purchaseTime": "",
"clientToken": "",
"tags": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/CreateSavingsPlan")! 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
DeleteQueuedSavingsPlan
{{baseUrl}}/DeleteQueuedSavingsPlan
BODY json
{
"savingsPlanId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/DeleteQueuedSavingsPlan");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"savingsPlanId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/DeleteQueuedSavingsPlan" {:content-type :json
:form-params {:savingsPlanId ""}})
require "http/client"
url = "{{baseUrl}}/DeleteQueuedSavingsPlan"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"savingsPlanId\": \"\"\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}}/DeleteQueuedSavingsPlan"),
Content = new StringContent("{\n \"savingsPlanId\": \"\"\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}}/DeleteQueuedSavingsPlan");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"savingsPlanId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/DeleteQueuedSavingsPlan"
payload := strings.NewReader("{\n \"savingsPlanId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/DeleteQueuedSavingsPlan HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 25
{
"savingsPlanId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/DeleteQueuedSavingsPlan")
.setHeader("content-type", "application/json")
.setBody("{\n \"savingsPlanId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/DeleteQueuedSavingsPlan"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"savingsPlanId\": \"\"\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 \"savingsPlanId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/DeleteQueuedSavingsPlan")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/DeleteQueuedSavingsPlan")
.header("content-type", "application/json")
.body("{\n \"savingsPlanId\": \"\"\n}")
.asString();
const data = JSON.stringify({
savingsPlanId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/DeleteQueuedSavingsPlan');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/DeleteQueuedSavingsPlan',
headers: {'content-type': 'application/json'},
data: {savingsPlanId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/DeleteQueuedSavingsPlan';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"savingsPlanId":""}'
};
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}}/DeleteQueuedSavingsPlan',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "savingsPlanId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"savingsPlanId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/DeleteQueuedSavingsPlan")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/DeleteQueuedSavingsPlan',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({savingsPlanId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/DeleteQueuedSavingsPlan',
headers: {'content-type': 'application/json'},
body: {savingsPlanId: ''},
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}}/DeleteQueuedSavingsPlan');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
savingsPlanId: ''
});
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}}/DeleteQueuedSavingsPlan',
headers: {'content-type': 'application/json'},
data: {savingsPlanId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/DeleteQueuedSavingsPlan';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"savingsPlanId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"savingsPlanId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/DeleteQueuedSavingsPlan"]
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}}/DeleteQueuedSavingsPlan" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"savingsPlanId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/DeleteQueuedSavingsPlan",
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([
'savingsPlanId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/DeleteQueuedSavingsPlan', [
'body' => '{
"savingsPlanId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/DeleteQueuedSavingsPlan');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'savingsPlanId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'savingsPlanId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/DeleteQueuedSavingsPlan');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/DeleteQueuedSavingsPlan' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"savingsPlanId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/DeleteQueuedSavingsPlan' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"savingsPlanId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"savingsPlanId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/DeleteQueuedSavingsPlan", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/DeleteQueuedSavingsPlan"
payload = { "savingsPlanId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/DeleteQueuedSavingsPlan"
payload <- "{\n \"savingsPlanId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/DeleteQueuedSavingsPlan")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"savingsPlanId\": \"\"\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/DeleteQueuedSavingsPlan') do |req|
req.body = "{\n \"savingsPlanId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/DeleteQueuedSavingsPlan";
let payload = json!({"savingsPlanId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/DeleteQueuedSavingsPlan \
--header 'content-type: application/json' \
--data '{
"savingsPlanId": ""
}'
echo '{
"savingsPlanId": ""
}' | \
http POST {{baseUrl}}/DeleteQueuedSavingsPlan \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "savingsPlanId": ""\n}' \
--output-document \
- {{baseUrl}}/DeleteQueuedSavingsPlan
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["savingsPlanId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/DeleteQueuedSavingsPlan")! 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
DescribeSavingsPlanRates
{{baseUrl}}/DescribeSavingsPlanRates
BODY json
{
"savingsPlanId": "",
"filters": [
{
"name": "",
"values": ""
}
],
"nextToken": "",
"maxResults": 0
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/DescribeSavingsPlanRates");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"savingsPlanId\": \"\",\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/DescribeSavingsPlanRates" {:content-type :json
:form-params {:savingsPlanId ""
:filters [{:name ""
:values ""}]
:nextToken ""
:maxResults 0}})
require "http/client"
url = "{{baseUrl}}/DescribeSavingsPlanRates"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"savingsPlanId\": \"\",\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\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}}/DescribeSavingsPlanRates"),
Content = new StringContent("{\n \"savingsPlanId\": \"\",\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\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}}/DescribeSavingsPlanRates");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"savingsPlanId\": \"\",\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/DescribeSavingsPlanRates"
payload := strings.NewReader("{\n \"savingsPlanId\": \"\",\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/DescribeSavingsPlanRates HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 132
{
"savingsPlanId": "",
"filters": [
{
"name": "",
"values": ""
}
],
"nextToken": "",
"maxResults": 0
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/DescribeSavingsPlanRates")
.setHeader("content-type", "application/json")
.setBody("{\n \"savingsPlanId\": \"\",\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/DescribeSavingsPlanRates"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"savingsPlanId\": \"\",\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\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 \"savingsPlanId\": \"\",\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/DescribeSavingsPlanRates")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/DescribeSavingsPlanRates")
.header("content-type", "application/json")
.body("{\n \"savingsPlanId\": \"\",\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\n}")
.asString();
const data = JSON.stringify({
savingsPlanId: '',
filters: [
{
name: '',
values: ''
}
],
nextToken: '',
maxResults: 0
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/DescribeSavingsPlanRates');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/DescribeSavingsPlanRates',
headers: {'content-type': 'application/json'},
data: {
savingsPlanId: '',
filters: [{name: '', values: ''}],
nextToken: '',
maxResults: 0
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/DescribeSavingsPlanRates';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"savingsPlanId":"","filters":[{"name":"","values":""}],"nextToken":"","maxResults":0}'
};
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}}/DescribeSavingsPlanRates',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "savingsPlanId": "",\n "filters": [\n {\n "name": "",\n "values": ""\n }\n ],\n "nextToken": "",\n "maxResults": 0\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"savingsPlanId\": \"\",\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\n}")
val request = Request.Builder()
.url("{{baseUrl}}/DescribeSavingsPlanRates")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/DescribeSavingsPlanRates',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
savingsPlanId: '',
filters: [{name: '', values: ''}],
nextToken: '',
maxResults: 0
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/DescribeSavingsPlanRates',
headers: {'content-type': 'application/json'},
body: {
savingsPlanId: '',
filters: [{name: '', values: ''}],
nextToken: '',
maxResults: 0
},
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}}/DescribeSavingsPlanRates');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
savingsPlanId: '',
filters: [
{
name: '',
values: ''
}
],
nextToken: '',
maxResults: 0
});
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}}/DescribeSavingsPlanRates',
headers: {'content-type': 'application/json'},
data: {
savingsPlanId: '',
filters: [{name: '', values: ''}],
nextToken: '',
maxResults: 0
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/DescribeSavingsPlanRates';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"savingsPlanId":"","filters":[{"name":"","values":""}],"nextToken":"","maxResults":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"savingsPlanId": @"",
@"filters": @[ @{ @"name": @"", @"values": @"" } ],
@"nextToken": @"",
@"maxResults": @0 };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/DescribeSavingsPlanRates"]
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}}/DescribeSavingsPlanRates" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"savingsPlanId\": \"\",\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/DescribeSavingsPlanRates",
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([
'savingsPlanId' => '',
'filters' => [
[
'name' => '',
'values' => ''
]
],
'nextToken' => '',
'maxResults' => 0
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/DescribeSavingsPlanRates', [
'body' => '{
"savingsPlanId": "",
"filters": [
{
"name": "",
"values": ""
}
],
"nextToken": "",
"maxResults": 0
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/DescribeSavingsPlanRates');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'savingsPlanId' => '',
'filters' => [
[
'name' => '',
'values' => ''
]
],
'nextToken' => '',
'maxResults' => 0
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'savingsPlanId' => '',
'filters' => [
[
'name' => '',
'values' => ''
]
],
'nextToken' => '',
'maxResults' => 0
]));
$request->setRequestUrl('{{baseUrl}}/DescribeSavingsPlanRates');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/DescribeSavingsPlanRates' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"savingsPlanId": "",
"filters": [
{
"name": "",
"values": ""
}
],
"nextToken": "",
"maxResults": 0
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/DescribeSavingsPlanRates' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"savingsPlanId": "",
"filters": [
{
"name": "",
"values": ""
}
],
"nextToken": "",
"maxResults": 0
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"savingsPlanId\": \"\",\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/DescribeSavingsPlanRates", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/DescribeSavingsPlanRates"
payload = {
"savingsPlanId": "",
"filters": [
{
"name": "",
"values": ""
}
],
"nextToken": "",
"maxResults": 0
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/DescribeSavingsPlanRates"
payload <- "{\n \"savingsPlanId\": \"\",\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/DescribeSavingsPlanRates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"savingsPlanId\": \"\",\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\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/DescribeSavingsPlanRates') do |req|
req.body = "{\n \"savingsPlanId\": \"\",\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/DescribeSavingsPlanRates";
let payload = json!({
"savingsPlanId": "",
"filters": (
json!({
"name": "",
"values": ""
})
),
"nextToken": "",
"maxResults": 0
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/DescribeSavingsPlanRates \
--header 'content-type: application/json' \
--data '{
"savingsPlanId": "",
"filters": [
{
"name": "",
"values": ""
}
],
"nextToken": "",
"maxResults": 0
}'
echo '{
"savingsPlanId": "",
"filters": [
{
"name": "",
"values": ""
}
],
"nextToken": "",
"maxResults": 0
}' | \
http POST {{baseUrl}}/DescribeSavingsPlanRates \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "savingsPlanId": "",\n "filters": [\n {\n "name": "",\n "values": ""\n }\n ],\n "nextToken": "",\n "maxResults": 0\n}' \
--output-document \
- {{baseUrl}}/DescribeSavingsPlanRates
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"savingsPlanId": "",
"filters": [
[
"name": "",
"values": ""
]
],
"nextToken": "",
"maxResults": 0
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/DescribeSavingsPlanRates")! 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
DescribeSavingsPlans
{{baseUrl}}/DescribeSavingsPlans
BODY json
{
"savingsPlanArns": [],
"savingsPlanIds": [],
"nextToken": "",
"maxResults": 0,
"states": [],
"filters": [
{
"name": "",
"values": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/DescribeSavingsPlans");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"savingsPlanArns\": [],\n \"savingsPlanIds\": [],\n \"nextToken\": \"\",\n \"maxResults\": 0,\n \"states\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/DescribeSavingsPlans" {:content-type :json
:form-params {:savingsPlanArns []
:savingsPlanIds []
:nextToken ""
:maxResults 0
:states []
:filters [{:name ""
:values ""}]}})
require "http/client"
url = "{{baseUrl}}/DescribeSavingsPlans"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"savingsPlanArns\": [],\n \"savingsPlanIds\": [],\n \"nextToken\": \"\",\n \"maxResults\": 0,\n \"states\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ]\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/DescribeSavingsPlans"),
Content = new StringContent("{\n \"savingsPlanArns\": [],\n \"savingsPlanIds\": [],\n \"nextToken\": \"\",\n \"maxResults\": 0,\n \"states\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/DescribeSavingsPlans");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"savingsPlanArns\": [],\n \"savingsPlanIds\": [],\n \"nextToken\": \"\",\n \"maxResults\": 0,\n \"states\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/DescribeSavingsPlans"
payload := strings.NewReader("{\n \"savingsPlanArns\": [],\n \"savingsPlanIds\": [],\n \"nextToken\": \"\",\n \"maxResults\": 0,\n \"states\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/DescribeSavingsPlans HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 174
{
"savingsPlanArns": [],
"savingsPlanIds": [],
"nextToken": "",
"maxResults": 0,
"states": [],
"filters": [
{
"name": "",
"values": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/DescribeSavingsPlans")
.setHeader("content-type", "application/json")
.setBody("{\n \"savingsPlanArns\": [],\n \"savingsPlanIds\": [],\n \"nextToken\": \"\",\n \"maxResults\": 0,\n \"states\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/DescribeSavingsPlans"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"savingsPlanArns\": [],\n \"savingsPlanIds\": [],\n \"nextToken\": \"\",\n \"maxResults\": 0,\n \"states\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"savingsPlanArns\": [],\n \"savingsPlanIds\": [],\n \"nextToken\": \"\",\n \"maxResults\": 0,\n \"states\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/DescribeSavingsPlans")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/DescribeSavingsPlans")
.header("content-type", "application/json")
.body("{\n \"savingsPlanArns\": [],\n \"savingsPlanIds\": [],\n \"nextToken\": \"\",\n \"maxResults\": 0,\n \"states\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
savingsPlanArns: [],
savingsPlanIds: [],
nextToken: '',
maxResults: 0,
states: [],
filters: [
{
name: '',
values: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/DescribeSavingsPlans');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/DescribeSavingsPlans',
headers: {'content-type': 'application/json'},
data: {
savingsPlanArns: [],
savingsPlanIds: [],
nextToken: '',
maxResults: 0,
states: [],
filters: [{name: '', values: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/DescribeSavingsPlans';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"savingsPlanArns":[],"savingsPlanIds":[],"nextToken":"","maxResults":0,"states":[],"filters":[{"name":"","values":""}]}'
};
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}}/DescribeSavingsPlans',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "savingsPlanArns": [],\n "savingsPlanIds": [],\n "nextToken": "",\n "maxResults": 0,\n "states": [],\n "filters": [\n {\n "name": "",\n "values": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"savingsPlanArns\": [],\n \"savingsPlanIds\": [],\n \"nextToken\": \"\",\n \"maxResults\": 0,\n \"states\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/DescribeSavingsPlans")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/DescribeSavingsPlans',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
savingsPlanArns: [],
savingsPlanIds: [],
nextToken: '',
maxResults: 0,
states: [],
filters: [{name: '', values: ''}]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/DescribeSavingsPlans',
headers: {'content-type': 'application/json'},
body: {
savingsPlanArns: [],
savingsPlanIds: [],
nextToken: '',
maxResults: 0,
states: [],
filters: [{name: '', values: ''}]
},
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}}/DescribeSavingsPlans');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
savingsPlanArns: [],
savingsPlanIds: [],
nextToken: '',
maxResults: 0,
states: [],
filters: [
{
name: '',
values: ''
}
]
});
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}}/DescribeSavingsPlans',
headers: {'content-type': 'application/json'},
data: {
savingsPlanArns: [],
savingsPlanIds: [],
nextToken: '',
maxResults: 0,
states: [],
filters: [{name: '', values: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/DescribeSavingsPlans';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"savingsPlanArns":[],"savingsPlanIds":[],"nextToken":"","maxResults":0,"states":[],"filters":[{"name":"","values":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"savingsPlanArns": @[ ],
@"savingsPlanIds": @[ ],
@"nextToken": @"",
@"maxResults": @0,
@"states": @[ ],
@"filters": @[ @{ @"name": @"", @"values": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/DescribeSavingsPlans"]
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}}/DescribeSavingsPlans" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"savingsPlanArns\": [],\n \"savingsPlanIds\": [],\n \"nextToken\": \"\",\n \"maxResults\": 0,\n \"states\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/DescribeSavingsPlans",
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([
'savingsPlanArns' => [
],
'savingsPlanIds' => [
],
'nextToken' => '',
'maxResults' => 0,
'states' => [
],
'filters' => [
[
'name' => '',
'values' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/DescribeSavingsPlans', [
'body' => '{
"savingsPlanArns": [],
"savingsPlanIds": [],
"nextToken": "",
"maxResults": 0,
"states": [],
"filters": [
{
"name": "",
"values": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/DescribeSavingsPlans');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'savingsPlanArns' => [
],
'savingsPlanIds' => [
],
'nextToken' => '',
'maxResults' => 0,
'states' => [
],
'filters' => [
[
'name' => '',
'values' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'savingsPlanArns' => [
],
'savingsPlanIds' => [
],
'nextToken' => '',
'maxResults' => 0,
'states' => [
],
'filters' => [
[
'name' => '',
'values' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/DescribeSavingsPlans');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/DescribeSavingsPlans' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"savingsPlanArns": [],
"savingsPlanIds": [],
"nextToken": "",
"maxResults": 0,
"states": [],
"filters": [
{
"name": "",
"values": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/DescribeSavingsPlans' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"savingsPlanArns": [],
"savingsPlanIds": [],
"nextToken": "",
"maxResults": 0,
"states": [],
"filters": [
{
"name": "",
"values": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"savingsPlanArns\": [],\n \"savingsPlanIds\": [],\n \"nextToken\": \"\",\n \"maxResults\": 0,\n \"states\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/DescribeSavingsPlans", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/DescribeSavingsPlans"
payload = {
"savingsPlanArns": [],
"savingsPlanIds": [],
"nextToken": "",
"maxResults": 0,
"states": [],
"filters": [
{
"name": "",
"values": ""
}
]
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/DescribeSavingsPlans"
payload <- "{\n \"savingsPlanArns\": [],\n \"savingsPlanIds\": [],\n \"nextToken\": \"\",\n \"maxResults\": 0,\n \"states\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/DescribeSavingsPlans")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"savingsPlanArns\": [],\n \"savingsPlanIds\": [],\n \"nextToken\": \"\",\n \"maxResults\": 0,\n \"states\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/DescribeSavingsPlans') do |req|
req.body = "{\n \"savingsPlanArns\": [],\n \"savingsPlanIds\": [],\n \"nextToken\": \"\",\n \"maxResults\": 0,\n \"states\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/DescribeSavingsPlans";
let payload = json!({
"savingsPlanArns": (),
"savingsPlanIds": (),
"nextToken": "",
"maxResults": 0,
"states": (),
"filters": (
json!({
"name": "",
"values": ""
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/DescribeSavingsPlans \
--header 'content-type: application/json' \
--data '{
"savingsPlanArns": [],
"savingsPlanIds": [],
"nextToken": "",
"maxResults": 0,
"states": [],
"filters": [
{
"name": "",
"values": ""
}
]
}'
echo '{
"savingsPlanArns": [],
"savingsPlanIds": [],
"nextToken": "",
"maxResults": 0,
"states": [],
"filters": [
{
"name": "",
"values": ""
}
]
}' | \
http POST {{baseUrl}}/DescribeSavingsPlans \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "savingsPlanArns": [],\n "savingsPlanIds": [],\n "nextToken": "",\n "maxResults": 0,\n "states": [],\n "filters": [\n {\n "name": "",\n "values": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/DescribeSavingsPlans
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"savingsPlanArns": [],
"savingsPlanIds": [],
"nextToken": "",
"maxResults": 0,
"states": [],
"filters": [
[
"name": "",
"values": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/DescribeSavingsPlans")! 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
DescribeSavingsPlansOfferingRates
{{baseUrl}}/DescribeSavingsPlansOfferingRates
BODY json
{
"savingsPlanOfferingIds": [],
"savingsPlanPaymentOptions": [],
"savingsPlanTypes": [],
"products": [],
"serviceCodes": [],
"usageTypes": [],
"operations": [],
"filters": [
{
"name": "",
"values": ""
}
],
"nextToken": "",
"maxResults": 0
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/DescribeSavingsPlansOfferingRates");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"savingsPlanOfferingIds\": [],\n \"savingsPlanPaymentOptions\": [],\n \"savingsPlanTypes\": [],\n \"products\": [],\n \"serviceCodes\": [],\n \"usageTypes\": [],\n \"operations\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/DescribeSavingsPlansOfferingRates" {:content-type :json
:form-params {:savingsPlanOfferingIds []
:savingsPlanPaymentOptions []
:savingsPlanTypes []
:products []
:serviceCodes []
:usageTypes []
:operations []
:filters [{:name ""
:values ""}]
:nextToken ""
:maxResults 0}})
require "http/client"
url = "{{baseUrl}}/DescribeSavingsPlansOfferingRates"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"savingsPlanOfferingIds\": [],\n \"savingsPlanPaymentOptions\": [],\n \"savingsPlanTypes\": [],\n \"products\": [],\n \"serviceCodes\": [],\n \"usageTypes\": [],\n \"operations\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\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}}/DescribeSavingsPlansOfferingRates"),
Content = new StringContent("{\n \"savingsPlanOfferingIds\": [],\n \"savingsPlanPaymentOptions\": [],\n \"savingsPlanTypes\": [],\n \"products\": [],\n \"serviceCodes\": [],\n \"usageTypes\": [],\n \"operations\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\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}}/DescribeSavingsPlansOfferingRates");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"savingsPlanOfferingIds\": [],\n \"savingsPlanPaymentOptions\": [],\n \"savingsPlanTypes\": [],\n \"products\": [],\n \"serviceCodes\": [],\n \"usageTypes\": [],\n \"operations\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/DescribeSavingsPlansOfferingRates"
payload := strings.NewReader("{\n \"savingsPlanOfferingIds\": [],\n \"savingsPlanPaymentOptions\": [],\n \"savingsPlanTypes\": [],\n \"products\": [],\n \"serviceCodes\": [],\n \"usageTypes\": [],\n \"operations\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/DescribeSavingsPlansOfferingRates HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 282
{
"savingsPlanOfferingIds": [],
"savingsPlanPaymentOptions": [],
"savingsPlanTypes": [],
"products": [],
"serviceCodes": [],
"usageTypes": [],
"operations": [],
"filters": [
{
"name": "",
"values": ""
}
],
"nextToken": "",
"maxResults": 0
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/DescribeSavingsPlansOfferingRates")
.setHeader("content-type", "application/json")
.setBody("{\n \"savingsPlanOfferingIds\": [],\n \"savingsPlanPaymentOptions\": [],\n \"savingsPlanTypes\": [],\n \"products\": [],\n \"serviceCodes\": [],\n \"usageTypes\": [],\n \"operations\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/DescribeSavingsPlansOfferingRates"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"savingsPlanOfferingIds\": [],\n \"savingsPlanPaymentOptions\": [],\n \"savingsPlanTypes\": [],\n \"products\": [],\n \"serviceCodes\": [],\n \"usageTypes\": [],\n \"operations\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\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 \"savingsPlanOfferingIds\": [],\n \"savingsPlanPaymentOptions\": [],\n \"savingsPlanTypes\": [],\n \"products\": [],\n \"serviceCodes\": [],\n \"usageTypes\": [],\n \"operations\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/DescribeSavingsPlansOfferingRates")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/DescribeSavingsPlansOfferingRates")
.header("content-type", "application/json")
.body("{\n \"savingsPlanOfferingIds\": [],\n \"savingsPlanPaymentOptions\": [],\n \"savingsPlanTypes\": [],\n \"products\": [],\n \"serviceCodes\": [],\n \"usageTypes\": [],\n \"operations\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\n}")
.asString();
const data = JSON.stringify({
savingsPlanOfferingIds: [],
savingsPlanPaymentOptions: [],
savingsPlanTypes: [],
products: [],
serviceCodes: [],
usageTypes: [],
operations: [],
filters: [
{
name: '',
values: ''
}
],
nextToken: '',
maxResults: 0
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/DescribeSavingsPlansOfferingRates');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/DescribeSavingsPlansOfferingRates',
headers: {'content-type': 'application/json'},
data: {
savingsPlanOfferingIds: [],
savingsPlanPaymentOptions: [],
savingsPlanTypes: [],
products: [],
serviceCodes: [],
usageTypes: [],
operations: [],
filters: [{name: '', values: ''}],
nextToken: '',
maxResults: 0
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/DescribeSavingsPlansOfferingRates';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"savingsPlanOfferingIds":[],"savingsPlanPaymentOptions":[],"savingsPlanTypes":[],"products":[],"serviceCodes":[],"usageTypes":[],"operations":[],"filters":[{"name":"","values":""}],"nextToken":"","maxResults":0}'
};
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}}/DescribeSavingsPlansOfferingRates',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "savingsPlanOfferingIds": [],\n "savingsPlanPaymentOptions": [],\n "savingsPlanTypes": [],\n "products": [],\n "serviceCodes": [],\n "usageTypes": [],\n "operations": [],\n "filters": [\n {\n "name": "",\n "values": ""\n }\n ],\n "nextToken": "",\n "maxResults": 0\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"savingsPlanOfferingIds\": [],\n \"savingsPlanPaymentOptions\": [],\n \"savingsPlanTypes\": [],\n \"products\": [],\n \"serviceCodes\": [],\n \"usageTypes\": [],\n \"operations\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\n}")
val request = Request.Builder()
.url("{{baseUrl}}/DescribeSavingsPlansOfferingRates")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/DescribeSavingsPlansOfferingRates',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
savingsPlanOfferingIds: [],
savingsPlanPaymentOptions: [],
savingsPlanTypes: [],
products: [],
serviceCodes: [],
usageTypes: [],
operations: [],
filters: [{name: '', values: ''}],
nextToken: '',
maxResults: 0
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/DescribeSavingsPlansOfferingRates',
headers: {'content-type': 'application/json'},
body: {
savingsPlanOfferingIds: [],
savingsPlanPaymentOptions: [],
savingsPlanTypes: [],
products: [],
serviceCodes: [],
usageTypes: [],
operations: [],
filters: [{name: '', values: ''}],
nextToken: '',
maxResults: 0
},
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}}/DescribeSavingsPlansOfferingRates');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
savingsPlanOfferingIds: [],
savingsPlanPaymentOptions: [],
savingsPlanTypes: [],
products: [],
serviceCodes: [],
usageTypes: [],
operations: [],
filters: [
{
name: '',
values: ''
}
],
nextToken: '',
maxResults: 0
});
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}}/DescribeSavingsPlansOfferingRates',
headers: {'content-type': 'application/json'},
data: {
savingsPlanOfferingIds: [],
savingsPlanPaymentOptions: [],
savingsPlanTypes: [],
products: [],
serviceCodes: [],
usageTypes: [],
operations: [],
filters: [{name: '', values: ''}],
nextToken: '',
maxResults: 0
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/DescribeSavingsPlansOfferingRates';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"savingsPlanOfferingIds":[],"savingsPlanPaymentOptions":[],"savingsPlanTypes":[],"products":[],"serviceCodes":[],"usageTypes":[],"operations":[],"filters":[{"name":"","values":""}],"nextToken":"","maxResults":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"savingsPlanOfferingIds": @[ ],
@"savingsPlanPaymentOptions": @[ ],
@"savingsPlanTypes": @[ ],
@"products": @[ ],
@"serviceCodes": @[ ],
@"usageTypes": @[ ],
@"operations": @[ ],
@"filters": @[ @{ @"name": @"", @"values": @"" } ],
@"nextToken": @"",
@"maxResults": @0 };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/DescribeSavingsPlansOfferingRates"]
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}}/DescribeSavingsPlansOfferingRates" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"savingsPlanOfferingIds\": [],\n \"savingsPlanPaymentOptions\": [],\n \"savingsPlanTypes\": [],\n \"products\": [],\n \"serviceCodes\": [],\n \"usageTypes\": [],\n \"operations\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/DescribeSavingsPlansOfferingRates",
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([
'savingsPlanOfferingIds' => [
],
'savingsPlanPaymentOptions' => [
],
'savingsPlanTypes' => [
],
'products' => [
],
'serviceCodes' => [
],
'usageTypes' => [
],
'operations' => [
],
'filters' => [
[
'name' => '',
'values' => ''
]
],
'nextToken' => '',
'maxResults' => 0
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/DescribeSavingsPlansOfferingRates', [
'body' => '{
"savingsPlanOfferingIds": [],
"savingsPlanPaymentOptions": [],
"savingsPlanTypes": [],
"products": [],
"serviceCodes": [],
"usageTypes": [],
"operations": [],
"filters": [
{
"name": "",
"values": ""
}
],
"nextToken": "",
"maxResults": 0
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/DescribeSavingsPlansOfferingRates');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'savingsPlanOfferingIds' => [
],
'savingsPlanPaymentOptions' => [
],
'savingsPlanTypes' => [
],
'products' => [
],
'serviceCodes' => [
],
'usageTypes' => [
],
'operations' => [
],
'filters' => [
[
'name' => '',
'values' => ''
]
],
'nextToken' => '',
'maxResults' => 0
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'savingsPlanOfferingIds' => [
],
'savingsPlanPaymentOptions' => [
],
'savingsPlanTypes' => [
],
'products' => [
],
'serviceCodes' => [
],
'usageTypes' => [
],
'operations' => [
],
'filters' => [
[
'name' => '',
'values' => ''
]
],
'nextToken' => '',
'maxResults' => 0
]));
$request->setRequestUrl('{{baseUrl}}/DescribeSavingsPlansOfferingRates');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/DescribeSavingsPlansOfferingRates' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"savingsPlanOfferingIds": [],
"savingsPlanPaymentOptions": [],
"savingsPlanTypes": [],
"products": [],
"serviceCodes": [],
"usageTypes": [],
"operations": [],
"filters": [
{
"name": "",
"values": ""
}
],
"nextToken": "",
"maxResults": 0
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/DescribeSavingsPlansOfferingRates' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"savingsPlanOfferingIds": [],
"savingsPlanPaymentOptions": [],
"savingsPlanTypes": [],
"products": [],
"serviceCodes": [],
"usageTypes": [],
"operations": [],
"filters": [
{
"name": "",
"values": ""
}
],
"nextToken": "",
"maxResults": 0
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"savingsPlanOfferingIds\": [],\n \"savingsPlanPaymentOptions\": [],\n \"savingsPlanTypes\": [],\n \"products\": [],\n \"serviceCodes\": [],\n \"usageTypes\": [],\n \"operations\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/DescribeSavingsPlansOfferingRates", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/DescribeSavingsPlansOfferingRates"
payload = {
"savingsPlanOfferingIds": [],
"savingsPlanPaymentOptions": [],
"savingsPlanTypes": [],
"products": [],
"serviceCodes": [],
"usageTypes": [],
"operations": [],
"filters": [
{
"name": "",
"values": ""
}
],
"nextToken": "",
"maxResults": 0
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/DescribeSavingsPlansOfferingRates"
payload <- "{\n \"savingsPlanOfferingIds\": [],\n \"savingsPlanPaymentOptions\": [],\n \"savingsPlanTypes\": [],\n \"products\": [],\n \"serviceCodes\": [],\n \"usageTypes\": [],\n \"operations\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/DescribeSavingsPlansOfferingRates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"savingsPlanOfferingIds\": [],\n \"savingsPlanPaymentOptions\": [],\n \"savingsPlanTypes\": [],\n \"products\": [],\n \"serviceCodes\": [],\n \"usageTypes\": [],\n \"operations\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\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/DescribeSavingsPlansOfferingRates') do |req|
req.body = "{\n \"savingsPlanOfferingIds\": [],\n \"savingsPlanPaymentOptions\": [],\n \"savingsPlanTypes\": [],\n \"products\": [],\n \"serviceCodes\": [],\n \"usageTypes\": [],\n \"operations\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/DescribeSavingsPlansOfferingRates";
let payload = json!({
"savingsPlanOfferingIds": (),
"savingsPlanPaymentOptions": (),
"savingsPlanTypes": (),
"products": (),
"serviceCodes": (),
"usageTypes": (),
"operations": (),
"filters": (
json!({
"name": "",
"values": ""
})
),
"nextToken": "",
"maxResults": 0
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/DescribeSavingsPlansOfferingRates \
--header 'content-type: application/json' \
--data '{
"savingsPlanOfferingIds": [],
"savingsPlanPaymentOptions": [],
"savingsPlanTypes": [],
"products": [],
"serviceCodes": [],
"usageTypes": [],
"operations": [],
"filters": [
{
"name": "",
"values": ""
}
],
"nextToken": "",
"maxResults": 0
}'
echo '{
"savingsPlanOfferingIds": [],
"savingsPlanPaymentOptions": [],
"savingsPlanTypes": [],
"products": [],
"serviceCodes": [],
"usageTypes": [],
"operations": [],
"filters": [
{
"name": "",
"values": ""
}
],
"nextToken": "",
"maxResults": 0
}' | \
http POST {{baseUrl}}/DescribeSavingsPlansOfferingRates \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "savingsPlanOfferingIds": [],\n "savingsPlanPaymentOptions": [],\n "savingsPlanTypes": [],\n "products": [],\n "serviceCodes": [],\n "usageTypes": [],\n "operations": [],\n "filters": [\n {\n "name": "",\n "values": ""\n }\n ],\n "nextToken": "",\n "maxResults": 0\n}' \
--output-document \
- {{baseUrl}}/DescribeSavingsPlansOfferingRates
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"savingsPlanOfferingIds": [],
"savingsPlanPaymentOptions": [],
"savingsPlanTypes": [],
"products": [],
"serviceCodes": [],
"usageTypes": [],
"operations": [],
"filters": [
[
"name": "",
"values": ""
]
],
"nextToken": "",
"maxResults": 0
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/DescribeSavingsPlansOfferingRates")! 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
DescribeSavingsPlansOfferings
{{baseUrl}}/DescribeSavingsPlansOfferings
BODY json
{
"offeringIds": [],
"paymentOptions": [],
"productType": "",
"planTypes": [],
"durations": [],
"currencies": [],
"descriptions": [],
"serviceCodes": [],
"usageTypes": [],
"operations": [],
"filters": [
{
"name": "",
"values": ""
}
],
"nextToken": "",
"maxResults": 0
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/DescribeSavingsPlansOfferings");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"offeringIds\": [],\n \"paymentOptions\": [],\n \"productType\": \"\",\n \"planTypes\": [],\n \"durations\": [],\n \"currencies\": [],\n \"descriptions\": [],\n \"serviceCodes\": [],\n \"usageTypes\": [],\n \"operations\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/DescribeSavingsPlansOfferings" {:content-type :json
:form-params {:offeringIds []
:paymentOptions []
:productType ""
:planTypes []
:durations []
:currencies []
:descriptions []
:serviceCodes []
:usageTypes []
:operations []
:filters [{:name ""
:values ""}]
:nextToken ""
:maxResults 0}})
require "http/client"
url = "{{baseUrl}}/DescribeSavingsPlansOfferings"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"offeringIds\": [],\n \"paymentOptions\": [],\n \"productType\": \"\",\n \"planTypes\": [],\n \"durations\": [],\n \"currencies\": [],\n \"descriptions\": [],\n \"serviceCodes\": [],\n \"usageTypes\": [],\n \"operations\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\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}}/DescribeSavingsPlansOfferings"),
Content = new StringContent("{\n \"offeringIds\": [],\n \"paymentOptions\": [],\n \"productType\": \"\",\n \"planTypes\": [],\n \"durations\": [],\n \"currencies\": [],\n \"descriptions\": [],\n \"serviceCodes\": [],\n \"usageTypes\": [],\n \"operations\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\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}}/DescribeSavingsPlansOfferings");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"offeringIds\": [],\n \"paymentOptions\": [],\n \"productType\": \"\",\n \"planTypes\": [],\n \"durations\": [],\n \"currencies\": [],\n \"descriptions\": [],\n \"serviceCodes\": [],\n \"usageTypes\": [],\n \"operations\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/DescribeSavingsPlansOfferings"
payload := strings.NewReader("{\n \"offeringIds\": [],\n \"paymentOptions\": [],\n \"productType\": \"\",\n \"planTypes\": [],\n \"durations\": [],\n \"currencies\": [],\n \"descriptions\": [],\n \"serviceCodes\": [],\n \"usageTypes\": [],\n \"operations\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/DescribeSavingsPlansOfferings HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 317
{
"offeringIds": [],
"paymentOptions": [],
"productType": "",
"planTypes": [],
"durations": [],
"currencies": [],
"descriptions": [],
"serviceCodes": [],
"usageTypes": [],
"operations": [],
"filters": [
{
"name": "",
"values": ""
}
],
"nextToken": "",
"maxResults": 0
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/DescribeSavingsPlansOfferings")
.setHeader("content-type", "application/json")
.setBody("{\n \"offeringIds\": [],\n \"paymentOptions\": [],\n \"productType\": \"\",\n \"planTypes\": [],\n \"durations\": [],\n \"currencies\": [],\n \"descriptions\": [],\n \"serviceCodes\": [],\n \"usageTypes\": [],\n \"operations\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/DescribeSavingsPlansOfferings"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"offeringIds\": [],\n \"paymentOptions\": [],\n \"productType\": \"\",\n \"planTypes\": [],\n \"durations\": [],\n \"currencies\": [],\n \"descriptions\": [],\n \"serviceCodes\": [],\n \"usageTypes\": [],\n \"operations\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\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 \"offeringIds\": [],\n \"paymentOptions\": [],\n \"productType\": \"\",\n \"planTypes\": [],\n \"durations\": [],\n \"currencies\": [],\n \"descriptions\": [],\n \"serviceCodes\": [],\n \"usageTypes\": [],\n \"operations\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/DescribeSavingsPlansOfferings")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/DescribeSavingsPlansOfferings")
.header("content-type", "application/json")
.body("{\n \"offeringIds\": [],\n \"paymentOptions\": [],\n \"productType\": \"\",\n \"planTypes\": [],\n \"durations\": [],\n \"currencies\": [],\n \"descriptions\": [],\n \"serviceCodes\": [],\n \"usageTypes\": [],\n \"operations\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\n}")
.asString();
const data = JSON.stringify({
offeringIds: [],
paymentOptions: [],
productType: '',
planTypes: [],
durations: [],
currencies: [],
descriptions: [],
serviceCodes: [],
usageTypes: [],
operations: [],
filters: [
{
name: '',
values: ''
}
],
nextToken: '',
maxResults: 0
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/DescribeSavingsPlansOfferings');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/DescribeSavingsPlansOfferings',
headers: {'content-type': 'application/json'},
data: {
offeringIds: [],
paymentOptions: [],
productType: '',
planTypes: [],
durations: [],
currencies: [],
descriptions: [],
serviceCodes: [],
usageTypes: [],
operations: [],
filters: [{name: '', values: ''}],
nextToken: '',
maxResults: 0
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/DescribeSavingsPlansOfferings';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"offeringIds":[],"paymentOptions":[],"productType":"","planTypes":[],"durations":[],"currencies":[],"descriptions":[],"serviceCodes":[],"usageTypes":[],"operations":[],"filters":[{"name":"","values":""}],"nextToken":"","maxResults":0}'
};
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}}/DescribeSavingsPlansOfferings',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "offeringIds": [],\n "paymentOptions": [],\n "productType": "",\n "planTypes": [],\n "durations": [],\n "currencies": [],\n "descriptions": [],\n "serviceCodes": [],\n "usageTypes": [],\n "operations": [],\n "filters": [\n {\n "name": "",\n "values": ""\n }\n ],\n "nextToken": "",\n "maxResults": 0\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"offeringIds\": [],\n \"paymentOptions\": [],\n \"productType\": \"\",\n \"planTypes\": [],\n \"durations\": [],\n \"currencies\": [],\n \"descriptions\": [],\n \"serviceCodes\": [],\n \"usageTypes\": [],\n \"operations\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\n}")
val request = Request.Builder()
.url("{{baseUrl}}/DescribeSavingsPlansOfferings")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/DescribeSavingsPlansOfferings',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
offeringIds: [],
paymentOptions: [],
productType: '',
planTypes: [],
durations: [],
currencies: [],
descriptions: [],
serviceCodes: [],
usageTypes: [],
operations: [],
filters: [{name: '', values: ''}],
nextToken: '',
maxResults: 0
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/DescribeSavingsPlansOfferings',
headers: {'content-type': 'application/json'},
body: {
offeringIds: [],
paymentOptions: [],
productType: '',
planTypes: [],
durations: [],
currencies: [],
descriptions: [],
serviceCodes: [],
usageTypes: [],
operations: [],
filters: [{name: '', values: ''}],
nextToken: '',
maxResults: 0
},
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}}/DescribeSavingsPlansOfferings');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
offeringIds: [],
paymentOptions: [],
productType: '',
planTypes: [],
durations: [],
currencies: [],
descriptions: [],
serviceCodes: [],
usageTypes: [],
operations: [],
filters: [
{
name: '',
values: ''
}
],
nextToken: '',
maxResults: 0
});
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}}/DescribeSavingsPlansOfferings',
headers: {'content-type': 'application/json'},
data: {
offeringIds: [],
paymentOptions: [],
productType: '',
planTypes: [],
durations: [],
currencies: [],
descriptions: [],
serviceCodes: [],
usageTypes: [],
operations: [],
filters: [{name: '', values: ''}],
nextToken: '',
maxResults: 0
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/DescribeSavingsPlansOfferings';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"offeringIds":[],"paymentOptions":[],"productType":"","planTypes":[],"durations":[],"currencies":[],"descriptions":[],"serviceCodes":[],"usageTypes":[],"operations":[],"filters":[{"name":"","values":""}],"nextToken":"","maxResults":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"offeringIds": @[ ],
@"paymentOptions": @[ ],
@"productType": @"",
@"planTypes": @[ ],
@"durations": @[ ],
@"currencies": @[ ],
@"descriptions": @[ ],
@"serviceCodes": @[ ],
@"usageTypes": @[ ],
@"operations": @[ ],
@"filters": @[ @{ @"name": @"", @"values": @"" } ],
@"nextToken": @"",
@"maxResults": @0 };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/DescribeSavingsPlansOfferings"]
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}}/DescribeSavingsPlansOfferings" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"offeringIds\": [],\n \"paymentOptions\": [],\n \"productType\": \"\",\n \"planTypes\": [],\n \"durations\": [],\n \"currencies\": [],\n \"descriptions\": [],\n \"serviceCodes\": [],\n \"usageTypes\": [],\n \"operations\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/DescribeSavingsPlansOfferings",
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([
'offeringIds' => [
],
'paymentOptions' => [
],
'productType' => '',
'planTypes' => [
],
'durations' => [
],
'currencies' => [
],
'descriptions' => [
],
'serviceCodes' => [
],
'usageTypes' => [
],
'operations' => [
],
'filters' => [
[
'name' => '',
'values' => ''
]
],
'nextToken' => '',
'maxResults' => 0
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/DescribeSavingsPlansOfferings', [
'body' => '{
"offeringIds": [],
"paymentOptions": [],
"productType": "",
"planTypes": [],
"durations": [],
"currencies": [],
"descriptions": [],
"serviceCodes": [],
"usageTypes": [],
"operations": [],
"filters": [
{
"name": "",
"values": ""
}
],
"nextToken": "",
"maxResults": 0
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/DescribeSavingsPlansOfferings');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'offeringIds' => [
],
'paymentOptions' => [
],
'productType' => '',
'planTypes' => [
],
'durations' => [
],
'currencies' => [
],
'descriptions' => [
],
'serviceCodes' => [
],
'usageTypes' => [
],
'operations' => [
],
'filters' => [
[
'name' => '',
'values' => ''
]
],
'nextToken' => '',
'maxResults' => 0
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'offeringIds' => [
],
'paymentOptions' => [
],
'productType' => '',
'planTypes' => [
],
'durations' => [
],
'currencies' => [
],
'descriptions' => [
],
'serviceCodes' => [
],
'usageTypes' => [
],
'operations' => [
],
'filters' => [
[
'name' => '',
'values' => ''
]
],
'nextToken' => '',
'maxResults' => 0
]));
$request->setRequestUrl('{{baseUrl}}/DescribeSavingsPlansOfferings');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/DescribeSavingsPlansOfferings' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"offeringIds": [],
"paymentOptions": [],
"productType": "",
"planTypes": [],
"durations": [],
"currencies": [],
"descriptions": [],
"serviceCodes": [],
"usageTypes": [],
"operations": [],
"filters": [
{
"name": "",
"values": ""
}
],
"nextToken": "",
"maxResults": 0
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/DescribeSavingsPlansOfferings' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"offeringIds": [],
"paymentOptions": [],
"productType": "",
"planTypes": [],
"durations": [],
"currencies": [],
"descriptions": [],
"serviceCodes": [],
"usageTypes": [],
"operations": [],
"filters": [
{
"name": "",
"values": ""
}
],
"nextToken": "",
"maxResults": 0
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"offeringIds\": [],\n \"paymentOptions\": [],\n \"productType\": \"\",\n \"planTypes\": [],\n \"durations\": [],\n \"currencies\": [],\n \"descriptions\": [],\n \"serviceCodes\": [],\n \"usageTypes\": [],\n \"operations\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/DescribeSavingsPlansOfferings", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/DescribeSavingsPlansOfferings"
payload = {
"offeringIds": [],
"paymentOptions": [],
"productType": "",
"planTypes": [],
"durations": [],
"currencies": [],
"descriptions": [],
"serviceCodes": [],
"usageTypes": [],
"operations": [],
"filters": [
{
"name": "",
"values": ""
}
],
"nextToken": "",
"maxResults": 0
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/DescribeSavingsPlansOfferings"
payload <- "{\n \"offeringIds\": [],\n \"paymentOptions\": [],\n \"productType\": \"\",\n \"planTypes\": [],\n \"durations\": [],\n \"currencies\": [],\n \"descriptions\": [],\n \"serviceCodes\": [],\n \"usageTypes\": [],\n \"operations\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/DescribeSavingsPlansOfferings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"offeringIds\": [],\n \"paymentOptions\": [],\n \"productType\": \"\",\n \"planTypes\": [],\n \"durations\": [],\n \"currencies\": [],\n \"descriptions\": [],\n \"serviceCodes\": [],\n \"usageTypes\": [],\n \"operations\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\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/DescribeSavingsPlansOfferings') do |req|
req.body = "{\n \"offeringIds\": [],\n \"paymentOptions\": [],\n \"productType\": \"\",\n \"planTypes\": [],\n \"durations\": [],\n \"currencies\": [],\n \"descriptions\": [],\n \"serviceCodes\": [],\n \"usageTypes\": [],\n \"operations\": [],\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"nextToken\": \"\",\n \"maxResults\": 0\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/DescribeSavingsPlansOfferings";
let payload = json!({
"offeringIds": (),
"paymentOptions": (),
"productType": "",
"planTypes": (),
"durations": (),
"currencies": (),
"descriptions": (),
"serviceCodes": (),
"usageTypes": (),
"operations": (),
"filters": (
json!({
"name": "",
"values": ""
})
),
"nextToken": "",
"maxResults": 0
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/DescribeSavingsPlansOfferings \
--header 'content-type: application/json' \
--data '{
"offeringIds": [],
"paymentOptions": [],
"productType": "",
"planTypes": [],
"durations": [],
"currencies": [],
"descriptions": [],
"serviceCodes": [],
"usageTypes": [],
"operations": [],
"filters": [
{
"name": "",
"values": ""
}
],
"nextToken": "",
"maxResults": 0
}'
echo '{
"offeringIds": [],
"paymentOptions": [],
"productType": "",
"planTypes": [],
"durations": [],
"currencies": [],
"descriptions": [],
"serviceCodes": [],
"usageTypes": [],
"operations": [],
"filters": [
{
"name": "",
"values": ""
}
],
"nextToken": "",
"maxResults": 0
}' | \
http POST {{baseUrl}}/DescribeSavingsPlansOfferings \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "offeringIds": [],\n "paymentOptions": [],\n "productType": "",\n "planTypes": [],\n "durations": [],\n "currencies": [],\n "descriptions": [],\n "serviceCodes": [],\n "usageTypes": [],\n "operations": [],\n "filters": [\n {\n "name": "",\n "values": ""\n }\n ],\n "nextToken": "",\n "maxResults": 0\n}' \
--output-document \
- {{baseUrl}}/DescribeSavingsPlansOfferings
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"offeringIds": [],
"paymentOptions": [],
"productType": "",
"planTypes": [],
"durations": [],
"currencies": [],
"descriptions": [],
"serviceCodes": [],
"usageTypes": [],
"operations": [],
"filters": [
[
"name": "",
"values": ""
]
],
"nextToken": "",
"maxResults": 0
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/DescribeSavingsPlansOfferings")! 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}}/ListTagsForResource
BODY json
{
"resourceArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/ListTagsForResource");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"resourceArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/ListTagsForResource" {:content-type :json
:form-params {:resourceArn ""}})
require "http/client"
url = "{{baseUrl}}/ListTagsForResource"
headers = HTTP::Headers{
"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}}/ListTagsForResource"),
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}}/ListTagsForResource");
var request = new RestRequest("", Method.Post);
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}}/ListTagsForResource"
payload := strings.NewReader("{\n \"resourceArn\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ListTagsForResource HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 23
{
"resourceArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/ListTagsForResource")
.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}}/ListTagsForResource"))
.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}}/ListTagsForResource")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/ListTagsForResource")
.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}}/ListTagsForResource');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/ListTagsForResource',
headers: {'content-type': 'application/json'},
data: {resourceArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/ListTagsForResource';
const options = {
method: 'POST',
headers: {'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}}/ListTagsForResource',
method: 'POST',
headers: {
'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}}/ListTagsForResource")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/ListTagsForResource',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({resourceArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/ListTagsForResource',
headers: {'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}}/ListTagsForResource');
req.headers({
'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}}/ListTagsForResource',
headers: {'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}}/ListTagsForResource';
const options = {
method: 'POST',
headers: {'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 = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"resourceArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/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}}/ListTagsForResource" in
let headers = Header.add (Header.init ()) "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}}/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"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/ListTagsForResource', [
'body' => '{
"resourceArn": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/ListTagsForResource');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'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}}/ListTagsForResource');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/ListTagsForResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"resourceArn": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/ListTagsForResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"resourceArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"resourceArn\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/ListTagsForResource", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/ListTagsForResource"
payload = { "resourceArn": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/ListTagsForResource"
payload <- "{\n \"resourceArn\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/ListTagsForResource")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"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/ListTagsForResource') do |req|
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}}/ListTagsForResource";
let payload = json!({"resourceArn": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/ListTagsForResource \
--header 'content-type: application/json' \
--data '{
"resourceArn": ""
}'
echo '{
"resourceArn": ""
}' | \
http POST {{baseUrl}}/ListTagsForResource \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "resourceArn": ""\n}' \
--output-document \
- {{baseUrl}}/ListTagsForResource
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["resourceArn": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/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
TagResource
{{baseUrl}}/TagResource
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}}/TagResource");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"resourceArn\": \"\",\n \"tags\": {}\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/TagResource" {:content-type :json
:form-params {:resourceArn ""
:tags {}}})
require "http/client"
url = "{{baseUrl}}/TagResource"
headers = HTTP::Headers{
"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}}/TagResource"),
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}}/TagResource");
var request = new RestRequest("", Method.Post);
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}}/TagResource"
payload := strings.NewReader("{\n \"resourceArn\": \"\",\n \"tags\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/TagResource HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 37
{
"resourceArn": "",
"tags": {}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/TagResource")
.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}}/TagResource"))
.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}}/TagResource")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/TagResource")
.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}}/TagResource');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/TagResource',
headers: {'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}}/TagResource';
const options = {
method: 'POST',
headers: {'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}}/TagResource',
method: 'POST',
headers: {
'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}}/TagResource")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/TagResource',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({resourceArn: '', tags: {}}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/TagResource',
headers: {'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}}/TagResource');
req.headers({
'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}}/TagResource',
headers: {'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}}/TagResource';
const options = {
method: 'POST',
headers: {'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 = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"resourceArn": @"",
@"tags": @{ } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/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}}/TagResource" in
let headers = Header.add (Header.init ()) "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}}/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"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/TagResource', [
'body' => '{
"resourceArn": "",
"tags": {}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/TagResource');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'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}}/TagResource');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/TagResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"resourceArn": "",
"tags": {}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/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 = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/TagResource", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/TagResource"
payload = {
"resourceArn": "",
"tags": {}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/TagResource"
payload <- "{\n \"resourceArn\": \"\",\n \"tags\": {}\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/TagResource")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"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/TagResource') do |req|
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}}/TagResource";
let payload = json!({
"resourceArn": "",
"tags": json!({})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/TagResource \
--header 'content-type: application/json' \
--data '{
"resourceArn": "",
"tags": {}
}'
echo '{
"resourceArn": "",
"tags": {}
}' | \
http POST {{baseUrl}}/TagResource \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "resourceArn": "",\n "tags": {}\n}' \
--output-document \
- {{baseUrl}}/TagResource
import Foundation
let headers = ["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}}/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}}/UntagResource
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}}/UntagResource");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"resourceArn\": \"\",\n \"tagKeys\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/UntagResource" {:content-type :json
:form-params {:resourceArn ""
:tagKeys []}})
require "http/client"
url = "{{baseUrl}}/UntagResource"
headers = HTTP::Headers{
"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}}/UntagResource"),
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}}/UntagResource");
var request = new RestRequest("", Method.Post);
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}}/UntagResource"
payload := strings.NewReader("{\n \"resourceArn\": \"\",\n \"tagKeys\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/UntagResource HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 40
{
"resourceArn": "",
"tagKeys": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/UntagResource")
.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}}/UntagResource"))
.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}}/UntagResource")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/UntagResource")
.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}}/UntagResource');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/UntagResource',
headers: {'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}}/UntagResource';
const options = {
method: 'POST',
headers: {'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}}/UntagResource',
method: 'POST',
headers: {
'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}}/UntagResource")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/UntagResource',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({resourceArn: '', tagKeys: []}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/UntagResource',
headers: {'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}}/UntagResource');
req.headers({
'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}}/UntagResource',
headers: {'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}}/UntagResource';
const options = {
method: 'POST',
headers: {'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 = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"resourceArn": @"",
@"tagKeys": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/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}}/UntagResource" in
let headers = Header.add (Header.init ()) "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}}/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"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/UntagResource', [
'body' => '{
"resourceArn": "",
"tagKeys": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/UntagResource');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'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}}/UntagResource');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/UntagResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"resourceArn": "",
"tagKeys": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/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 = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/UntagResource", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/UntagResource"
payload = {
"resourceArn": "",
"tagKeys": []
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/UntagResource"
payload <- "{\n \"resourceArn\": \"\",\n \"tagKeys\": []\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/UntagResource")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"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/UntagResource') do |req|
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}}/UntagResource";
let payload = json!({
"resourceArn": "",
"tagKeys": ()
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/UntagResource \
--header 'content-type: application/json' \
--data '{
"resourceArn": "",
"tagKeys": []
}'
echo '{
"resourceArn": "",
"tagKeys": []
}' | \
http POST {{baseUrl}}/UntagResource \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "resourceArn": "",\n "tagKeys": []\n}' \
--output-document \
- {{baseUrl}}/UntagResource
import Foundation
let headers = ["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}}/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()