AWS OpsWorks
POST
AssignInstance
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignInstance
HEADERS
X-Amz-Target
BODY json
{
"InstanceId": "",
"LayerIds": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignInstance");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"InstanceId\": \"\",\n \"LayerIds\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignInstance" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:InstanceId ""
:LayerIds ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignInstance"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"InstanceId\": \"\",\n \"LayerIds\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignInstance"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"InstanceId\": \"\",\n \"LayerIds\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignInstance");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"InstanceId\": \"\",\n \"LayerIds\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignInstance"
payload := strings.NewReader("{\n \"InstanceId\": \"\",\n \"LayerIds\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 40
{
"InstanceId": "",
"LayerIds": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignInstance")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"InstanceId\": \"\",\n \"LayerIds\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignInstance"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"InstanceId\": \"\",\n \"LayerIds\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"InstanceId\": \"\",\n \"LayerIds\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignInstance")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignInstance")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"InstanceId\": \"\",\n \"LayerIds\": \"\"\n}")
.asString();
const data = JSON.stringify({
InstanceId: '',
LayerIds: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignInstance');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: '', LayerIds: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignInstance';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":"","LayerIds":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignInstance',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "InstanceId": "",\n "LayerIds": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"InstanceId\": \"\",\n \"LayerIds\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignInstance")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({InstanceId: '', LayerIds: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {InstanceId: '', LayerIds: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignInstance');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
InstanceId: '',
LayerIds: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: '', LayerIds: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignInstance';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":"","LayerIds":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"InstanceId": @"",
@"LayerIds": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignInstance"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignInstance" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"InstanceId\": \"\",\n \"LayerIds\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignInstance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'InstanceId' => '',
'LayerIds' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignInstance', [
'body' => '{
"InstanceId": "",
"LayerIds": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignInstance');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'InstanceId' => '',
'LayerIds' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'InstanceId' => '',
'LayerIds' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignInstance');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignInstance' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": "",
"LayerIds": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignInstance' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": "",
"LayerIds": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"InstanceId\": \"\",\n \"LayerIds\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignInstance"
payload = {
"InstanceId": "",
"LayerIds": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignInstance"
payload <- "{\n \"InstanceId\": \"\",\n \"LayerIds\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignInstance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"InstanceId\": \"\",\n \"LayerIds\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"InstanceId\": \"\",\n \"LayerIds\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignInstance";
let payload = json!({
"InstanceId": "",
"LayerIds": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignInstance' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"InstanceId": "",
"LayerIds": ""
}'
echo '{
"InstanceId": "",
"LayerIds": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignInstance' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "InstanceId": "",\n "LayerIds": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignInstance'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"InstanceId": "",
"LayerIds": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignInstance")! 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
AssignVolume
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignVolume
HEADERS
X-Amz-Target
BODY json
{
"VolumeId": "",
"InstanceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignVolume");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"VolumeId\": \"\",\n \"InstanceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignVolume" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:VolumeId ""
:InstanceId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignVolume"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"VolumeId\": \"\",\n \"InstanceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignVolume"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"VolumeId\": \"\",\n \"InstanceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignVolume");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"VolumeId\": \"\",\n \"InstanceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignVolume"
payload := strings.NewReader("{\n \"VolumeId\": \"\",\n \"InstanceId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 40
{
"VolumeId": "",
"InstanceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignVolume")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"VolumeId\": \"\",\n \"InstanceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignVolume"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"VolumeId\": \"\",\n \"InstanceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"VolumeId\": \"\",\n \"InstanceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignVolume")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignVolume")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"VolumeId\": \"\",\n \"InstanceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
VolumeId: '',
InstanceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignVolume');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignVolume',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {VolumeId: '', InstanceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignVolume';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"VolumeId":"","InstanceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignVolume',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "VolumeId": "",\n "InstanceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"VolumeId\": \"\",\n \"InstanceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignVolume")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({VolumeId: '', InstanceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignVolume',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {VolumeId: '', InstanceId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignVolume');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
VolumeId: '',
InstanceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignVolume',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {VolumeId: '', InstanceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignVolume';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"VolumeId":"","InstanceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"VolumeId": @"",
@"InstanceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignVolume"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignVolume" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"VolumeId\": \"\",\n \"InstanceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignVolume",
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([
'VolumeId' => '',
'InstanceId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignVolume', [
'body' => '{
"VolumeId": "",
"InstanceId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignVolume');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'VolumeId' => '',
'InstanceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'VolumeId' => '',
'InstanceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignVolume');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignVolume' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"VolumeId": "",
"InstanceId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignVolume' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"VolumeId": "",
"InstanceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"VolumeId\": \"\",\n \"InstanceId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignVolume"
payload = {
"VolumeId": "",
"InstanceId": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignVolume"
payload <- "{\n \"VolumeId\": \"\",\n \"InstanceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignVolume")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"VolumeId\": \"\",\n \"InstanceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"VolumeId\": \"\",\n \"InstanceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignVolume";
let payload = json!({
"VolumeId": "",
"InstanceId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignVolume' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"VolumeId": "",
"InstanceId": ""
}'
echo '{
"VolumeId": "",
"InstanceId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignVolume' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "VolumeId": "",\n "InstanceId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignVolume'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"VolumeId": "",
"InstanceId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssignVolume")! 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
AssociateElasticIp
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssociateElasticIp
HEADERS
X-Amz-Target
BODY json
{
"ElasticIp": "",
"InstanceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssociateElasticIp");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"ElasticIp\": \"\",\n \"InstanceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssociateElasticIp" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ElasticIp ""
:InstanceId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssociateElasticIp"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ElasticIp\": \"\",\n \"InstanceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssociateElasticIp"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ElasticIp\": \"\",\n \"InstanceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssociateElasticIp");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ElasticIp\": \"\",\n \"InstanceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssociateElasticIp"
payload := strings.NewReader("{\n \"ElasticIp\": \"\",\n \"InstanceId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 41
{
"ElasticIp": "",
"InstanceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssociateElasticIp")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ElasticIp\": \"\",\n \"InstanceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssociateElasticIp"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ElasticIp\": \"\",\n \"InstanceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"ElasticIp\": \"\",\n \"InstanceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssociateElasticIp")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssociateElasticIp")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ElasticIp\": \"\",\n \"InstanceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
ElasticIp: '',
InstanceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssociateElasticIp');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssociateElasticIp',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ElasticIp: '', InstanceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssociateElasticIp';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ElasticIp":"","InstanceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssociateElasticIp',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ElasticIp": "",\n "InstanceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ElasticIp\": \"\",\n \"InstanceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssociateElasticIp")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({ElasticIp: '', InstanceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssociateElasticIp',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {ElasticIp: '', InstanceId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssociateElasticIp');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ElasticIp: '',
InstanceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssociateElasticIp',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ElasticIp: '', InstanceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssociateElasticIp';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ElasticIp":"","InstanceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"ElasticIp": @"",
@"InstanceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssociateElasticIp"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssociateElasticIp" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"ElasticIp\": \"\",\n \"InstanceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssociateElasticIp",
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([
'ElasticIp' => '',
'InstanceId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssociateElasticIp', [
'body' => '{
"ElasticIp": "",
"InstanceId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssociateElasticIp');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ElasticIp' => '',
'InstanceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ElasticIp' => '',
'InstanceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssociateElasticIp');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssociateElasticIp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ElasticIp": "",
"InstanceId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssociateElasticIp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ElasticIp": "",
"InstanceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ElasticIp\": \"\",\n \"InstanceId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssociateElasticIp"
payload = {
"ElasticIp": "",
"InstanceId": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssociateElasticIp"
payload <- "{\n \"ElasticIp\": \"\",\n \"InstanceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssociateElasticIp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"ElasticIp\": \"\",\n \"InstanceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"ElasticIp\": \"\",\n \"InstanceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssociateElasticIp";
let payload = json!({
"ElasticIp": "",
"InstanceId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssociateElasticIp' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ElasticIp": "",
"InstanceId": ""
}'
echo '{
"ElasticIp": "",
"InstanceId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssociateElasticIp' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ElasticIp": "",\n "InstanceId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssociateElasticIp'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"ElasticIp": "",
"InstanceId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AssociateElasticIp")! 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
AttachElasticLoadBalancer
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AttachElasticLoadBalancer
HEADERS
X-Amz-Target
BODY json
{
"ElasticLoadBalancerName": "",
"LayerId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AttachElasticLoadBalancer");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"ElasticLoadBalancerName\": \"\",\n \"LayerId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AttachElasticLoadBalancer" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ElasticLoadBalancerName ""
:LayerId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AttachElasticLoadBalancer"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ElasticLoadBalancerName\": \"\",\n \"LayerId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AttachElasticLoadBalancer"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ElasticLoadBalancerName\": \"\",\n \"LayerId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AttachElasticLoadBalancer");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ElasticLoadBalancerName\": \"\",\n \"LayerId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AttachElasticLoadBalancer"
payload := strings.NewReader("{\n \"ElasticLoadBalancerName\": \"\",\n \"LayerId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 52
{
"ElasticLoadBalancerName": "",
"LayerId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AttachElasticLoadBalancer")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ElasticLoadBalancerName\": \"\",\n \"LayerId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AttachElasticLoadBalancer"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ElasticLoadBalancerName\": \"\",\n \"LayerId\": \"\"\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 \"ElasticLoadBalancerName\": \"\",\n \"LayerId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AttachElasticLoadBalancer")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AttachElasticLoadBalancer")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ElasticLoadBalancerName\": \"\",\n \"LayerId\": \"\"\n}")
.asString();
const data = JSON.stringify({
ElasticLoadBalancerName: '',
LayerId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AttachElasticLoadBalancer');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AttachElasticLoadBalancer',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ElasticLoadBalancerName: '', LayerId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AttachElasticLoadBalancer';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ElasticLoadBalancerName":"","LayerId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AttachElasticLoadBalancer',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ElasticLoadBalancerName": "",\n "LayerId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ElasticLoadBalancerName\": \"\",\n \"LayerId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AttachElasticLoadBalancer")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({ElasticLoadBalancerName: '', LayerId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AttachElasticLoadBalancer',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {ElasticLoadBalancerName: '', LayerId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AttachElasticLoadBalancer');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ElasticLoadBalancerName: '',
LayerId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AttachElasticLoadBalancer',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ElasticLoadBalancerName: '', LayerId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AttachElasticLoadBalancer';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ElasticLoadBalancerName":"","LayerId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"ElasticLoadBalancerName": @"",
@"LayerId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AttachElasticLoadBalancer"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AttachElasticLoadBalancer" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"ElasticLoadBalancerName\": \"\",\n \"LayerId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AttachElasticLoadBalancer",
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([
'ElasticLoadBalancerName' => '',
'LayerId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AttachElasticLoadBalancer', [
'body' => '{
"ElasticLoadBalancerName": "",
"LayerId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AttachElasticLoadBalancer');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ElasticLoadBalancerName' => '',
'LayerId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ElasticLoadBalancerName' => '',
'LayerId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AttachElasticLoadBalancer');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AttachElasticLoadBalancer' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ElasticLoadBalancerName": "",
"LayerId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AttachElasticLoadBalancer' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ElasticLoadBalancerName": "",
"LayerId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ElasticLoadBalancerName\": \"\",\n \"LayerId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AttachElasticLoadBalancer"
payload = {
"ElasticLoadBalancerName": "",
"LayerId": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AttachElasticLoadBalancer"
payload <- "{\n \"ElasticLoadBalancerName\": \"\",\n \"LayerId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AttachElasticLoadBalancer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"ElasticLoadBalancerName\": \"\",\n \"LayerId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"ElasticLoadBalancerName\": \"\",\n \"LayerId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AttachElasticLoadBalancer";
let payload = json!({
"ElasticLoadBalancerName": "",
"LayerId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AttachElasticLoadBalancer' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ElasticLoadBalancerName": "",
"LayerId": ""
}'
echo '{
"ElasticLoadBalancerName": "",
"LayerId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AttachElasticLoadBalancer' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ElasticLoadBalancerName": "",\n "LayerId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AttachElasticLoadBalancer'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"ElasticLoadBalancerName": "",
"LayerId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.AttachElasticLoadBalancer")! 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
CloneStack
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CloneStack
HEADERS
X-Amz-Target
BODY json
{
"SourceStackId": "",
"Name": "",
"Region": "",
"VpcId": "",
"Attributes": "",
"ServiceRoleArn": "",
"DefaultInstanceProfileArn": "",
"DefaultOs": "",
"HostnameTheme": "",
"DefaultAvailabilityZone": "",
"DefaultSubnetId": "",
"CustomJson": "",
"ConfigurationManager": "",
"ChefConfiguration": "",
"UseCustomCookbooks": "",
"UseOpsworksSecurityGroups": "",
"CustomCookbooksSource": "",
"DefaultSshKeyName": "",
"ClonePermissions": "",
"CloneAppIds": "",
"DefaultRootDeviceType": "",
"AgentVersion": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CloneStack");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"SourceStackId\": \"\",\n \"Name\": \"\",\n \"Region\": \"\",\n \"VpcId\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"ClonePermissions\": \"\",\n \"CloneAppIds\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"AgentVersion\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CloneStack" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:SourceStackId ""
:Name ""
:Region ""
:VpcId ""
:Attributes ""
:ServiceRoleArn ""
:DefaultInstanceProfileArn ""
:DefaultOs ""
:HostnameTheme ""
:DefaultAvailabilityZone ""
:DefaultSubnetId ""
:CustomJson ""
:ConfigurationManager ""
:ChefConfiguration ""
:UseCustomCookbooks ""
:UseOpsworksSecurityGroups ""
:CustomCookbooksSource ""
:DefaultSshKeyName ""
:ClonePermissions ""
:CloneAppIds ""
:DefaultRootDeviceType ""
:AgentVersion ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CloneStack"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"SourceStackId\": \"\",\n \"Name\": \"\",\n \"Region\": \"\",\n \"VpcId\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"ClonePermissions\": \"\",\n \"CloneAppIds\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"AgentVersion\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CloneStack"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"SourceStackId\": \"\",\n \"Name\": \"\",\n \"Region\": \"\",\n \"VpcId\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"ClonePermissions\": \"\",\n \"CloneAppIds\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"AgentVersion\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CloneStack");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"SourceStackId\": \"\",\n \"Name\": \"\",\n \"Region\": \"\",\n \"VpcId\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"ClonePermissions\": \"\",\n \"CloneAppIds\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"AgentVersion\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CloneStack"
payload := strings.NewReader("{\n \"SourceStackId\": \"\",\n \"Name\": \"\",\n \"Region\": \"\",\n \"VpcId\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"ClonePermissions\": \"\",\n \"CloneAppIds\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"AgentVersion\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 547
{
"SourceStackId": "",
"Name": "",
"Region": "",
"VpcId": "",
"Attributes": "",
"ServiceRoleArn": "",
"DefaultInstanceProfileArn": "",
"DefaultOs": "",
"HostnameTheme": "",
"DefaultAvailabilityZone": "",
"DefaultSubnetId": "",
"CustomJson": "",
"ConfigurationManager": "",
"ChefConfiguration": "",
"UseCustomCookbooks": "",
"UseOpsworksSecurityGroups": "",
"CustomCookbooksSource": "",
"DefaultSshKeyName": "",
"ClonePermissions": "",
"CloneAppIds": "",
"DefaultRootDeviceType": "",
"AgentVersion": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CloneStack")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"SourceStackId\": \"\",\n \"Name\": \"\",\n \"Region\": \"\",\n \"VpcId\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"ClonePermissions\": \"\",\n \"CloneAppIds\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"AgentVersion\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CloneStack"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"SourceStackId\": \"\",\n \"Name\": \"\",\n \"Region\": \"\",\n \"VpcId\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"ClonePermissions\": \"\",\n \"CloneAppIds\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"AgentVersion\": \"\"\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 \"SourceStackId\": \"\",\n \"Name\": \"\",\n \"Region\": \"\",\n \"VpcId\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"ClonePermissions\": \"\",\n \"CloneAppIds\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"AgentVersion\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CloneStack")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CloneStack")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"SourceStackId\": \"\",\n \"Name\": \"\",\n \"Region\": \"\",\n \"VpcId\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"ClonePermissions\": \"\",\n \"CloneAppIds\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"AgentVersion\": \"\"\n}")
.asString();
const data = JSON.stringify({
SourceStackId: '',
Name: '',
Region: '',
VpcId: '',
Attributes: '',
ServiceRoleArn: '',
DefaultInstanceProfileArn: '',
DefaultOs: '',
HostnameTheme: '',
DefaultAvailabilityZone: '',
DefaultSubnetId: '',
CustomJson: '',
ConfigurationManager: '',
ChefConfiguration: '',
UseCustomCookbooks: '',
UseOpsworksSecurityGroups: '',
CustomCookbooksSource: '',
DefaultSshKeyName: '',
ClonePermissions: '',
CloneAppIds: '',
DefaultRootDeviceType: '',
AgentVersion: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CloneStack');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CloneStack',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
SourceStackId: '',
Name: '',
Region: '',
VpcId: '',
Attributes: '',
ServiceRoleArn: '',
DefaultInstanceProfileArn: '',
DefaultOs: '',
HostnameTheme: '',
DefaultAvailabilityZone: '',
DefaultSubnetId: '',
CustomJson: '',
ConfigurationManager: '',
ChefConfiguration: '',
UseCustomCookbooks: '',
UseOpsworksSecurityGroups: '',
CustomCookbooksSource: '',
DefaultSshKeyName: '',
ClonePermissions: '',
CloneAppIds: '',
DefaultRootDeviceType: '',
AgentVersion: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CloneStack';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"SourceStackId":"","Name":"","Region":"","VpcId":"","Attributes":"","ServiceRoleArn":"","DefaultInstanceProfileArn":"","DefaultOs":"","HostnameTheme":"","DefaultAvailabilityZone":"","DefaultSubnetId":"","CustomJson":"","ConfigurationManager":"","ChefConfiguration":"","UseCustomCookbooks":"","UseOpsworksSecurityGroups":"","CustomCookbooksSource":"","DefaultSshKeyName":"","ClonePermissions":"","CloneAppIds":"","DefaultRootDeviceType":"","AgentVersion":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CloneStack',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "SourceStackId": "",\n "Name": "",\n "Region": "",\n "VpcId": "",\n "Attributes": "",\n "ServiceRoleArn": "",\n "DefaultInstanceProfileArn": "",\n "DefaultOs": "",\n "HostnameTheme": "",\n "DefaultAvailabilityZone": "",\n "DefaultSubnetId": "",\n "CustomJson": "",\n "ConfigurationManager": "",\n "ChefConfiguration": "",\n "UseCustomCookbooks": "",\n "UseOpsworksSecurityGroups": "",\n "CustomCookbooksSource": "",\n "DefaultSshKeyName": "",\n "ClonePermissions": "",\n "CloneAppIds": "",\n "DefaultRootDeviceType": "",\n "AgentVersion": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"SourceStackId\": \"\",\n \"Name\": \"\",\n \"Region\": \"\",\n \"VpcId\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"ClonePermissions\": \"\",\n \"CloneAppIds\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"AgentVersion\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CloneStack")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
SourceStackId: '',
Name: '',
Region: '',
VpcId: '',
Attributes: '',
ServiceRoleArn: '',
DefaultInstanceProfileArn: '',
DefaultOs: '',
HostnameTheme: '',
DefaultAvailabilityZone: '',
DefaultSubnetId: '',
CustomJson: '',
ConfigurationManager: '',
ChefConfiguration: '',
UseCustomCookbooks: '',
UseOpsworksSecurityGroups: '',
CustomCookbooksSource: '',
DefaultSshKeyName: '',
ClonePermissions: '',
CloneAppIds: '',
DefaultRootDeviceType: '',
AgentVersion: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CloneStack',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
SourceStackId: '',
Name: '',
Region: '',
VpcId: '',
Attributes: '',
ServiceRoleArn: '',
DefaultInstanceProfileArn: '',
DefaultOs: '',
HostnameTheme: '',
DefaultAvailabilityZone: '',
DefaultSubnetId: '',
CustomJson: '',
ConfigurationManager: '',
ChefConfiguration: '',
UseCustomCookbooks: '',
UseOpsworksSecurityGroups: '',
CustomCookbooksSource: '',
DefaultSshKeyName: '',
ClonePermissions: '',
CloneAppIds: '',
DefaultRootDeviceType: '',
AgentVersion: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CloneStack');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
SourceStackId: '',
Name: '',
Region: '',
VpcId: '',
Attributes: '',
ServiceRoleArn: '',
DefaultInstanceProfileArn: '',
DefaultOs: '',
HostnameTheme: '',
DefaultAvailabilityZone: '',
DefaultSubnetId: '',
CustomJson: '',
ConfigurationManager: '',
ChefConfiguration: '',
UseCustomCookbooks: '',
UseOpsworksSecurityGroups: '',
CustomCookbooksSource: '',
DefaultSshKeyName: '',
ClonePermissions: '',
CloneAppIds: '',
DefaultRootDeviceType: '',
AgentVersion: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CloneStack',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
SourceStackId: '',
Name: '',
Region: '',
VpcId: '',
Attributes: '',
ServiceRoleArn: '',
DefaultInstanceProfileArn: '',
DefaultOs: '',
HostnameTheme: '',
DefaultAvailabilityZone: '',
DefaultSubnetId: '',
CustomJson: '',
ConfigurationManager: '',
ChefConfiguration: '',
UseCustomCookbooks: '',
UseOpsworksSecurityGroups: '',
CustomCookbooksSource: '',
DefaultSshKeyName: '',
ClonePermissions: '',
CloneAppIds: '',
DefaultRootDeviceType: '',
AgentVersion: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CloneStack';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"SourceStackId":"","Name":"","Region":"","VpcId":"","Attributes":"","ServiceRoleArn":"","DefaultInstanceProfileArn":"","DefaultOs":"","HostnameTheme":"","DefaultAvailabilityZone":"","DefaultSubnetId":"","CustomJson":"","ConfigurationManager":"","ChefConfiguration":"","UseCustomCookbooks":"","UseOpsworksSecurityGroups":"","CustomCookbooksSource":"","DefaultSshKeyName":"","ClonePermissions":"","CloneAppIds":"","DefaultRootDeviceType":"","AgentVersion":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"SourceStackId": @"",
@"Name": @"",
@"Region": @"",
@"VpcId": @"",
@"Attributes": @"",
@"ServiceRoleArn": @"",
@"DefaultInstanceProfileArn": @"",
@"DefaultOs": @"",
@"HostnameTheme": @"",
@"DefaultAvailabilityZone": @"",
@"DefaultSubnetId": @"",
@"CustomJson": @"",
@"ConfigurationManager": @"",
@"ChefConfiguration": @"",
@"UseCustomCookbooks": @"",
@"UseOpsworksSecurityGroups": @"",
@"CustomCookbooksSource": @"",
@"DefaultSshKeyName": @"",
@"ClonePermissions": @"",
@"CloneAppIds": @"",
@"DefaultRootDeviceType": @"",
@"AgentVersion": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CloneStack"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CloneStack" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"SourceStackId\": \"\",\n \"Name\": \"\",\n \"Region\": \"\",\n \"VpcId\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"ClonePermissions\": \"\",\n \"CloneAppIds\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"AgentVersion\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CloneStack",
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([
'SourceStackId' => '',
'Name' => '',
'Region' => '',
'VpcId' => '',
'Attributes' => '',
'ServiceRoleArn' => '',
'DefaultInstanceProfileArn' => '',
'DefaultOs' => '',
'HostnameTheme' => '',
'DefaultAvailabilityZone' => '',
'DefaultSubnetId' => '',
'CustomJson' => '',
'ConfigurationManager' => '',
'ChefConfiguration' => '',
'UseCustomCookbooks' => '',
'UseOpsworksSecurityGroups' => '',
'CustomCookbooksSource' => '',
'DefaultSshKeyName' => '',
'ClonePermissions' => '',
'CloneAppIds' => '',
'DefaultRootDeviceType' => '',
'AgentVersion' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CloneStack', [
'body' => '{
"SourceStackId": "",
"Name": "",
"Region": "",
"VpcId": "",
"Attributes": "",
"ServiceRoleArn": "",
"DefaultInstanceProfileArn": "",
"DefaultOs": "",
"HostnameTheme": "",
"DefaultAvailabilityZone": "",
"DefaultSubnetId": "",
"CustomJson": "",
"ConfigurationManager": "",
"ChefConfiguration": "",
"UseCustomCookbooks": "",
"UseOpsworksSecurityGroups": "",
"CustomCookbooksSource": "",
"DefaultSshKeyName": "",
"ClonePermissions": "",
"CloneAppIds": "",
"DefaultRootDeviceType": "",
"AgentVersion": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CloneStack');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'SourceStackId' => '',
'Name' => '',
'Region' => '',
'VpcId' => '',
'Attributes' => '',
'ServiceRoleArn' => '',
'DefaultInstanceProfileArn' => '',
'DefaultOs' => '',
'HostnameTheme' => '',
'DefaultAvailabilityZone' => '',
'DefaultSubnetId' => '',
'CustomJson' => '',
'ConfigurationManager' => '',
'ChefConfiguration' => '',
'UseCustomCookbooks' => '',
'UseOpsworksSecurityGroups' => '',
'CustomCookbooksSource' => '',
'DefaultSshKeyName' => '',
'ClonePermissions' => '',
'CloneAppIds' => '',
'DefaultRootDeviceType' => '',
'AgentVersion' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'SourceStackId' => '',
'Name' => '',
'Region' => '',
'VpcId' => '',
'Attributes' => '',
'ServiceRoleArn' => '',
'DefaultInstanceProfileArn' => '',
'DefaultOs' => '',
'HostnameTheme' => '',
'DefaultAvailabilityZone' => '',
'DefaultSubnetId' => '',
'CustomJson' => '',
'ConfigurationManager' => '',
'ChefConfiguration' => '',
'UseCustomCookbooks' => '',
'UseOpsworksSecurityGroups' => '',
'CustomCookbooksSource' => '',
'DefaultSshKeyName' => '',
'ClonePermissions' => '',
'CloneAppIds' => '',
'DefaultRootDeviceType' => '',
'AgentVersion' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CloneStack');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CloneStack' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SourceStackId": "",
"Name": "",
"Region": "",
"VpcId": "",
"Attributes": "",
"ServiceRoleArn": "",
"DefaultInstanceProfileArn": "",
"DefaultOs": "",
"HostnameTheme": "",
"DefaultAvailabilityZone": "",
"DefaultSubnetId": "",
"CustomJson": "",
"ConfigurationManager": "",
"ChefConfiguration": "",
"UseCustomCookbooks": "",
"UseOpsworksSecurityGroups": "",
"CustomCookbooksSource": "",
"DefaultSshKeyName": "",
"ClonePermissions": "",
"CloneAppIds": "",
"DefaultRootDeviceType": "",
"AgentVersion": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CloneStack' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SourceStackId": "",
"Name": "",
"Region": "",
"VpcId": "",
"Attributes": "",
"ServiceRoleArn": "",
"DefaultInstanceProfileArn": "",
"DefaultOs": "",
"HostnameTheme": "",
"DefaultAvailabilityZone": "",
"DefaultSubnetId": "",
"CustomJson": "",
"ConfigurationManager": "",
"ChefConfiguration": "",
"UseCustomCookbooks": "",
"UseOpsworksSecurityGroups": "",
"CustomCookbooksSource": "",
"DefaultSshKeyName": "",
"ClonePermissions": "",
"CloneAppIds": "",
"DefaultRootDeviceType": "",
"AgentVersion": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"SourceStackId\": \"\",\n \"Name\": \"\",\n \"Region\": \"\",\n \"VpcId\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"ClonePermissions\": \"\",\n \"CloneAppIds\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"AgentVersion\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CloneStack"
payload = {
"SourceStackId": "",
"Name": "",
"Region": "",
"VpcId": "",
"Attributes": "",
"ServiceRoleArn": "",
"DefaultInstanceProfileArn": "",
"DefaultOs": "",
"HostnameTheme": "",
"DefaultAvailabilityZone": "",
"DefaultSubnetId": "",
"CustomJson": "",
"ConfigurationManager": "",
"ChefConfiguration": "",
"UseCustomCookbooks": "",
"UseOpsworksSecurityGroups": "",
"CustomCookbooksSource": "",
"DefaultSshKeyName": "",
"ClonePermissions": "",
"CloneAppIds": "",
"DefaultRootDeviceType": "",
"AgentVersion": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CloneStack"
payload <- "{\n \"SourceStackId\": \"\",\n \"Name\": \"\",\n \"Region\": \"\",\n \"VpcId\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"ClonePermissions\": \"\",\n \"CloneAppIds\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"AgentVersion\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CloneStack")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"SourceStackId\": \"\",\n \"Name\": \"\",\n \"Region\": \"\",\n \"VpcId\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"ClonePermissions\": \"\",\n \"CloneAppIds\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"AgentVersion\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"SourceStackId\": \"\",\n \"Name\": \"\",\n \"Region\": \"\",\n \"VpcId\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"ClonePermissions\": \"\",\n \"CloneAppIds\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"AgentVersion\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CloneStack";
let payload = json!({
"SourceStackId": "",
"Name": "",
"Region": "",
"VpcId": "",
"Attributes": "",
"ServiceRoleArn": "",
"DefaultInstanceProfileArn": "",
"DefaultOs": "",
"HostnameTheme": "",
"DefaultAvailabilityZone": "",
"DefaultSubnetId": "",
"CustomJson": "",
"ConfigurationManager": "",
"ChefConfiguration": "",
"UseCustomCookbooks": "",
"UseOpsworksSecurityGroups": "",
"CustomCookbooksSource": "",
"DefaultSshKeyName": "",
"ClonePermissions": "",
"CloneAppIds": "",
"DefaultRootDeviceType": "",
"AgentVersion": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CloneStack' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"SourceStackId": "",
"Name": "",
"Region": "",
"VpcId": "",
"Attributes": "",
"ServiceRoleArn": "",
"DefaultInstanceProfileArn": "",
"DefaultOs": "",
"HostnameTheme": "",
"DefaultAvailabilityZone": "",
"DefaultSubnetId": "",
"CustomJson": "",
"ConfigurationManager": "",
"ChefConfiguration": "",
"UseCustomCookbooks": "",
"UseOpsworksSecurityGroups": "",
"CustomCookbooksSource": "",
"DefaultSshKeyName": "",
"ClonePermissions": "",
"CloneAppIds": "",
"DefaultRootDeviceType": "",
"AgentVersion": ""
}'
echo '{
"SourceStackId": "",
"Name": "",
"Region": "",
"VpcId": "",
"Attributes": "",
"ServiceRoleArn": "",
"DefaultInstanceProfileArn": "",
"DefaultOs": "",
"HostnameTheme": "",
"DefaultAvailabilityZone": "",
"DefaultSubnetId": "",
"CustomJson": "",
"ConfigurationManager": "",
"ChefConfiguration": "",
"UseCustomCookbooks": "",
"UseOpsworksSecurityGroups": "",
"CustomCookbooksSource": "",
"DefaultSshKeyName": "",
"ClonePermissions": "",
"CloneAppIds": "",
"DefaultRootDeviceType": "",
"AgentVersion": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CloneStack' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "SourceStackId": "",\n "Name": "",\n "Region": "",\n "VpcId": "",\n "Attributes": "",\n "ServiceRoleArn": "",\n "DefaultInstanceProfileArn": "",\n "DefaultOs": "",\n "HostnameTheme": "",\n "DefaultAvailabilityZone": "",\n "DefaultSubnetId": "",\n "CustomJson": "",\n "ConfigurationManager": "",\n "ChefConfiguration": "",\n "UseCustomCookbooks": "",\n "UseOpsworksSecurityGroups": "",\n "CustomCookbooksSource": "",\n "DefaultSshKeyName": "",\n "ClonePermissions": "",\n "CloneAppIds": "",\n "DefaultRootDeviceType": "",\n "AgentVersion": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CloneStack'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"SourceStackId": "",
"Name": "",
"Region": "",
"VpcId": "",
"Attributes": "",
"ServiceRoleArn": "",
"DefaultInstanceProfileArn": "",
"DefaultOs": "",
"HostnameTheme": "",
"DefaultAvailabilityZone": "",
"DefaultSubnetId": "",
"CustomJson": "",
"ConfigurationManager": "",
"ChefConfiguration": "",
"UseCustomCookbooks": "",
"UseOpsworksSecurityGroups": "",
"CustomCookbooksSource": "",
"DefaultSshKeyName": "",
"ClonePermissions": "",
"CloneAppIds": "",
"DefaultRootDeviceType": "",
"AgentVersion": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CloneStack")! 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
CreateApp
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateApp
HEADERS
X-Amz-Target
BODY json
{
"StackId": "",
"Shortname": "",
"Name": "",
"Description": "",
"DataSources": "",
"Type": "",
"AppSource": "",
"Domains": "",
"EnableSsl": "",
"SslConfiguration": "",
"Attributes": "",
"Environment": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateApp");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"StackId\": \"\",\n \"Shortname\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"DataSources\": \"\",\n \"Type\": \"\",\n \"AppSource\": \"\",\n \"Domains\": \"\",\n \"EnableSsl\": \"\",\n \"SslConfiguration\": \"\",\n \"Attributes\": \"\",\n \"Environment\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateApp" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:StackId ""
:Shortname ""
:Name ""
:Description ""
:DataSources ""
:Type ""
:AppSource ""
:Domains ""
:EnableSsl ""
:SslConfiguration ""
:Attributes ""
:Environment ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateApp"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"StackId\": \"\",\n \"Shortname\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"DataSources\": \"\",\n \"Type\": \"\",\n \"AppSource\": \"\",\n \"Domains\": \"\",\n \"EnableSsl\": \"\",\n \"SslConfiguration\": \"\",\n \"Attributes\": \"\",\n \"Environment\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateApp"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"StackId\": \"\",\n \"Shortname\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"DataSources\": \"\",\n \"Type\": \"\",\n \"AppSource\": \"\",\n \"Domains\": \"\",\n \"EnableSsl\": \"\",\n \"SslConfiguration\": \"\",\n \"Attributes\": \"\",\n \"Environment\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateApp");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"StackId\": \"\",\n \"Shortname\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"DataSources\": \"\",\n \"Type\": \"\",\n \"AppSource\": \"\",\n \"Domains\": \"\",\n \"EnableSsl\": \"\",\n \"SslConfiguration\": \"\",\n \"Attributes\": \"\",\n \"Environment\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateApp"
payload := strings.NewReader("{\n \"StackId\": \"\",\n \"Shortname\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"DataSources\": \"\",\n \"Type\": \"\",\n \"AppSource\": \"\",\n \"Domains\": \"\",\n \"EnableSsl\": \"\",\n \"SslConfiguration\": \"\",\n \"Attributes\": \"\",\n \"Environment\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 230
{
"StackId": "",
"Shortname": "",
"Name": "",
"Description": "",
"DataSources": "",
"Type": "",
"AppSource": "",
"Domains": "",
"EnableSsl": "",
"SslConfiguration": "",
"Attributes": "",
"Environment": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateApp")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"StackId\": \"\",\n \"Shortname\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"DataSources\": \"\",\n \"Type\": \"\",\n \"AppSource\": \"\",\n \"Domains\": \"\",\n \"EnableSsl\": \"\",\n \"SslConfiguration\": \"\",\n \"Attributes\": \"\",\n \"Environment\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateApp"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"StackId\": \"\",\n \"Shortname\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"DataSources\": \"\",\n \"Type\": \"\",\n \"AppSource\": \"\",\n \"Domains\": \"\",\n \"EnableSsl\": \"\",\n \"SslConfiguration\": \"\",\n \"Attributes\": \"\",\n \"Environment\": \"\"\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 \"StackId\": \"\",\n \"Shortname\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"DataSources\": \"\",\n \"Type\": \"\",\n \"AppSource\": \"\",\n \"Domains\": \"\",\n \"EnableSsl\": \"\",\n \"SslConfiguration\": \"\",\n \"Attributes\": \"\",\n \"Environment\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateApp")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateApp")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"StackId\": \"\",\n \"Shortname\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"DataSources\": \"\",\n \"Type\": \"\",\n \"AppSource\": \"\",\n \"Domains\": \"\",\n \"EnableSsl\": \"\",\n \"SslConfiguration\": \"\",\n \"Attributes\": \"\",\n \"Environment\": \"\"\n}")
.asString();
const data = JSON.stringify({
StackId: '',
Shortname: '',
Name: '',
Description: '',
DataSources: '',
Type: '',
AppSource: '',
Domains: '',
EnableSsl: '',
SslConfiguration: '',
Attributes: '',
Environment: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateApp');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateApp',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
StackId: '',
Shortname: '',
Name: '',
Description: '',
DataSources: '',
Type: '',
AppSource: '',
Domains: '',
EnableSsl: '',
SslConfiguration: '',
Attributes: '',
Environment: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateApp';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":"","Shortname":"","Name":"","Description":"","DataSources":"","Type":"","AppSource":"","Domains":"","EnableSsl":"","SslConfiguration":"","Attributes":"","Environment":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateApp',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "StackId": "",\n "Shortname": "",\n "Name": "",\n "Description": "",\n "DataSources": "",\n "Type": "",\n "AppSource": "",\n "Domains": "",\n "EnableSsl": "",\n "SslConfiguration": "",\n "Attributes": "",\n "Environment": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"StackId\": \"\",\n \"Shortname\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"DataSources\": \"\",\n \"Type\": \"\",\n \"AppSource\": \"\",\n \"Domains\": \"\",\n \"EnableSsl\": \"\",\n \"SslConfiguration\": \"\",\n \"Attributes\": \"\",\n \"Environment\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateApp")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
StackId: '',
Shortname: '',
Name: '',
Description: '',
DataSources: '',
Type: '',
AppSource: '',
Domains: '',
EnableSsl: '',
SslConfiguration: '',
Attributes: '',
Environment: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateApp',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
StackId: '',
Shortname: '',
Name: '',
Description: '',
DataSources: '',
Type: '',
AppSource: '',
Domains: '',
EnableSsl: '',
SslConfiguration: '',
Attributes: '',
Environment: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateApp');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
StackId: '',
Shortname: '',
Name: '',
Description: '',
DataSources: '',
Type: '',
AppSource: '',
Domains: '',
EnableSsl: '',
SslConfiguration: '',
Attributes: '',
Environment: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateApp',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
StackId: '',
Shortname: '',
Name: '',
Description: '',
DataSources: '',
Type: '',
AppSource: '',
Domains: '',
EnableSsl: '',
SslConfiguration: '',
Attributes: '',
Environment: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateApp';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":"","Shortname":"","Name":"","Description":"","DataSources":"","Type":"","AppSource":"","Domains":"","EnableSsl":"","SslConfiguration":"","Attributes":"","Environment":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"StackId": @"",
@"Shortname": @"",
@"Name": @"",
@"Description": @"",
@"DataSources": @"",
@"Type": @"",
@"AppSource": @"",
@"Domains": @"",
@"EnableSsl": @"",
@"SslConfiguration": @"",
@"Attributes": @"",
@"Environment": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateApp"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateApp" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"StackId\": \"\",\n \"Shortname\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"DataSources\": \"\",\n \"Type\": \"\",\n \"AppSource\": \"\",\n \"Domains\": \"\",\n \"EnableSsl\": \"\",\n \"SslConfiguration\": \"\",\n \"Attributes\": \"\",\n \"Environment\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateApp",
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([
'StackId' => '',
'Shortname' => '',
'Name' => '',
'Description' => '',
'DataSources' => '',
'Type' => '',
'AppSource' => '',
'Domains' => '',
'EnableSsl' => '',
'SslConfiguration' => '',
'Attributes' => '',
'Environment' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateApp', [
'body' => '{
"StackId": "",
"Shortname": "",
"Name": "",
"Description": "",
"DataSources": "",
"Type": "",
"AppSource": "",
"Domains": "",
"EnableSsl": "",
"SslConfiguration": "",
"Attributes": "",
"Environment": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateApp');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'StackId' => '',
'Shortname' => '',
'Name' => '',
'Description' => '',
'DataSources' => '',
'Type' => '',
'AppSource' => '',
'Domains' => '',
'EnableSsl' => '',
'SslConfiguration' => '',
'Attributes' => '',
'Environment' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'StackId' => '',
'Shortname' => '',
'Name' => '',
'Description' => '',
'DataSources' => '',
'Type' => '',
'AppSource' => '',
'Domains' => '',
'EnableSsl' => '',
'SslConfiguration' => '',
'Attributes' => '',
'Environment' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateApp');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateApp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": "",
"Shortname": "",
"Name": "",
"Description": "",
"DataSources": "",
"Type": "",
"AppSource": "",
"Domains": "",
"EnableSsl": "",
"SslConfiguration": "",
"Attributes": "",
"Environment": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateApp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": "",
"Shortname": "",
"Name": "",
"Description": "",
"DataSources": "",
"Type": "",
"AppSource": "",
"Domains": "",
"EnableSsl": "",
"SslConfiguration": "",
"Attributes": "",
"Environment": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"StackId\": \"\",\n \"Shortname\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"DataSources\": \"\",\n \"Type\": \"\",\n \"AppSource\": \"\",\n \"Domains\": \"\",\n \"EnableSsl\": \"\",\n \"SslConfiguration\": \"\",\n \"Attributes\": \"\",\n \"Environment\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateApp"
payload = {
"StackId": "",
"Shortname": "",
"Name": "",
"Description": "",
"DataSources": "",
"Type": "",
"AppSource": "",
"Domains": "",
"EnableSsl": "",
"SslConfiguration": "",
"Attributes": "",
"Environment": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateApp"
payload <- "{\n \"StackId\": \"\",\n \"Shortname\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"DataSources\": \"\",\n \"Type\": \"\",\n \"AppSource\": \"\",\n \"Domains\": \"\",\n \"EnableSsl\": \"\",\n \"SslConfiguration\": \"\",\n \"Attributes\": \"\",\n \"Environment\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateApp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"StackId\": \"\",\n \"Shortname\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"DataSources\": \"\",\n \"Type\": \"\",\n \"AppSource\": \"\",\n \"Domains\": \"\",\n \"EnableSsl\": \"\",\n \"SslConfiguration\": \"\",\n \"Attributes\": \"\",\n \"Environment\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"StackId\": \"\",\n \"Shortname\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"DataSources\": \"\",\n \"Type\": \"\",\n \"AppSource\": \"\",\n \"Domains\": \"\",\n \"EnableSsl\": \"\",\n \"SslConfiguration\": \"\",\n \"Attributes\": \"\",\n \"Environment\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateApp";
let payload = json!({
"StackId": "",
"Shortname": "",
"Name": "",
"Description": "",
"DataSources": "",
"Type": "",
"AppSource": "",
"Domains": "",
"EnableSsl": "",
"SslConfiguration": "",
"Attributes": "",
"Environment": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateApp' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"StackId": "",
"Shortname": "",
"Name": "",
"Description": "",
"DataSources": "",
"Type": "",
"AppSource": "",
"Domains": "",
"EnableSsl": "",
"SslConfiguration": "",
"Attributes": "",
"Environment": ""
}'
echo '{
"StackId": "",
"Shortname": "",
"Name": "",
"Description": "",
"DataSources": "",
"Type": "",
"AppSource": "",
"Domains": "",
"EnableSsl": "",
"SslConfiguration": "",
"Attributes": "",
"Environment": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateApp' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "StackId": "",\n "Shortname": "",\n "Name": "",\n "Description": "",\n "DataSources": "",\n "Type": "",\n "AppSource": "",\n "Domains": "",\n "EnableSsl": "",\n "SslConfiguration": "",\n "Attributes": "",\n "Environment": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateApp'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"StackId": "",
"Shortname": "",
"Name": "",
"Description": "",
"DataSources": "",
"Type": "",
"AppSource": "",
"Domains": "",
"EnableSsl": "",
"SslConfiguration": "",
"Attributes": "",
"Environment": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateApp")! 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
CreateDeployment
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateDeployment
HEADERS
X-Amz-Target
BODY json
{
"StackId": "",
"AppId": "",
"InstanceIds": "",
"LayerIds": "",
"Command": "",
"Comment": "",
"CustomJson": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateDeployment");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"StackId\": \"\",\n \"AppId\": \"\",\n \"InstanceIds\": \"\",\n \"LayerIds\": \"\",\n \"Command\": \"\",\n \"Comment\": \"\",\n \"CustomJson\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateDeployment" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:StackId ""
:AppId ""
:InstanceIds ""
:LayerIds ""
:Command ""
:Comment ""
:CustomJson ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateDeployment"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"StackId\": \"\",\n \"AppId\": \"\",\n \"InstanceIds\": \"\",\n \"LayerIds\": \"\",\n \"Command\": \"\",\n \"Comment\": \"\",\n \"CustomJson\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateDeployment"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"StackId\": \"\",\n \"AppId\": \"\",\n \"InstanceIds\": \"\",\n \"LayerIds\": \"\",\n \"Command\": \"\",\n \"Comment\": \"\",\n \"CustomJson\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateDeployment");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"StackId\": \"\",\n \"AppId\": \"\",\n \"InstanceIds\": \"\",\n \"LayerIds\": \"\",\n \"Command\": \"\",\n \"Comment\": \"\",\n \"CustomJson\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateDeployment"
payload := strings.NewReader("{\n \"StackId\": \"\",\n \"AppId\": \"\",\n \"InstanceIds\": \"\",\n \"LayerIds\": \"\",\n \"Command\": \"\",\n \"Comment\": \"\",\n \"CustomJson\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 127
{
"StackId": "",
"AppId": "",
"InstanceIds": "",
"LayerIds": "",
"Command": "",
"Comment": "",
"CustomJson": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateDeployment")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"StackId\": \"\",\n \"AppId\": \"\",\n \"InstanceIds\": \"\",\n \"LayerIds\": \"\",\n \"Command\": \"\",\n \"Comment\": \"\",\n \"CustomJson\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateDeployment"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"StackId\": \"\",\n \"AppId\": \"\",\n \"InstanceIds\": \"\",\n \"LayerIds\": \"\",\n \"Command\": \"\",\n \"Comment\": \"\",\n \"CustomJson\": \"\"\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 \"StackId\": \"\",\n \"AppId\": \"\",\n \"InstanceIds\": \"\",\n \"LayerIds\": \"\",\n \"Command\": \"\",\n \"Comment\": \"\",\n \"CustomJson\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateDeployment")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateDeployment")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"StackId\": \"\",\n \"AppId\": \"\",\n \"InstanceIds\": \"\",\n \"LayerIds\": \"\",\n \"Command\": \"\",\n \"Comment\": \"\",\n \"CustomJson\": \"\"\n}")
.asString();
const data = JSON.stringify({
StackId: '',
AppId: '',
InstanceIds: '',
LayerIds: '',
Command: '',
Comment: '',
CustomJson: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateDeployment');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateDeployment',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
StackId: '',
AppId: '',
InstanceIds: '',
LayerIds: '',
Command: '',
Comment: '',
CustomJson: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateDeployment';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":"","AppId":"","InstanceIds":"","LayerIds":"","Command":"","Comment":"","CustomJson":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateDeployment',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "StackId": "",\n "AppId": "",\n "InstanceIds": "",\n "LayerIds": "",\n "Command": "",\n "Comment": "",\n "CustomJson": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"StackId\": \"\",\n \"AppId\": \"\",\n \"InstanceIds\": \"\",\n \"LayerIds\": \"\",\n \"Command\": \"\",\n \"Comment\": \"\",\n \"CustomJson\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateDeployment")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
StackId: '',
AppId: '',
InstanceIds: '',
LayerIds: '',
Command: '',
Comment: '',
CustomJson: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateDeployment',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
StackId: '',
AppId: '',
InstanceIds: '',
LayerIds: '',
Command: '',
Comment: '',
CustomJson: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateDeployment');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
StackId: '',
AppId: '',
InstanceIds: '',
LayerIds: '',
Command: '',
Comment: '',
CustomJson: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateDeployment',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
StackId: '',
AppId: '',
InstanceIds: '',
LayerIds: '',
Command: '',
Comment: '',
CustomJson: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateDeployment';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":"","AppId":"","InstanceIds":"","LayerIds":"","Command":"","Comment":"","CustomJson":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"StackId": @"",
@"AppId": @"",
@"InstanceIds": @"",
@"LayerIds": @"",
@"Command": @"",
@"Comment": @"",
@"CustomJson": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateDeployment"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateDeployment" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"StackId\": \"\",\n \"AppId\": \"\",\n \"InstanceIds\": \"\",\n \"LayerIds\": \"\",\n \"Command\": \"\",\n \"Comment\": \"\",\n \"CustomJson\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateDeployment",
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([
'StackId' => '',
'AppId' => '',
'InstanceIds' => '',
'LayerIds' => '',
'Command' => '',
'Comment' => '',
'CustomJson' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateDeployment', [
'body' => '{
"StackId": "",
"AppId": "",
"InstanceIds": "",
"LayerIds": "",
"Command": "",
"Comment": "",
"CustomJson": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateDeployment');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'StackId' => '',
'AppId' => '',
'InstanceIds' => '',
'LayerIds' => '',
'Command' => '',
'Comment' => '',
'CustomJson' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'StackId' => '',
'AppId' => '',
'InstanceIds' => '',
'LayerIds' => '',
'Command' => '',
'Comment' => '',
'CustomJson' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateDeployment');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateDeployment' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": "",
"AppId": "",
"InstanceIds": "",
"LayerIds": "",
"Command": "",
"Comment": "",
"CustomJson": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateDeployment' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": "",
"AppId": "",
"InstanceIds": "",
"LayerIds": "",
"Command": "",
"Comment": "",
"CustomJson": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"StackId\": \"\",\n \"AppId\": \"\",\n \"InstanceIds\": \"\",\n \"LayerIds\": \"\",\n \"Command\": \"\",\n \"Comment\": \"\",\n \"CustomJson\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateDeployment"
payload = {
"StackId": "",
"AppId": "",
"InstanceIds": "",
"LayerIds": "",
"Command": "",
"Comment": "",
"CustomJson": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateDeployment"
payload <- "{\n \"StackId\": \"\",\n \"AppId\": \"\",\n \"InstanceIds\": \"\",\n \"LayerIds\": \"\",\n \"Command\": \"\",\n \"Comment\": \"\",\n \"CustomJson\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateDeployment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"StackId\": \"\",\n \"AppId\": \"\",\n \"InstanceIds\": \"\",\n \"LayerIds\": \"\",\n \"Command\": \"\",\n \"Comment\": \"\",\n \"CustomJson\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"StackId\": \"\",\n \"AppId\": \"\",\n \"InstanceIds\": \"\",\n \"LayerIds\": \"\",\n \"Command\": \"\",\n \"Comment\": \"\",\n \"CustomJson\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateDeployment";
let payload = json!({
"StackId": "",
"AppId": "",
"InstanceIds": "",
"LayerIds": "",
"Command": "",
"Comment": "",
"CustomJson": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateDeployment' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"StackId": "",
"AppId": "",
"InstanceIds": "",
"LayerIds": "",
"Command": "",
"Comment": "",
"CustomJson": ""
}'
echo '{
"StackId": "",
"AppId": "",
"InstanceIds": "",
"LayerIds": "",
"Command": "",
"Comment": "",
"CustomJson": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateDeployment' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "StackId": "",\n "AppId": "",\n "InstanceIds": "",\n "LayerIds": "",\n "Command": "",\n "Comment": "",\n "CustomJson": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateDeployment'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"StackId": "",
"AppId": "",
"InstanceIds": "",
"LayerIds": "",
"Command": "",
"Comment": "",
"CustomJson": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateDeployment")! 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
CreateInstance
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateInstance
HEADERS
X-Amz-Target
BODY json
{
"StackId": "",
"LayerIds": "",
"InstanceType": "",
"AutoScalingType": "",
"Hostname": "",
"Os": "",
"AmiId": "",
"SshKeyName": "",
"AvailabilityZone": "",
"VirtualizationType": "",
"SubnetId": "",
"Architecture": "",
"RootDeviceType": "",
"BlockDeviceMappings": "",
"InstallUpdatesOnBoot": "",
"EbsOptimized": "",
"AgentVersion": "",
"Tenancy": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateInstance");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"StackId\": \"\",\n \"LayerIds\": \"\",\n \"InstanceType\": \"\",\n \"AutoScalingType\": \"\",\n \"Hostname\": \"\",\n \"Os\": \"\",\n \"AmiId\": \"\",\n \"SshKeyName\": \"\",\n \"AvailabilityZone\": \"\",\n \"VirtualizationType\": \"\",\n \"SubnetId\": \"\",\n \"Architecture\": \"\",\n \"RootDeviceType\": \"\",\n \"BlockDeviceMappings\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"EbsOptimized\": \"\",\n \"AgentVersion\": \"\",\n \"Tenancy\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateInstance" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:StackId ""
:LayerIds ""
:InstanceType ""
:AutoScalingType ""
:Hostname ""
:Os ""
:AmiId ""
:SshKeyName ""
:AvailabilityZone ""
:VirtualizationType ""
:SubnetId ""
:Architecture ""
:RootDeviceType ""
:BlockDeviceMappings ""
:InstallUpdatesOnBoot ""
:EbsOptimized ""
:AgentVersion ""
:Tenancy ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateInstance"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"StackId\": \"\",\n \"LayerIds\": \"\",\n \"InstanceType\": \"\",\n \"AutoScalingType\": \"\",\n \"Hostname\": \"\",\n \"Os\": \"\",\n \"AmiId\": \"\",\n \"SshKeyName\": \"\",\n \"AvailabilityZone\": \"\",\n \"VirtualizationType\": \"\",\n \"SubnetId\": \"\",\n \"Architecture\": \"\",\n \"RootDeviceType\": \"\",\n \"BlockDeviceMappings\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"EbsOptimized\": \"\",\n \"AgentVersion\": \"\",\n \"Tenancy\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateInstance"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"StackId\": \"\",\n \"LayerIds\": \"\",\n \"InstanceType\": \"\",\n \"AutoScalingType\": \"\",\n \"Hostname\": \"\",\n \"Os\": \"\",\n \"AmiId\": \"\",\n \"SshKeyName\": \"\",\n \"AvailabilityZone\": \"\",\n \"VirtualizationType\": \"\",\n \"SubnetId\": \"\",\n \"Architecture\": \"\",\n \"RootDeviceType\": \"\",\n \"BlockDeviceMappings\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"EbsOptimized\": \"\",\n \"AgentVersion\": \"\",\n \"Tenancy\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateInstance");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"StackId\": \"\",\n \"LayerIds\": \"\",\n \"InstanceType\": \"\",\n \"AutoScalingType\": \"\",\n \"Hostname\": \"\",\n \"Os\": \"\",\n \"AmiId\": \"\",\n \"SshKeyName\": \"\",\n \"AvailabilityZone\": \"\",\n \"VirtualizationType\": \"\",\n \"SubnetId\": \"\",\n \"Architecture\": \"\",\n \"RootDeviceType\": \"\",\n \"BlockDeviceMappings\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"EbsOptimized\": \"\",\n \"AgentVersion\": \"\",\n \"Tenancy\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateInstance"
payload := strings.NewReader("{\n \"StackId\": \"\",\n \"LayerIds\": \"\",\n \"InstanceType\": \"\",\n \"AutoScalingType\": \"\",\n \"Hostname\": \"\",\n \"Os\": \"\",\n \"AmiId\": \"\",\n \"SshKeyName\": \"\",\n \"AvailabilityZone\": \"\",\n \"VirtualizationType\": \"\",\n \"SubnetId\": \"\",\n \"Architecture\": \"\",\n \"RootDeviceType\": \"\",\n \"BlockDeviceMappings\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"EbsOptimized\": \"\",\n \"AgentVersion\": \"\",\n \"Tenancy\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 387
{
"StackId": "",
"LayerIds": "",
"InstanceType": "",
"AutoScalingType": "",
"Hostname": "",
"Os": "",
"AmiId": "",
"SshKeyName": "",
"AvailabilityZone": "",
"VirtualizationType": "",
"SubnetId": "",
"Architecture": "",
"RootDeviceType": "",
"BlockDeviceMappings": "",
"InstallUpdatesOnBoot": "",
"EbsOptimized": "",
"AgentVersion": "",
"Tenancy": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateInstance")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"StackId\": \"\",\n \"LayerIds\": \"\",\n \"InstanceType\": \"\",\n \"AutoScalingType\": \"\",\n \"Hostname\": \"\",\n \"Os\": \"\",\n \"AmiId\": \"\",\n \"SshKeyName\": \"\",\n \"AvailabilityZone\": \"\",\n \"VirtualizationType\": \"\",\n \"SubnetId\": \"\",\n \"Architecture\": \"\",\n \"RootDeviceType\": \"\",\n \"BlockDeviceMappings\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"EbsOptimized\": \"\",\n \"AgentVersion\": \"\",\n \"Tenancy\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateInstance"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"StackId\": \"\",\n \"LayerIds\": \"\",\n \"InstanceType\": \"\",\n \"AutoScalingType\": \"\",\n \"Hostname\": \"\",\n \"Os\": \"\",\n \"AmiId\": \"\",\n \"SshKeyName\": \"\",\n \"AvailabilityZone\": \"\",\n \"VirtualizationType\": \"\",\n \"SubnetId\": \"\",\n \"Architecture\": \"\",\n \"RootDeviceType\": \"\",\n \"BlockDeviceMappings\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"EbsOptimized\": \"\",\n \"AgentVersion\": \"\",\n \"Tenancy\": \"\"\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 \"StackId\": \"\",\n \"LayerIds\": \"\",\n \"InstanceType\": \"\",\n \"AutoScalingType\": \"\",\n \"Hostname\": \"\",\n \"Os\": \"\",\n \"AmiId\": \"\",\n \"SshKeyName\": \"\",\n \"AvailabilityZone\": \"\",\n \"VirtualizationType\": \"\",\n \"SubnetId\": \"\",\n \"Architecture\": \"\",\n \"RootDeviceType\": \"\",\n \"BlockDeviceMappings\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"EbsOptimized\": \"\",\n \"AgentVersion\": \"\",\n \"Tenancy\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateInstance")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateInstance")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"StackId\": \"\",\n \"LayerIds\": \"\",\n \"InstanceType\": \"\",\n \"AutoScalingType\": \"\",\n \"Hostname\": \"\",\n \"Os\": \"\",\n \"AmiId\": \"\",\n \"SshKeyName\": \"\",\n \"AvailabilityZone\": \"\",\n \"VirtualizationType\": \"\",\n \"SubnetId\": \"\",\n \"Architecture\": \"\",\n \"RootDeviceType\": \"\",\n \"BlockDeviceMappings\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"EbsOptimized\": \"\",\n \"AgentVersion\": \"\",\n \"Tenancy\": \"\"\n}")
.asString();
const data = JSON.stringify({
StackId: '',
LayerIds: '',
InstanceType: '',
AutoScalingType: '',
Hostname: '',
Os: '',
AmiId: '',
SshKeyName: '',
AvailabilityZone: '',
VirtualizationType: '',
SubnetId: '',
Architecture: '',
RootDeviceType: '',
BlockDeviceMappings: '',
InstallUpdatesOnBoot: '',
EbsOptimized: '',
AgentVersion: '',
Tenancy: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateInstance');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
StackId: '',
LayerIds: '',
InstanceType: '',
AutoScalingType: '',
Hostname: '',
Os: '',
AmiId: '',
SshKeyName: '',
AvailabilityZone: '',
VirtualizationType: '',
SubnetId: '',
Architecture: '',
RootDeviceType: '',
BlockDeviceMappings: '',
InstallUpdatesOnBoot: '',
EbsOptimized: '',
AgentVersion: '',
Tenancy: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateInstance';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":"","LayerIds":"","InstanceType":"","AutoScalingType":"","Hostname":"","Os":"","AmiId":"","SshKeyName":"","AvailabilityZone":"","VirtualizationType":"","SubnetId":"","Architecture":"","RootDeviceType":"","BlockDeviceMappings":"","InstallUpdatesOnBoot":"","EbsOptimized":"","AgentVersion":"","Tenancy":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateInstance',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "StackId": "",\n "LayerIds": "",\n "InstanceType": "",\n "AutoScalingType": "",\n "Hostname": "",\n "Os": "",\n "AmiId": "",\n "SshKeyName": "",\n "AvailabilityZone": "",\n "VirtualizationType": "",\n "SubnetId": "",\n "Architecture": "",\n "RootDeviceType": "",\n "BlockDeviceMappings": "",\n "InstallUpdatesOnBoot": "",\n "EbsOptimized": "",\n "AgentVersion": "",\n "Tenancy": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"StackId\": \"\",\n \"LayerIds\": \"\",\n \"InstanceType\": \"\",\n \"AutoScalingType\": \"\",\n \"Hostname\": \"\",\n \"Os\": \"\",\n \"AmiId\": \"\",\n \"SshKeyName\": \"\",\n \"AvailabilityZone\": \"\",\n \"VirtualizationType\": \"\",\n \"SubnetId\": \"\",\n \"Architecture\": \"\",\n \"RootDeviceType\": \"\",\n \"BlockDeviceMappings\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"EbsOptimized\": \"\",\n \"AgentVersion\": \"\",\n \"Tenancy\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateInstance")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
StackId: '',
LayerIds: '',
InstanceType: '',
AutoScalingType: '',
Hostname: '',
Os: '',
AmiId: '',
SshKeyName: '',
AvailabilityZone: '',
VirtualizationType: '',
SubnetId: '',
Architecture: '',
RootDeviceType: '',
BlockDeviceMappings: '',
InstallUpdatesOnBoot: '',
EbsOptimized: '',
AgentVersion: '',
Tenancy: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
StackId: '',
LayerIds: '',
InstanceType: '',
AutoScalingType: '',
Hostname: '',
Os: '',
AmiId: '',
SshKeyName: '',
AvailabilityZone: '',
VirtualizationType: '',
SubnetId: '',
Architecture: '',
RootDeviceType: '',
BlockDeviceMappings: '',
InstallUpdatesOnBoot: '',
EbsOptimized: '',
AgentVersion: '',
Tenancy: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateInstance');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
StackId: '',
LayerIds: '',
InstanceType: '',
AutoScalingType: '',
Hostname: '',
Os: '',
AmiId: '',
SshKeyName: '',
AvailabilityZone: '',
VirtualizationType: '',
SubnetId: '',
Architecture: '',
RootDeviceType: '',
BlockDeviceMappings: '',
InstallUpdatesOnBoot: '',
EbsOptimized: '',
AgentVersion: '',
Tenancy: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
StackId: '',
LayerIds: '',
InstanceType: '',
AutoScalingType: '',
Hostname: '',
Os: '',
AmiId: '',
SshKeyName: '',
AvailabilityZone: '',
VirtualizationType: '',
SubnetId: '',
Architecture: '',
RootDeviceType: '',
BlockDeviceMappings: '',
InstallUpdatesOnBoot: '',
EbsOptimized: '',
AgentVersion: '',
Tenancy: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateInstance';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":"","LayerIds":"","InstanceType":"","AutoScalingType":"","Hostname":"","Os":"","AmiId":"","SshKeyName":"","AvailabilityZone":"","VirtualizationType":"","SubnetId":"","Architecture":"","RootDeviceType":"","BlockDeviceMappings":"","InstallUpdatesOnBoot":"","EbsOptimized":"","AgentVersion":"","Tenancy":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"StackId": @"",
@"LayerIds": @"",
@"InstanceType": @"",
@"AutoScalingType": @"",
@"Hostname": @"",
@"Os": @"",
@"AmiId": @"",
@"SshKeyName": @"",
@"AvailabilityZone": @"",
@"VirtualizationType": @"",
@"SubnetId": @"",
@"Architecture": @"",
@"RootDeviceType": @"",
@"BlockDeviceMappings": @"",
@"InstallUpdatesOnBoot": @"",
@"EbsOptimized": @"",
@"AgentVersion": @"",
@"Tenancy": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateInstance"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateInstance" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"StackId\": \"\",\n \"LayerIds\": \"\",\n \"InstanceType\": \"\",\n \"AutoScalingType\": \"\",\n \"Hostname\": \"\",\n \"Os\": \"\",\n \"AmiId\": \"\",\n \"SshKeyName\": \"\",\n \"AvailabilityZone\": \"\",\n \"VirtualizationType\": \"\",\n \"SubnetId\": \"\",\n \"Architecture\": \"\",\n \"RootDeviceType\": \"\",\n \"BlockDeviceMappings\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"EbsOptimized\": \"\",\n \"AgentVersion\": \"\",\n \"Tenancy\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateInstance",
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([
'StackId' => '',
'LayerIds' => '',
'InstanceType' => '',
'AutoScalingType' => '',
'Hostname' => '',
'Os' => '',
'AmiId' => '',
'SshKeyName' => '',
'AvailabilityZone' => '',
'VirtualizationType' => '',
'SubnetId' => '',
'Architecture' => '',
'RootDeviceType' => '',
'BlockDeviceMappings' => '',
'InstallUpdatesOnBoot' => '',
'EbsOptimized' => '',
'AgentVersion' => '',
'Tenancy' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateInstance', [
'body' => '{
"StackId": "",
"LayerIds": "",
"InstanceType": "",
"AutoScalingType": "",
"Hostname": "",
"Os": "",
"AmiId": "",
"SshKeyName": "",
"AvailabilityZone": "",
"VirtualizationType": "",
"SubnetId": "",
"Architecture": "",
"RootDeviceType": "",
"BlockDeviceMappings": "",
"InstallUpdatesOnBoot": "",
"EbsOptimized": "",
"AgentVersion": "",
"Tenancy": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateInstance');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'StackId' => '',
'LayerIds' => '',
'InstanceType' => '',
'AutoScalingType' => '',
'Hostname' => '',
'Os' => '',
'AmiId' => '',
'SshKeyName' => '',
'AvailabilityZone' => '',
'VirtualizationType' => '',
'SubnetId' => '',
'Architecture' => '',
'RootDeviceType' => '',
'BlockDeviceMappings' => '',
'InstallUpdatesOnBoot' => '',
'EbsOptimized' => '',
'AgentVersion' => '',
'Tenancy' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'StackId' => '',
'LayerIds' => '',
'InstanceType' => '',
'AutoScalingType' => '',
'Hostname' => '',
'Os' => '',
'AmiId' => '',
'SshKeyName' => '',
'AvailabilityZone' => '',
'VirtualizationType' => '',
'SubnetId' => '',
'Architecture' => '',
'RootDeviceType' => '',
'BlockDeviceMappings' => '',
'InstallUpdatesOnBoot' => '',
'EbsOptimized' => '',
'AgentVersion' => '',
'Tenancy' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateInstance');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateInstance' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": "",
"LayerIds": "",
"InstanceType": "",
"AutoScalingType": "",
"Hostname": "",
"Os": "",
"AmiId": "",
"SshKeyName": "",
"AvailabilityZone": "",
"VirtualizationType": "",
"SubnetId": "",
"Architecture": "",
"RootDeviceType": "",
"BlockDeviceMappings": "",
"InstallUpdatesOnBoot": "",
"EbsOptimized": "",
"AgentVersion": "",
"Tenancy": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateInstance' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": "",
"LayerIds": "",
"InstanceType": "",
"AutoScalingType": "",
"Hostname": "",
"Os": "",
"AmiId": "",
"SshKeyName": "",
"AvailabilityZone": "",
"VirtualizationType": "",
"SubnetId": "",
"Architecture": "",
"RootDeviceType": "",
"BlockDeviceMappings": "",
"InstallUpdatesOnBoot": "",
"EbsOptimized": "",
"AgentVersion": "",
"Tenancy": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"StackId\": \"\",\n \"LayerIds\": \"\",\n \"InstanceType\": \"\",\n \"AutoScalingType\": \"\",\n \"Hostname\": \"\",\n \"Os\": \"\",\n \"AmiId\": \"\",\n \"SshKeyName\": \"\",\n \"AvailabilityZone\": \"\",\n \"VirtualizationType\": \"\",\n \"SubnetId\": \"\",\n \"Architecture\": \"\",\n \"RootDeviceType\": \"\",\n \"BlockDeviceMappings\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"EbsOptimized\": \"\",\n \"AgentVersion\": \"\",\n \"Tenancy\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateInstance"
payload = {
"StackId": "",
"LayerIds": "",
"InstanceType": "",
"AutoScalingType": "",
"Hostname": "",
"Os": "",
"AmiId": "",
"SshKeyName": "",
"AvailabilityZone": "",
"VirtualizationType": "",
"SubnetId": "",
"Architecture": "",
"RootDeviceType": "",
"BlockDeviceMappings": "",
"InstallUpdatesOnBoot": "",
"EbsOptimized": "",
"AgentVersion": "",
"Tenancy": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateInstance"
payload <- "{\n \"StackId\": \"\",\n \"LayerIds\": \"\",\n \"InstanceType\": \"\",\n \"AutoScalingType\": \"\",\n \"Hostname\": \"\",\n \"Os\": \"\",\n \"AmiId\": \"\",\n \"SshKeyName\": \"\",\n \"AvailabilityZone\": \"\",\n \"VirtualizationType\": \"\",\n \"SubnetId\": \"\",\n \"Architecture\": \"\",\n \"RootDeviceType\": \"\",\n \"BlockDeviceMappings\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"EbsOptimized\": \"\",\n \"AgentVersion\": \"\",\n \"Tenancy\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateInstance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"StackId\": \"\",\n \"LayerIds\": \"\",\n \"InstanceType\": \"\",\n \"AutoScalingType\": \"\",\n \"Hostname\": \"\",\n \"Os\": \"\",\n \"AmiId\": \"\",\n \"SshKeyName\": \"\",\n \"AvailabilityZone\": \"\",\n \"VirtualizationType\": \"\",\n \"SubnetId\": \"\",\n \"Architecture\": \"\",\n \"RootDeviceType\": \"\",\n \"BlockDeviceMappings\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"EbsOptimized\": \"\",\n \"AgentVersion\": \"\",\n \"Tenancy\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"StackId\": \"\",\n \"LayerIds\": \"\",\n \"InstanceType\": \"\",\n \"AutoScalingType\": \"\",\n \"Hostname\": \"\",\n \"Os\": \"\",\n \"AmiId\": \"\",\n \"SshKeyName\": \"\",\n \"AvailabilityZone\": \"\",\n \"VirtualizationType\": \"\",\n \"SubnetId\": \"\",\n \"Architecture\": \"\",\n \"RootDeviceType\": \"\",\n \"BlockDeviceMappings\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"EbsOptimized\": \"\",\n \"AgentVersion\": \"\",\n \"Tenancy\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateInstance";
let payload = json!({
"StackId": "",
"LayerIds": "",
"InstanceType": "",
"AutoScalingType": "",
"Hostname": "",
"Os": "",
"AmiId": "",
"SshKeyName": "",
"AvailabilityZone": "",
"VirtualizationType": "",
"SubnetId": "",
"Architecture": "",
"RootDeviceType": "",
"BlockDeviceMappings": "",
"InstallUpdatesOnBoot": "",
"EbsOptimized": "",
"AgentVersion": "",
"Tenancy": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateInstance' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"StackId": "",
"LayerIds": "",
"InstanceType": "",
"AutoScalingType": "",
"Hostname": "",
"Os": "",
"AmiId": "",
"SshKeyName": "",
"AvailabilityZone": "",
"VirtualizationType": "",
"SubnetId": "",
"Architecture": "",
"RootDeviceType": "",
"BlockDeviceMappings": "",
"InstallUpdatesOnBoot": "",
"EbsOptimized": "",
"AgentVersion": "",
"Tenancy": ""
}'
echo '{
"StackId": "",
"LayerIds": "",
"InstanceType": "",
"AutoScalingType": "",
"Hostname": "",
"Os": "",
"AmiId": "",
"SshKeyName": "",
"AvailabilityZone": "",
"VirtualizationType": "",
"SubnetId": "",
"Architecture": "",
"RootDeviceType": "",
"BlockDeviceMappings": "",
"InstallUpdatesOnBoot": "",
"EbsOptimized": "",
"AgentVersion": "",
"Tenancy": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateInstance' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "StackId": "",\n "LayerIds": "",\n "InstanceType": "",\n "AutoScalingType": "",\n "Hostname": "",\n "Os": "",\n "AmiId": "",\n "SshKeyName": "",\n "AvailabilityZone": "",\n "VirtualizationType": "",\n "SubnetId": "",\n "Architecture": "",\n "RootDeviceType": "",\n "BlockDeviceMappings": "",\n "InstallUpdatesOnBoot": "",\n "EbsOptimized": "",\n "AgentVersion": "",\n "Tenancy": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateInstance'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"StackId": "",
"LayerIds": "",
"InstanceType": "",
"AutoScalingType": "",
"Hostname": "",
"Os": "",
"AmiId": "",
"SshKeyName": "",
"AvailabilityZone": "",
"VirtualizationType": "",
"SubnetId": "",
"Architecture": "",
"RootDeviceType": "",
"BlockDeviceMappings": "",
"InstallUpdatesOnBoot": "",
"EbsOptimized": "",
"AgentVersion": "",
"Tenancy": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateInstance")! 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
CreateLayer
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateLayer
HEADERS
X-Amz-Target
BODY json
{
"StackId": "",
"Type": "",
"Name": "",
"Shortname": "",
"Attributes": "",
"CloudWatchLogsConfiguration": "",
"CustomInstanceProfileArn": "",
"CustomJson": "",
"CustomSecurityGroupIds": "",
"Packages": "",
"VolumeConfigurations": "",
"EnableAutoHealing": "",
"AutoAssignElasticIps": "",
"AutoAssignPublicIps": "",
"CustomRecipes": "",
"InstallUpdatesOnBoot": "",
"UseEbsOptimizedInstances": "",
"LifecycleEventConfiguration": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateLayer");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"StackId\": \"\",\n \"Type\": \"\",\n \"Name\": \"\",\n \"Shortname\": \"\",\n \"Attributes\": \"\",\n \"CloudWatchLogsConfiguration\": \"\",\n \"CustomInstanceProfileArn\": \"\",\n \"CustomJson\": \"\",\n \"CustomSecurityGroupIds\": \"\",\n \"Packages\": \"\",\n \"VolumeConfigurations\": \"\",\n \"EnableAutoHealing\": \"\",\n \"AutoAssignElasticIps\": \"\",\n \"AutoAssignPublicIps\": \"\",\n \"CustomRecipes\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"UseEbsOptimizedInstances\": \"\",\n \"LifecycleEventConfiguration\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateLayer" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:StackId ""
:Type ""
:Name ""
:Shortname ""
:Attributes ""
:CloudWatchLogsConfiguration ""
:CustomInstanceProfileArn ""
:CustomJson ""
:CustomSecurityGroupIds ""
:Packages ""
:VolumeConfigurations ""
:EnableAutoHealing ""
:AutoAssignElasticIps ""
:AutoAssignPublicIps ""
:CustomRecipes ""
:InstallUpdatesOnBoot ""
:UseEbsOptimizedInstances ""
:LifecycleEventConfiguration ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateLayer"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"StackId\": \"\",\n \"Type\": \"\",\n \"Name\": \"\",\n \"Shortname\": \"\",\n \"Attributes\": \"\",\n \"CloudWatchLogsConfiguration\": \"\",\n \"CustomInstanceProfileArn\": \"\",\n \"CustomJson\": \"\",\n \"CustomSecurityGroupIds\": \"\",\n \"Packages\": \"\",\n \"VolumeConfigurations\": \"\",\n \"EnableAutoHealing\": \"\",\n \"AutoAssignElasticIps\": \"\",\n \"AutoAssignPublicIps\": \"\",\n \"CustomRecipes\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"UseEbsOptimizedInstances\": \"\",\n \"LifecycleEventConfiguration\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateLayer"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"StackId\": \"\",\n \"Type\": \"\",\n \"Name\": \"\",\n \"Shortname\": \"\",\n \"Attributes\": \"\",\n \"CloudWatchLogsConfiguration\": \"\",\n \"CustomInstanceProfileArn\": \"\",\n \"CustomJson\": \"\",\n \"CustomSecurityGroupIds\": \"\",\n \"Packages\": \"\",\n \"VolumeConfigurations\": \"\",\n \"EnableAutoHealing\": \"\",\n \"AutoAssignElasticIps\": \"\",\n \"AutoAssignPublicIps\": \"\",\n \"CustomRecipes\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"UseEbsOptimizedInstances\": \"\",\n \"LifecycleEventConfiguration\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateLayer");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"StackId\": \"\",\n \"Type\": \"\",\n \"Name\": \"\",\n \"Shortname\": \"\",\n \"Attributes\": \"\",\n \"CloudWatchLogsConfiguration\": \"\",\n \"CustomInstanceProfileArn\": \"\",\n \"CustomJson\": \"\",\n \"CustomSecurityGroupIds\": \"\",\n \"Packages\": \"\",\n \"VolumeConfigurations\": \"\",\n \"EnableAutoHealing\": \"\",\n \"AutoAssignElasticIps\": \"\",\n \"AutoAssignPublicIps\": \"\",\n \"CustomRecipes\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"UseEbsOptimizedInstances\": \"\",\n \"LifecycleEventConfiguration\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateLayer"
payload := strings.NewReader("{\n \"StackId\": \"\",\n \"Type\": \"\",\n \"Name\": \"\",\n \"Shortname\": \"\",\n \"Attributes\": \"\",\n \"CloudWatchLogsConfiguration\": \"\",\n \"CustomInstanceProfileArn\": \"\",\n \"CustomJson\": \"\",\n \"CustomSecurityGroupIds\": \"\",\n \"Packages\": \"\",\n \"VolumeConfigurations\": \"\",\n \"EnableAutoHealing\": \"\",\n \"AutoAssignElasticIps\": \"\",\n \"AutoAssignPublicIps\": \"\",\n \"CustomRecipes\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"UseEbsOptimizedInstances\": \"\",\n \"LifecycleEventConfiguration\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 467
{
"StackId": "",
"Type": "",
"Name": "",
"Shortname": "",
"Attributes": "",
"CloudWatchLogsConfiguration": "",
"CustomInstanceProfileArn": "",
"CustomJson": "",
"CustomSecurityGroupIds": "",
"Packages": "",
"VolumeConfigurations": "",
"EnableAutoHealing": "",
"AutoAssignElasticIps": "",
"AutoAssignPublicIps": "",
"CustomRecipes": "",
"InstallUpdatesOnBoot": "",
"UseEbsOptimizedInstances": "",
"LifecycleEventConfiguration": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateLayer")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"StackId\": \"\",\n \"Type\": \"\",\n \"Name\": \"\",\n \"Shortname\": \"\",\n \"Attributes\": \"\",\n \"CloudWatchLogsConfiguration\": \"\",\n \"CustomInstanceProfileArn\": \"\",\n \"CustomJson\": \"\",\n \"CustomSecurityGroupIds\": \"\",\n \"Packages\": \"\",\n \"VolumeConfigurations\": \"\",\n \"EnableAutoHealing\": \"\",\n \"AutoAssignElasticIps\": \"\",\n \"AutoAssignPublicIps\": \"\",\n \"CustomRecipes\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"UseEbsOptimizedInstances\": \"\",\n \"LifecycleEventConfiguration\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateLayer"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"StackId\": \"\",\n \"Type\": \"\",\n \"Name\": \"\",\n \"Shortname\": \"\",\n \"Attributes\": \"\",\n \"CloudWatchLogsConfiguration\": \"\",\n \"CustomInstanceProfileArn\": \"\",\n \"CustomJson\": \"\",\n \"CustomSecurityGroupIds\": \"\",\n \"Packages\": \"\",\n \"VolumeConfigurations\": \"\",\n \"EnableAutoHealing\": \"\",\n \"AutoAssignElasticIps\": \"\",\n \"AutoAssignPublicIps\": \"\",\n \"CustomRecipes\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"UseEbsOptimizedInstances\": \"\",\n \"LifecycleEventConfiguration\": \"\"\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 \"StackId\": \"\",\n \"Type\": \"\",\n \"Name\": \"\",\n \"Shortname\": \"\",\n \"Attributes\": \"\",\n \"CloudWatchLogsConfiguration\": \"\",\n \"CustomInstanceProfileArn\": \"\",\n \"CustomJson\": \"\",\n \"CustomSecurityGroupIds\": \"\",\n \"Packages\": \"\",\n \"VolumeConfigurations\": \"\",\n \"EnableAutoHealing\": \"\",\n \"AutoAssignElasticIps\": \"\",\n \"AutoAssignPublicIps\": \"\",\n \"CustomRecipes\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"UseEbsOptimizedInstances\": \"\",\n \"LifecycleEventConfiguration\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateLayer")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateLayer")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"StackId\": \"\",\n \"Type\": \"\",\n \"Name\": \"\",\n \"Shortname\": \"\",\n \"Attributes\": \"\",\n \"CloudWatchLogsConfiguration\": \"\",\n \"CustomInstanceProfileArn\": \"\",\n \"CustomJson\": \"\",\n \"CustomSecurityGroupIds\": \"\",\n \"Packages\": \"\",\n \"VolumeConfigurations\": \"\",\n \"EnableAutoHealing\": \"\",\n \"AutoAssignElasticIps\": \"\",\n \"AutoAssignPublicIps\": \"\",\n \"CustomRecipes\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"UseEbsOptimizedInstances\": \"\",\n \"LifecycleEventConfiguration\": \"\"\n}")
.asString();
const data = JSON.stringify({
StackId: '',
Type: '',
Name: '',
Shortname: '',
Attributes: '',
CloudWatchLogsConfiguration: '',
CustomInstanceProfileArn: '',
CustomJson: '',
CustomSecurityGroupIds: '',
Packages: '',
VolumeConfigurations: '',
EnableAutoHealing: '',
AutoAssignElasticIps: '',
AutoAssignPublicIps: '',
CustomRecipes: '',
InstallUpdatesOnBoot: '',
UseEbsOptimizedInstances: '',
LifecycleEventConfiguration: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateLayer');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateLayer',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
StackId: '',
Type: '',
Name: '',
Shortname: '',
Attributes: '',
CloudWatchLogsConfiguration: '',
CustomInstanceProfileArn: '',
CustomJson: '',
CustomSecurityGroupIds: '',
Packages: '',
VolumeConfigurations: '',
EnableAutoHealing: '',
AutoAssignElasticIps: '',
AutoAssignPublicIps: '',
CustomRecipes: '',
InstallUpdatesOnBoot: '',
UseEbsOptimizedInstances: '',
LifecycleEventConfiguration: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateLayer';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":"","Type":"","Name":"","Shortname":"","Attributes":"","CloudWatchLogsConfiguration":"","CustomInstanceProfileArn":"","CustomJson":"","CustomSecurityGroupIds":"","Packages":"","VolumeConfigurations":"","EnableAutoHealing":"","AutoAssignElasticIps":"","AutoAssignPublicIps":"","CustomRecipes":"","InstallUpdatesOnBoot":"","UseEbsOptimizedInstances":"","LifecycleEventConfiguration":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateLayer',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "StackId": "",\n "Type": "",\n "Name": "",\n "Shortname": "",\n "Attributes": "",\n "CloudWatchLogsConfiguration": "",\n "CustomInstanceProfileArn": "",\n "CustomJson": "",\n "CustomSecurityGroupIds": "",\n "Packages": "",\n "VolumeConfigurations": "",\n "EnableAutoHealing": "",\n "AutoAssignElasticIps": "",\n "AutoAssignPublicIps": "",\n "CustomRecipes": "",\n "InstallUpdatesOnBoot": "",\n "UseEbsOptimizedInstances": "",\n "LifecycleEventConfiguration": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"StackId\": \"\",\n \"Type\": \"\",\n \"Name\": \"\",\n \"Shortname\": \"\",\n \"Attributes\": \"\",\n \"CloudWatchLogsConfiguration\": \"\",\n \"CustomInstanceProfileArn\": \"\",\n \"CustomJson\": \"\",\n \"CustomSecurityGroupIds\": \"\",\n \"Packages\": \"\",\n \"VolumeConfigurations\": \"\",\n \"EnableAutoHealing\": \"\",\n \"AutoAssignElasticIps\": \"\",\n \"AutoAssignPublicIps\": \"\",\n \"CustomRecipes\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"UseEbsOptimizedInstances\": \"\",\n \"LifecycleEventConfiguration\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateLayer")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
StackId: '',
Type: '',
Name: '',
Shortname: '',
Attributes: '',
CloudWatchLogsConfiguration: '',
CustomInstanceProfileArn: '',
CustomJson: '',
CustomSecurityGroupIds: '',
Packages: '',
VolumeConfigurations: '',
EnableAutoHealing: '',
AutoAssignElasticIps: '',
AutoAssignPublicIps: '',
CustomRecipes: '',
InstallUpdatesOnBoot: '',
UseEbsOptimizedInstances: '',
LifecycleEventConfiguration: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateLayer',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
StackId: '',
Type: '',
Name: '',
Shortname: '',
Attributes: '',
CloudWatchLogsConfiguration: '',
CustomInstanceProfileArn: '',
CustomJson: '',
CustomSecurityGroupIds: '',
Packages: '',
VolumeConfigurations: '',
EnableAutoHealing: '',
AutoAssignElasticIps: '',
AutoAssignPublicIps: '',
CustomRecipes: '',
InstallUpdatesOnBoot: '',
UseEbsOptimizedInstances: '',
LifecycleEventConfiguration: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateLayer');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
StackId: '',
Type: '',
Name: '',
Shortname: '',
Attributes: '',
CloudWatchLogsConfiguration: '',
CustomInstanceProfileArn: '',
CustomJson: '',
CustomSecurityGroupIds: '',
Packages: '',
VolumeConfigurations: '',
EnableAutoHealing: '',
AutoAssignElasticIps: '',
AutoAssignPublicIps: '',
CustomRecipes: '',
InstallUpdatesOnBoot: '',
UseEbsOptimizedInstances: '',
LifecycleEventConfiguration: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateLayer',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
StackId: '',
Type: '',
Name: '',
Shortname: '',
Attributes: '',
CloudWatchLogsConfiguration: '',
CustomInstanceProfileArn: '',
CustomJson: '',
CustomSecurityGroupIds: '',
Packages: '',
VolumeConfigurations: '',
EnableAutoHealing: '',
AutoAssignElasticIps: '',
AutoAssignPublicIps: '',
CustomRecipes: '',
InstallUpdatesOnBoot: '',
UseEbsOptimizedInstances: '',
LifecycleEventConfiguration: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateLayer';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":"","Type":"","Name":"","Shortname":"","Attributes":"","CloudWatchLogsConfiguration":"","CustomInstanceProfileArn":"","CustomJson":"","CustomSecurityGroupIds":"","Packages":"","VolumeConfigurations":"","EnableAutoHealing":"","AutoAssignElasticIps":"","AutoAssignPublicIps":"","CustomRecipes":"","InstallUpdatesOnBoot":"","UseEbsOptimizedInstances":"","LifecycleEventConfiguration":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"StackId": @"",
@"Type": @"",
@"Name": @"",
@"Shortname": @"",
@"Attributes": @"",
@"CloudWatchLogsConfiguration": @"",
@"CustomInstanceProfileArn": @"",
@"CustomJson": @"",
@"CustomSecurityGroupIds": @"",
@"Packages": @"",
@"VolumeConfigurations": @"",
@"EnableAutoHealing": @"",
@"AutoAssignElasticIps": @"",
@"AutoAssignPublicIps": @"",
@"CustomRecipes": @"",
@"InstallUpdatesOnBoot": @"",
@"UseEbsOptimizedInstances": @"",
@"LifecycleEventConfiguration": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateLayer"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateLayer" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"StackId\": \"\",\n \"Type\": \"\",\n \"Name\": \"\",\n \"Shortname\": \"\",\n \"Attributes\": \"\",\n \"CloudWatchLogsConfiguration\": \"\",\n \"CustomInstanceProfileArn\": \"\",\n \"CustomJson\": \"\",\n \"CustomSecurityGroupIds\": \"\",\n \"Packages\": \"\",\n \"VolumeConfigurations\": \"\",\n \"EnableAutoHealing\": \"\",\n \"AutoAssignElasticIps\": \"\",\n \"AutoAssignPublicIps\": \"\",\n \"CustomRecipes\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"UseEbsOptimizedInstances\": \"\",\n \"LifecycleEventConfiguration\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateLayer",
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([
'StackId' => '',
'Type' => '',
'Name' => '',
'Shortname' => '',
'Attributes' => '',
'CloudWatchLogsConfiguration' => '',
'CustomInstanceProfileArn' => '',
'CustomJson' => '',
'CustomSecurityGroupIds' => '',
'Packages' => '',
'VolumeConfigurations' => '',
'EnableAutoHealing' => '',
'AutoAssignElasticIps' => '',
'AutoAssignPublicIps' => '',
'CustomRecipes' => '',
'InstallUpdatesOnBoot' => '',
'UseEbsOptimizedInstances' => '',
'LifecycleEventConfiguration' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateLayer', [
'body' => '{
"StackId": "",
"Type": "",
"Name": "",
"Shortname": "",
"Attributes": "",
"CloudWatchLogsConfiguration": "",
"CustomInstanceProfileArn": "",
"CustomJson": "",
"CustomSecurityGroupIds": "",
"Packages": "",
"VolumeConfigurations": "",
"EnableAutoHealing": "",
"AutoAssignElasticIps": "",
"AutoAssignPublicIps": "",
"CustomRecipes": "",
"InstallUpdatesOnBoot": "",
"UseEbsOptimizedInstances": "",
"LifecycleEventConfiguration": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateLayer');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'StackId' => '',
'Type' => '',
'Name' => '',
'Shortname' => '',
'Attributes' => '',
'CloudWatchLogsConfiguration' => '',
'CustomInstanceProfileArn' => '',
'CustomJson' => '',
'CustomSecurityGroupIds' => '',
'Packages' => '',
'VolumeConfigurations' => '',
'EnableAutoHealing' => '',
'AutoAssignElasticIps' => '',
'AutoAssignPublicIps' => '',
'CustomRecipes' => '',
'InstallUpdatesOnBoot' => '',
'UseEbsOptimizedInstances' => '',
'LifecycleEventConfiguration' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'StackId' => '',
'Type' => '',
'Name' => '',
'Shortname' => '',
'Attributes' => '',
'CloudWatchLogsConfiguration' => '',
'CustomInstanceProfileArn' => '',
'CustomJson' => '',
'CustomSecurityGroupIds' => '',
'Packages' => '',
'VolumeConfigurations' => '',
'EnableAutoHealing' => '',
'AutoAssignElasticIps' => '',
'AutoAssignPublicIps' => '',
'CustomRecipes' => '',
'InstallUpdatesOnBoot' => '',
'UseEbsOptimizedInstances' => '',
'LifecycleEventConfiguration' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateLayer');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateLayer' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": "",
"Type": "",
"Name": "",
"Shortname": "",
"Attributes": "",
"CloudWatchLogsConfiguration": "",
"CustomInstanceProfileArn": "",
"CustomJson": "",
"CustomSecurityGroupIds": "",
"Packages": "",
"VolumeConfigurations": "",
"EnableAutoHealing": "",
"AutoAssignElasticIps": "",
"AutoAssignPublicIps": "",
"CustomRecipes": "",
"InstallUpdatesOnBoot": "",
"UseEbsOptimizedInstances": "",
"LifecycleEventConfiguration": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateLayer' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": "",
"Type": "",
"Name": "",
"Shortname": "",
"Attributes": "",
"CloudWatchLogsConfiguration": "",
"CustomInstanceProfileArn": "",
"CustomJson": "",
"CustomSecurityGroupIds": "",
"Packages": "",
"VolumeConfigurations": "",
"EnableAutoHealing": "",
"AutoAssignElasticIps": "",
"AutoAssignPublicIps": "",
"CustomRecipes": "",
"InstallUpdatesOnBoot": "",
"UseEbsOptimizedInstances": "",
"LifecycleEventConfiguration": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"StackId\": \"\",\n \"Type\": \"\",\n \"Name\": \"\",\n \"Shortname\": \"\",\n \"Attributes\": \"\",\n \"CloudWatchLogsConfiguration\": \"\",\n \"CustomInstanceProfileArn\": \"\",\n \"CustomJson\": \"\",\n \"CustomSecurityGroupIds\": \"\",\n \"Packages\": \"\",\n \"VolumeConfigurations\": \"\",\n \"EnableAutoHealing\": \"\",\n \"AutoAssignElasticIps\": \"\",\n \"AutoAssignPublicIps\": \"\",\n \"CustomRecipes\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"UseEbsOptimizedInstances\": \"\",\n \"LifecycleEventConfiguration\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateLayer"
payload = {
"StackId": "",
"Type": "",
"Name": "",
"Shortname": "",
"Attributes": "",
"CloudWatchLogsConfiguration": "",
"CustomInstanceProfileArn": "",
"CustomJson": "",
"CustomSecurityGroupIds": "",
"Packages": "",
"VolumeConfigurations": "",
"EnableAutoHealing": "",
"AutoAssignElasticIps": "",
"AutoAssignPublicIps": "",
"CustomRecipes": "",
"InstallUpdatesOnBoot": "",
"UseEbsOptimizedInstances": "",
"LifecycleEventConfiguration": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateLayer"
payload <- "{\n \"StackId\": \"\",\n \"Type\": \"\",\n \"Name\": \"\",\n \"Shortname\": \"\",\n \"Attributes\": \"\",\n \"CloudWatchLogsConfiguration\": \"\",\n \"CustomInstanceProfileArn\": \"\",\n \"CustomJson\": \"\",\n \"CustomSecurityGroupIds\": \"\",\n \"Packages\": \"\",\n \"VolumeConfigurations\": \"\",\n \"EnableAutoHealing\": \"\",\n \"AutoAssignElasticIps\": \"\",\n \"AutoAssignPublicIps\": \"\",\n \"CustomRecipes\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"UseEbsOptimizedInstances\": \"\",\n \"LifecycleEventConfiguration\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateLayer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"StackId\": \"\",\n \"Type\": \"\",\n \"Name\": \"\",\n \"Shortname\": \"\",\n \"Attributes\": \"\",\n \"CloudWatchLogsConfiguration\": \"\",\n \"CustomInstanceProfileArn\": \"\",\n \"CustomJson\": \"\",\n \"CustomSecurityGroupIds\": \"\",\n \"Packages\": \"\",\n \"VolumeConfigurations\": \"\",\n \"EnableAutoHealing\": \"\",\n \"AutoAssignElasticIps\": \"\",\n \"AutoAssignPublicIps\": \"\",\n \"CustomRecipes\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"UseEbsOptimizedInstances\": \"\",\n \"LifecycleEventConfiguration\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"StackId\": \"\",\n \"Type\": \"\",\n \"Name\": \"\",\n \"Shortname\": \"\",\n \"Attributes\": \"\",\n \"CloudWatchLogsConfiguration\": \"\",\n \"CustomInstanceProfileArn\": \"\",\n \"CustomJson\": \"\",\n \"CustomSecurityGroupIds\": \"\",\n \"Packages\": \"\",\n \"VolumeConfigurations\": \"\",\n \"EnableAutoHealing\": \"\",\n \"AutoAssignElasticIps\": \"\",\n \"AutoAssignPublicIps\": \"\",\n \"CustomRecipes\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"UseEbsOptimizedInstances\": \"\",\n \"LifecycleEventConfiguration\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateLayer";
let payload = json!({
"StackId": "",
"Type": "",
"Name": "",
"Shortname": "",
"Attributes": "",
"CloudWatchLogsConfiguration": "",
"CustomInstanceProfileArn": "",
"CustomJson": "",
"CustomSecurityGroupIds": "",
"Packages": "",
"VolumeConfigurations": "",
"EnableAutoHealing": "",
"AutoAssignElasticIps": "",
"AutoAssignPublicIps": "",
"CustomRecipes": "",
"InstallUpdatesOnBoot": "",
"UseEbsOptimizedInstances": "",
"LifecycleEventConfiguration": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateLayer' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"StackId": "",
"Type": "",
"Name": "",
"Shortname": "",
"Attributes": "",
"CloudWatchLogsConfiguration": "",
"CustomInstanceProfileArn": "",
"CustomJson": "",
"CustomSecurityGroupIds": "",
"Packages": "",
"VolumeConfigurations": "",
"EnableAutoHealing": "",
"AutoAssignElasticIps": "",
"AutoAssignPublicIps": "",
"CustomRecipes": "",
"InstallUpdatesOnBoot": "",
"UseEbsOptimizedInstances": "",
"LifecycleEventConfiguration": ""
}'
echo '{
"StackId": "",
"Type": "",
"Name": "",
"Shortname": "",
"Attributes": "",
"CloudWatchLogsConfiguration": "",
"CustomInstanceProfileArn": "",
"CustomJson": "",
"CustomSecurityGroupIds": "",
"Packages": "",
"VolumeConfigurations": "",
"EnableAutoHealing": "",
"AutoAssignElasticIps": "",
"AutoAssignPublicIps": "",
"CustomRecipes": "",
"InstallUpdatesOnBoot": "",
"UseEbsOptimizedInstances": "",
"LifecycleEventConfiguration": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateLayer' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "StackId": "",\n "Type": "",\n "Name": "",\n "Shortname": "",\n "Attributes": "",\n "CloudWatchLogsConfiguration": "",\n "CustomInstanceProfileArn": "",\n "CustomJson": "",\n "CustomSecurityGroupIds": "",\n "Packages": "",\n "VolumeConfigurations": "",\n "EnableAutoHealing": "",\n "AutoAssignElasticIps": "",\n "AutoAssignPublicIps": "",\n "CustomRecipes": "",\n "InstallUpdatesOnBoot": "",\n "UseEbsOptimizedInstances": "",\n "LifecycleEventConfiguration": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateLayer'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"StackId": "",
"Type": "",
"Name": "",
"Shortname": "",
"Attributes": "",
"CloudWatchLogsConfiguration": "",
"CustomInstanceProfileArn": "",
"CustomJson": "",
"CustomSecurityGroupIds": "",
"Packages": "",
"VolumeConfigurations": "",
"EnableAutoHealing": "",
"AutoAssignElasticIps": "",
"AutoAssignPublicIps": "",
"CustomRecipes": "",
"InstallUpdatesOnBoot": "",
"UseEbsOptimizedInstances": "",
"LifecycleEventConfiguration": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateLayer")! 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
CreateStack
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateStack
HEADERS
X-Amz-Target
BODY json
{
"Name": "",
"Region": "",
"VpcId": "",
"Attributes": "",
"ServiceRoleArn": "",
"DefaultInstanceProfileArn": "",
"DefaultOs": "",
"HostnameTheme": "",
"DefaultAvailabilityZone": "",
"DefaultSubnetId": "",
"CustomJson": "",
"ConfigurationManager": "",
"ChefConfiguration": "",
"UseCustomCookbooks": "",
"UseOpsworksSecurityGroups": "",
"CustomCookbooksSource": "",
"DefaultSshKeyName": "",
"DefaultRootDeviceType": "",
"AgentVersion": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateStack");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"Name\": \"\",\n \"Region\": \"\",\n \"VpcId\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"AgentVersion\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateStack" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Name ""
:Region ""
:VpcId ""
:Attributes ""
:ServiceRoleArn ""
:DefaultInstanceProfileArn ""
:DefaultOs ""
:HostnameTheme ""
:DefaultAvailabilityZone ""
:DefaultSubnetId ""
:CustomJson ""
:ConfigurationManager ""
:ChefConfiguration ""
:UseCustomCookbooks ""
:UseOpsworksSecurityGroups ""
:CustomCookbooksSource ""
:DefaultSshKeyName ""
:DefaultRootDeviceType ""
:AgentVersion ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateStack"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Name\": \"\",\n \"Region\": \"\",\n \"VpcId\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"AgentVersion\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateStack"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Name\": \"\",\n \"Region\": \"\",\n \"VpcId\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"AgentVersion\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateStack");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Name\": \"\",\n \"Region\": \"\",\n \"VpcId\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"AgentVersion\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateStack"
payload := strings.NewReader("{\n \"Name\": \"\",\n \"Region\": \"\",\n \"VpcId\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"AgentVersion\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 477
{
"Name": "",
"Region": "",
"VpcId": "",
"Attributes": "",
"ServiceRoleArn": "",
"DefaultInstanceProfileArn": "",
"DefaultOs": "",
"HostnameTheme": "",
"DefaultAvailabilityZone": "",
"DefaultSubnetId": "",
"CustomJson": "",
"ConfigurationManager": "",
"ChefConfiguration": "",
"UseCustomCookbooks": "",
"UseOpsworksSecurityGroups": "",
"CustomCookbooksSource": "",
"DefaultSshKeyName": "",
"DefaultRootDeviceType": "",
"AgentVersion": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateStack")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Name\": \"\",\n \"Region\": \"\",\n \"VpcId\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"AgentVersion\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateStack"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Name\": \"\",\n \"Region\": \"\",\n \"VpcId\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"AgentVersion\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"Name\": \"\",\n \"Region\": \"\",\n \"VpcId\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"AgentVersion\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateStack")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateStack")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Name\": \"\",\n \"Region\": \"\",\n \"VpcId\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"AgentVersion\": \"\"\n}")
.asString();
const data = JSON.stringify({
Name: '',
Region: '',
VpcId: '',
Attributes: '',
ServiceRoleArn: '',
DefaultInstanceProfileArn: '',
DefaultOs: '',
HostnameTheme: '',
DefaultAvailabilityZone: '',
DefaultSubnetId: '',
CustomJson: '',
ConfigurationManager: '',
ChefConfiguration: '',
UseCustomCookbooks: '',
UseOpsworksSecurityGroups: '',
CustomCookbooksSource: '',
DefaultSshKeyName: '',
DefaultRootDeviceType: '',
AgentVersion: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateStack');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateStack',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Name: '',
Region: '',
VpcId: '',
Attributes: '',
ServiceRoleArn: '',
DefaultInstanceProfileArn: '',
DefaultOs: '',
HostnameTheme: '',
DefaultAvailabilityZone: '',
DefaultSubnetId: '',
CustomJson: '',
ConfigurationManager: '',
ChefConfiguration: '',
UseCustomCookbooks: '',
UseOpsworksSecurityGroups: '',
CustomCookbooksSource: '',
DefaultSshKeyName: '',
DefaultRootDeviceType: '',
AgentVersion: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateStack';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","Region":"","VpcId":"","Attributes":"","ServiceRoleArn":"","DefaultInstanceProfileArn":"","DefaultOs":"","HostnameTheme":"","DefaultAvailabilityZone":"","DefaultSubnetId":"","CustomJson":"","ConfigurationManager":"","ChefConfiguration":"","UseCustomCookbooks":"","UseOpsworksSecurityGroups":"","CustomCookbooksSource":"","DefaultSshKeyName":"","DefaultRootDeviceType":"","AgentVersion":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateStack',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Name": "",\n "Region": "",\n "VpcId": "",\n "Attributes": "",\n "ServiceRoleArn": "",\n "DefaultInstanceProfileArn": "",\n "DefaultOs": "",\n "HostnameTheme": "",\n "DefaultAvailabilityZone": "",\n "DefaultSubnetId": "",\n "CustomJson": "",\n "ConfigurationManager": "",\n "ChefConfiguration": "",\n "UseCustomCookbooks": "",\n "UseOpsworksSecurityGroups": "",\n "CustomCookbooksSource": "",\n "DefaultSshKeyName": "",\n "DefaultRootDeviceType": "",\n "AgentVersion": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Name\": \"\",\n \"Region\": \"\",\n \"VpcId\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"AgentVersion\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateStack")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
Name: '',
Region: '',
VpcId: '',
Attributes: '',
ServiceRoleArn: '',
DefaultInstanceProfileArn: '',
DefaultOs: '',
HostnameTheme: '',
DefaultAvailabilityZone: '',
DefaultSubnetId: '',
CustomJson: '',
ConfigurationManager: '',
ChefConfiguration: '',
UseCustomCookbooks: '',
UseOpsworksSecurityGroups: '',
CustomCookbooksSource: '',
DefaultSshKeyName: '',
DefaultRootDeviceType: '',
AgentVersion: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateStack',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
Name: '',
Region: '',
VpcId: '',
Attributes: '',
ServiceRoleArn: '',
DefaultInstanceProfileArn: '',
DefaultOs: '',
HostnameTheme: '',
DefaultAvailabilityZone: '',
DefaultSubnetId: '',
CustomJson: '',
ConfigurationManager: '',
ChefConfiguration: '',
UseCustomCookbooks: '',
UseOpsworksSecurityGroups: '',
CustomCookbooksSource: '',
DefaultSshKeyName: '',
DefaultRootDeviceType: '',
AgentVersion: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateStack');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Name: '',
Region: '',
VpcId: '',
Attributes: '',
ServiceRoleArn: '',
DefaultInstanceProfileArn: '',
DefaultOs: '',
HostnameTheme: '',
DefaultAvailabilityZone: '',
DefaultSubnetId: '',
CustomJson: '',
ConfigurationManager: '',
ChefConfiguration: '',
UseCustomCookbooks: '',
UseOpsworksSecurityGroups: '',
CustomCookbooksSource: '',
DefaultSshKeyName: '',
DefaultRootDeviceType: '',
AgentVersion: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateStack',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Name: '',
Region: '',
VpcId: '',
Attributes: '',
ServiceRoleArn: '',
DefaultInstanceProfileArn: '',
DefaultOs: '',
HostnameTheme: '',
DefaultAvailabilityZone: '',
DefaultSubnetId: '',
CustomJson: '',
ConfigurationManager: '',
ChefConfiguration: '',
UseCustomCookbooks: '',
UseOpsworksSecurityGroups: '',
CustomCookbooksSource: '',
DefaultSshKeyName: '',
DefaultRootDeviceType: '',
AgentVersion: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateStack';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","Region":"","VpcId":"","Attributes":"","ServiceRoleArn":"","DefaultInstanceProfileArn":"","DefaultOs":"","HostnameTheme":"","DefaultAvailabilityZone":"","DefaultSubnetId":"","CustomJson":"","ConfigurationManager":"","ChefConfiguration":"","UseCustomCookbooks":"","UseOpsworksSecurityGroups":"","CustomCookbooksSource":"","DefaultSshKeyName":"","DefaultRootDeviceType":"","AgentVersion":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"Name": @"",
@"Region": @"",
@"VpcId": @"",
@"Attributes": @"",
@"ServiceRoleArn": @"",
@"DefaultInstanceProfileArn": @"",
@"DefaultOs": @"",
@"HostnameTheme": @"",
@"DefaultAvailabilityZone": @"",
@"DefaultSubnetId": @"",
@"CustomJson": @"",
@"ConfigurationManager": @"",
@"ChefConfiguration": @"",
@"UseCustomCookbooks": @"",
@"UseOpsworksSecurityGroups": @"",
@"CustomCookbooksSource": @"",
@"DefaultSshKeyName": @"",
@"DefaultRootDeviceType": @"",
@"AgentVersion": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateStack"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateStack" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Name\": \"\",\n \"Region\": \"\",\n \"VpcId\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"AgentVersion\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateStack",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'Name' => '',
'Region' => '',
'VpcId' => '',
'Attributes' => '',
'ServiceRoleArn' => '',
'DefaultInstanceProfileArn' => '',
'DefaultOs' => '',
'HostnameTheme' => '',
'DefaultAvailabilityZone' => '',
'DefaultSubnetId' => '',
'CustomJson' => '',
'ConfigurationManager' => '',
'ChefConfiguration' => '',
'UseCustomCookbooks' => '',
'UseOpsworksSecurityGroups' => '',
'CustomCookbooksSource' => '',
'DefaultSshKeyName' => '',
'DefaultRootDeviceType' => '',
'AgentVersion' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateStack', [
'body' => '{
"Name": "",
"Region": "",
"VpcId": "",
"Attributes": "",
"ServiceRoleArn": "",
"DefaultInstanceProfileArn": "",
"DefaultOs": "",
"HostnameTheme": "",
"DefaultAvailabilityZone": "",
"DefaultSubnetId": "",
"CustomJson": "",
"ConfigurationManager": "",
"ChefConfiguration": "",
"UseCustomCookbooks": "",
"UseOpsworksSecurityGroups": "",
"CustomCookbooksSource": "",
"DefaultSshKeyName": "",
"DefaultRootDeviceType": "",
"AgentVersion": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateStack');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Name' => '',
'Region' => '',
'VpcId' => '',
'Attributes' => '',
'ServiceRoleArn' => '',
'DefaultInstanceProfileArn' => '',
'DefaultOs' => '',
'HostnameTheme' => '',
'DefaultAvailabilityZone' => '',
'DefaultSubnetId' => '',
'CustomJson' => '',
'ConfigurationManager' => '',
'ChefConfiguration' => '',
'UseCustomCookbooks' => '',
'UseOpsworksSecurityGroups' => '',
'CustomCookbooksSource' => '',
'DefaultSshKeyName' => '',
'DefaultRootDeviceType' => '',
'AgentVersion' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Name' => '',
'Region' => '',
'VpcId' => '',
'Attributes' => '',
'ServiceRoleArn' => '',
'DefaultInstanceProfileArn' => '',
'DefaultOs' => '',
'HostnameTheme' => '',
'DefaultAvailabilityZone' => '',
'DefaultSubnetId' => '',
'CustomJson' => '',
'ConfigurationManager' => '',
'ChefConfiguration' => '',
'UseCustomCookbooks' => '',
'UseOpsworksSecurityGroups' => '',
'CustomCookbooksSource' => '',
'DefaultSshKeyName' => '',
'DefaultRootDeviceType' => '',
'AgentVersion' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateStack');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateStack' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"Region": "",
"VpcId": "",
"Attributes": "",
"ServiceRoleArn": "",
"DefaultInstanceProfileArn": "",
"DefaultOs": "",
"HostnameTheme": "",
"DefaultAvailabilityZone": "",
"DefaultSubnetId": "",
"CustomJson": "",
"ConfigurationManager": "",
"ChefConfiguration": "",
"UseCustomCookbooks": "",
"UseOpsworksSecurityGroups": "",
"CustomCookbooksSource": "",
"DefaultSshKeyName": "",
"DefaultRootDeviceType": "",
"AgentVersion": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateStack' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"Region": "",
"VpcId": "",
"Attributes": "",
"ServiceRoleArn": "",
"DefaultInstanceProfileArn": "",
"DefaultOs": "",
"HostnameTheme": "",
"DefaultAvailabilityZone": "",
"DefaultSubnetId": "",
"CustomJson": "",
"ConfigurationManager": "",
"ChefConfiguration": "",
"UseCustomCookbooks": "",
"UseOpsworksSecurityGroups": "",
"CustomCookbooksSource": "",
"DefaultSshKeyName": "",
"DefaultRootDeviceType": "",
"AgentVersion": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Name\": \"\",\n \"Region\": \"\",\n \"VpcId\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"AgentVersion\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateStack"
payload = {
"Name": "",
"Region": "",
"VpcId": "",
"Attributes": "",
"ServiceRoleArn": "",
"DefaultInstanceProfileArn": "",
"DefaultOs": "",
"HostnameTheme": "",
"DefaultAvailabilityZone": "",
"DefaultSubnetId": "",
"CustomJson": "",
"ConfigurationManager": "",
"ChefConfiguration": "",
"UseCustomCookbooks": "",
"UseOpsworksSecurityGroups": "",
"CustomCookbooksSource": "",
"DefaultSshKeyName": "",
"DefaultRootDeviceType": "",
"AgentVersion": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateStack"
payload <- "{\n \"Name\": \"\",\n \"Region\": \"\",\n \"VpcId\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"AgentVersion\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateStack")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"Name\": \"\",\n \"Region\": \"\",\n \"VpcId\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"AgentVersion\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"Name\": \"\",\n \"Region\": \"\",\n \"VpcId\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"AgentVersion\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateStack";
let payload = json!({
"Name": "",
"Region": "",
"VpcId": "",
"Attributes": "",
"ServiceRoleArn": "",
"DefaultInstanceProfileArn": "",
"DefaultOs": "",
"HostnameTheme": "",
"DefaultAvailabilityZone": "",
"DefaultSubnetId": "",
"CustomJson": "",
"ConfigurationManager": "",
"ChefConfiguration": "",
"UseCustomCookbooks": "",
"UseOpsworksSecurityGroups": "",
"CustomCookbooksSource": "",
"DefaultSshKeyName": "",
"DefaultRootDeviceType": "",
"AgentVersion": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateStack' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Name": "",
"Region": "",
"VpcId": "",
"Attributes": "",
"ServiceRoleArn": "",
"DefaultInstanceProfileArn": "",
"DefaultOs": "",
"HostnameTheme": "",
"DefaultAvailabilityZone": "",
"DefaultSubnetId": "",
"CustomJson": "",
"ConfigurationManager": "",
"ChefConfiguration": "",
"UseCustomCookbooks": "",
"UseOpsworksSecurityGroups": "",
"CustomCookbooksSource": "",
"DefaultSshKeyName": "",
"DefaultRootDeviceType": "",
"AgentVersion": ""
}'
echo '{
"Name": "",
"Region": "",
"VpcId": "",
"Attributes": "",
"ServiceRoleArn": "",
"DefaultInstanceProfileArn": "",
"DefaultOs": "",
"HostnameTheme": "",
"DefaultAvailabilityZone": "",
"DefaultSubnetId": "",
"CustomJson": "",
"ConfigurationManager": "",
"ChefConfiguration": "",
"UseCustomCookbooks": "",
"UseOpsworksSecurityGroups": "",
"CustomCookbooksSource": "",
"DefaultSshKeyName": "",
"DefaultRootDeviceType": "",
"AgentVersion": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateStack' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Name": "",\n "Region": "",\n "VpcId": "",\n "Attributes": "",\n "ServiceRoleArn": "",\n "DefaultInstanceProfileArn": "",\n "DefaultOs": "",\n "HostnameTheme": "",\n "DefaultAvailabilityZone": "",\n "DefaultSubnetId": "",\n "CustomJson": "",\n "ConfigurationManager": "",\n "ChefConfiguration": "",\n "UseCustomCookbooks": "",\n "UseOpsworksSecurityGroups": "",\n "CustomCookbooksSource": "",\n "DefaultSshKeyName": "",\n "DefaultRootDeviceType": "",\n "AgentVersion": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateStack'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Name": "",
"Region": "",
"VpcId": "",
"Attributes": "",
"ServiceRoleArn": "",
"DefaultInstanceProfileArn": "",
"DefaultOs": "",
"HostnameTheme": "",
"DefaultAvailabilityZone": "",
"DefaultSubnetId": "",
"CustomJson": "",
"ConfigurationManager": "",
"ChefConfiguration": "",
"UseCustomCookbooks": "",
"UseOpsworksSecurityGroups": "",
"CustomCookbooksSource": "",
"DefaultSshKeyName": "",
"DefaultRootDeviceType": "",
"AgentVersion": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateStack")! 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
CreateUserProfile
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateUserProfile
HEADERS
X-Amz-Target
BODY json
{
"IamUserArn": "",
"SshUsername": "",
"SshPublicKey": "",
"AllowSelfManagement": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateUserProfile");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"IamUserArn\": \"\",\n \"SshUsername\": \"\",\n \"SshPublicKey\": \"\",\n \"AllowSelfManagement\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateUserProfile" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IamUserArn ""
:SshUsername ""
:SshPublicKey ""
:AllowSelfManagement ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateUserProfile"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IamUserArn\": \"\",\n \"SshUsername\": \"\",\n \"SshPublicKey\": \"\",\n \"AllowSelfManagement\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateUserProfile"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IamUserArn\": \"\",\n \"SshUsername\": \"\",\n \"SshPublicKey\": \"\",\n \"AllowSelfManagement\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateUserProfile");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IamUserArn\": \"\",\n \"SshUsername\": \"\",\n \"SshPublicKey\": \"\",\n \"AllowSelfManagement\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateUserProfile"
payload := strings.NewReader("{\n \"IamUserArn\": \"\",\n \"SshUsername\": \"\",\n \"SshPublicKey\": \"\",\n \"AllowSelfManagement\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 94
{
"IamUserArn": "",
"SshUsername": "",
"SshPublicKey": "",
"AllowSelfManagement": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateUserProfile")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IamUserArn\": \"\",\n \"SshUsername\": \"\",\n \"SshPublicKey\": \"\",\n \"AllowSelfManagement\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateUserProfile"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IamUserArn\": \"\",\n \"SshUsername\": \"\",\n \"SshPublicKey\": \"\",\n \"AllowSelfManagement\": \"\"\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 \"IamUserArn\": \"\",\n \"SshUsername\": \"\",\n \"SshPublicKey\": \"\",\n \"AllowSelfManagement\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateUserProfile")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateUserProfile")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IamUserArn\": \"\",\n \"SshUsername\": \"\",\n \"SshPublicKey\": \"\",\n \"AllowSelfManagement\": \"\"\n}")
.asString();
const data = JSON.stringify({
IamUserArn: '',
SshUsername: '',
SshPublicKey: '',
AllowSelfManagement: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateUserProfile');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateUserProfile',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IamUserArn: '', SshUsername: '', SshPublicKey: '', AllowSelfManagement: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateUserProfile';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IamUserArn":"","SshUsername":"","SshPublicKey":"","AllowSelfManagement":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateUserProfile',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IamUserArn": "",\n "SshUsername": "",\n "SshPublicKey": "",\n "AllowSelfManagement": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"IamUserArn\": \"\",\n \"SshUsername\": \"\",\n \"SshPublicKey\": \"\",\n \"AllowSelfManagement\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateUserProfile")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({IamUserArn: '', SshUsername: '', SshPublicKey: '', AllowSelfManagement: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateUserProfile',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {IamUserArn: '', SshUsername: '', SshPublicKey: '', AllowSelfManagement: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateUserProfile');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IamUserArn: '',
SshUsername: '',
SshPublicKey: '',
AllowSelfManagement: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateUserProfile',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IamUserArn: '', SshUsername: '', SshPublicKey: '', AllowSelfManagement: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateUserProfile';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IamUserArn":"","SshUsername":"","SshPublicKey":"","AllowSelfManagement":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"IamUserArn": @"",
@"SshUsername": @"",
@"SshPublicKey": @"",
@"AllowSelfManagement": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateUserProfile"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateUserProfile" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IamUserArn\": \"\",\n \"SshUsername\": \"\",\n \"SshPublicKey\": \"\",\n \"AllowSelfManagement\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateUserProfile",
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([
'IamUserArn' => '',
'SshUsername' => '',
'SshPublicKey' => '',
'AllowSelfManagement' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateUserProfile', [
'body' => '{
"IamUserArn": "",
"SshUsername": "",
"SshPublicKey": "",
"AllowSelfManagement": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateUserProfile');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IamUserArn' => '',
'SshUsername' => '',
'SshPublicKey' => '',
'AllowSelfManagement' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IamUserArn' => '',
'SshUsername' => '',
'SshPublicKey' => '',
'AllowSelfManagement' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateUserProfile');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateUserProfile' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IamUserArn": "",
"SshUsername": "",
"SshPublicKey": "",
"AllowSelfManagement": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateUserProfile' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IamUserArn": "",
"SshUsername": "",
"SshPublicKey": "",
"AllowSelfManagement": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IamUserArn\": \"\",\n \"SshUsername\": \"\",\n \"SshPublicKey\": \"\",\n \"AllowSelfManagement\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateUserProfile"
payload = {
"IamUserArn": "",
"SshUsername": "",
"SshPublicKey": "",
"AllowSelfManagement": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateUserProfile"
payload <- "{\n \"IamUserArn\": \"\",\n \"SshUsername\": \"\",\n \"SshPublicKey\": \"\",\n \"AllowSelfManagement\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateUserProfile")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"IamUserArn\": \"\",\n \"SshUsername\": \"\",\n \"SshPublicKey\": \"\",\n \"AllowSelfManagement\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"IamUserArn\": \"\",\n \"SshUsername\": \"\",\n \"SshPublicKey\": \"\",\n \"AllowSelfManagement\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateUserProfile";
let payload = json!({
"IamUserArn": "",
"SshUsername": "",
"SshPublicKey": "",
"AllowSelfManagement": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateUserProfile' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IamUserArn": "",
"SshUsername": "",
"SshPublicKey": "",
"AllowSelfManagement": ""
}'
echo '{
"IamUserArn": "",
"SshUsername": "",
"SshPublicKey": "",
"AllowSelfManagement": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateUserProfile' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IamUserArn": "",\n "SshUsername": "",\n "SshPublicKey": "",\n "AllowSelfManagement": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateUserProfile'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"IamUserArn": "",
"SshUsername": "",
"SshPublicKey": "",
"AllowSelfManagement": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.CreateUserProfile")! 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
DeleteApp
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteApp
HEADERS
X-Amz-Target
BODY json
{
"AppId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteApp");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"AppId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteApp" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:AppId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteApp"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"AppId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteApp"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"AppId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteApp");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AppId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteApp"
payload := strings.NewReader("{\n \"AppId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 17
{
"AppId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteApp")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"AppId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteApp"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AppId\": \"\"\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 \"AppId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteApp")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteApp")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"AppId\": \"\"\n}")
.asString();
const data = JSON.stringify({
AppId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteApp');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteApp',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AppId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteApp';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AppId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteApp',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "AppId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AppId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteApp")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({AppId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteApp',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {AppId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteApp');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
AppId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteApp',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AppId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteApp';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AppId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"AppId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteApp"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteApp" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"AppId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteApp",
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([
'AppId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteApp', [
'body' => '{
"AppId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteApp');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AppId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AppId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteApp');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteApp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AppId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteApp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AppId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AppId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteApp"
payload = { "AppId": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteApp"
payload <- "{\n \"AppId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteApp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"AppId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"AppId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteApp";
let payload = json!({"AppId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteApp' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"AppId": ""
}'
echo '{
"AppId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteApp' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "AppId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteApp'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["AppId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteApp")! 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
DeleteInstance
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteInstance
HEADERS
X-Amz-Target
BODY json
{
"InstanceId": "",
"DeleteElasticIp": "",
"DeleteVolumes": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteInstance");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"InstanceId\": \"\",\n \"DeleteElasticIp\": \"\",\n \"DeleteVolumes\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteInstance" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:InstanceId ""
:DeleteElasticIp ""
:DeleteVolumes ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteInstance"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"InstanceId\": \"\",\n \"DeleteElasticIp\": \"\",\n \"DeleteVolumes\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteInstance"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"InstanceId\": \"\",\n \"DeleteElasticIp\": \"\",\n \"DeleteVolumes\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteInstance");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"InstanceId\": \"\",\n \"DeleteElasticIp\": \"\",\n \"DeleteVolumes\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteInstance"
payload := strings.NewReader("{\n \"InstanceId\": \"\",\n \"DeleteElasticIp\": \"\",\n \"DeleteVolumes\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 70
{
"InstanceId": "",
"DeleteElasticIp": "",
"DeleteVolumes": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteInstance")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"InstanceId\": \"\",\n \"DeleteElasticIp\": \"\",\n \"DeleteVolumes\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteInstance"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"InstanceId\": \"\",\n \"DeleteElasticIp\": \"\",\n \"DeleteVolumes\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"InstanceId\": \"\",\n \"DeleteElasticIp\": \"\",\n \"DeleteVolumes\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteInstance")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteInstance")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"InstanceId\": \"\",\n \"DeleteElasticIp\": \"\",\n \"DeleteVolumes\": \"\"\n}")
.asString();
const data = JSON.stringify({
InstanceId: '',
DeleteElasticIp: '',
DeleteVolumes: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteInstance');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: '', DeleteElasticIp: '', DeleteVolumes: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteInstance';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":"","DeleteElasticIp":"","DeleteVolumes":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteInstance',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "InstanceId": "",\n "DeleteElasticIp": "",\n "DeleteVolumes": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"InstanceId\": \"\",\n \"DeleteElasticIp\": \"\",\n \"DeleteVolumes\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteInstance")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({InstanceId: '', DeleteElasticIp: '', DeleteVolumes: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {InstanceId: '', DeleteElasticIp: '', DeleteVolumes: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteInstance');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
InstanceId: '',
DeleteElasticIp: '',
DeleteVolumes: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: '', DeleteElasticIp: '', DeleteVolumes: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteInstance';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":"","DeleteElasticIp":"","DeleteVolumes":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"InstanceId": @"",
@"DeleteElasticIp": @"",
@"DeleteVolumes": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteInstance"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteInstance" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"InstanceId\": \"\",\n \"DeleteElasticIp\": \"\",\n \"DeleteVolumes\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteInstance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'InstanceId' => '',
'DeleteElasticIp' => '',
'DeleteVolumes' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteInstance', [
'body' => '{
"InstanceId": "",
"DeleteElasticIp": "",
"DeleteVolumes": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteInstance');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'InstanceId' => '',
'DeleteElasticIp' => '',
'DeleteVolumes' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'InstanceId' => '',
'DeleteElasticIp' => '',
'DeleteVolumes' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteInstance');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteInstance' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": "",
"DeleteElasticIp": "",
"DeleteVolumes": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteInstance' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": "",
"DeleteElasticIp": "",
"DeleteVolumes": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"InstanceId\": \"\",\n \"DeleteElasticIp\": \"\",\n \"DeleteVolumes\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteInstance"
payload = {
"InstanceId": "",
"DeleteElasticIp": "",
"DeleteVolumes": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteInstance"
payload <- "{\n \"InstanceId\": \"\",\n \"DeleteElasticIp\": \"\",\n \"DeleteVolumes\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteInstance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"InstanceId\": \"\",\n \"DeleteElasticIp\": \"\",\n \"DeleteVolumes\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"InstanceId\": \"\",\n \"DeleteElasticIp\": \"\",\n \"DeleteVolumes\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteInstance";
let payload = json!({
"InstanceId": "",
"DeleteElasticIp": "",
"DeleteVolumes": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteInstance' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"InstanceId": "",
"DeleteElasticIp": "",
"DeleteVolumes": ""
}'
echo '{
"InstanceId": "",
"DeleteElasticIp": "",
"DeleteVolumes": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteInstance' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "InstanceId": "",\n "DeleteElasticIp": "",\n "DeleteVolumes": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteInstance'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"InstanceId": "",
"DeleteElasticIp": "",
"DeleteVolumes": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteInstance")! 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
DeleteLayer
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteLayer
HEADERS
X-Amz-Target
BODY json
{
"LayerId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteLayer");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"LayerId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteLayer" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:LayerId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteLayer"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"LayerId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteLayer"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"LayerId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteLayer");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"LayerId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteLayer"
payload := strings.NewReader("{\n \"LayerId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 19
{
"LayerId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteLayer")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"LayerId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteLayer"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"LayerId\": \"\"\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 \"LayerId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteLayer")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteLayer")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"LayerId\": \"\"\n}")
.asString();
const data = JSON.stringify({
LayerId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteLayer');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteLayer',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {LayerId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteLayer';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"LayerId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteLayer',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "LayerId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"LayerId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteLayer")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({LayerId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteLayer',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {LayerId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteLayer');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
LayerId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteLayer',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {LayerId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteLayer';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"LayerId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"LayerId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteLayer"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteLayer" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"LayerId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteLayer",
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([
'LayerId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteLayer', [
'body' => '{
"LayerId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteLayer');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'LayerId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'LayerId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteLayer');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteLayer' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"LayerId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteLayer' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"LayerId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"LayerId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteLayer"
payload = { "LayerId": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteLayer"
payload <- "{\n \"LayerId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteLayer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"LayerId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"LayerId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteLayer";
let payload = json!({"LayerId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteLayer' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"LayerId": ""
}'
echo '{
"LayerId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteLayer' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "LayerId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteLayer'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["LayerId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteLayer")! 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
DeleteStack
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteStack
HEADERS
X-Amz-Target
BODY json
{
"StackId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteStack");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"StackId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteStack" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:StackId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteStack"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"StackId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteStack"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"StackId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteStack");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"StackId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteStack"
payload := strings.NewReader("{\n \"StackId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 19
{
"StackId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteStack")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"StackId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteStack"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"StackId\": \"\"\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 \"StackId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteStack")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteStack")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"StackId\": \"\"\n}")
.asString();
const data = JSON.stringify({
StackId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteStack');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteStack',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {StackId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteStack';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteStack',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "StackId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"StackId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteStack")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({StackId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteStack',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {StackId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteStack');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
StackId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteStack',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {StackId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteStack';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"StackId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteStack"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteStack" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"StackId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteStack",
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([
'StackId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteStack', [
'body' => '{
"StackId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteStack');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'StackId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'StackId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteStack');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteStack' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteStack' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"StackId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteStack"
payload = { "StackId": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteStack"
payload <- "{\n \"StackId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteStack")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"StackId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"StackId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteStack";
let payload = json!({"StackId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteStack' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"StackId": ""
}'
echo '{
"StackId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteStack' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "StackId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteStack'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["StackId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteStack")! 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
DeleteUserProfile
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteUserProfile
HEADERS
X-Amz-Target
BODY json
{
"IamUserArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteUserProfile");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"IamUserArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteUserProfile" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IamUserArn ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteUserProfile"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IamUserArn\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteUserProfile"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IamUserArn\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteUserProfile");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IamUserArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteUserProfile"
payload := strings.NewReader("{\n \"IamUserArn\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 22
{
"IamUserArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteUserProfile")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IamUserArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteUserProfile"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IamUserArn\": \"\"\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 \"IamUserArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteUserProfile")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteUserProfile")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IamUserArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
IamUserArn: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteUserProfile');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteUserProfile',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IamUserArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteUserProfile';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IamUserArn":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteUserProfile',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IamUserArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"IamUserArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteUserProfile")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({IamUserArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteUserProfile',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {IamUserArn: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteUserProfile');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IamUserArn: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteUserProfile',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IamUserArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteUserProfile';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IamUserArn":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"IamUserArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteUserProfile"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteUserProfile" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IamUserArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteUserProfile",
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([
'IamUserArn' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteUserProfile', [
'body' => '{
"IamUserArn": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteUserProfile');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IamUserArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IamUserArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteUserProfile');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteUserProfile' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IamUserArn": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteUserProfile' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IamUserArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IamUserArn\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteUserProfile"
payload = { "IamUserArn": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteUserProfile"
payload <- "{\n \"IamUserArn\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteUserProfile")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"IamUserArn\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"IamUserArn\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteUserProfile";
let payload = json!({"IamUserArn": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteUserProfile' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IamUserArn": ""
}'
echo '{
"IamUserArn": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteUserProfile' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IamUserArn": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteUserProfile'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["IamUserArn": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeleteUserProfile")! 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
DeregisterEcsCluster
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterEcsCluster
HEADERS
X-Amz-Target
BODY json
{
"EcsClusterArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterEcsCluster");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"EcsClusterArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterEcsCluster" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:EcsClusterArn ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterEcsCluster"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"EcsClusterArn\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterEcsCluster"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"EcsClusterArn\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterEcsCluster");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"EcsClusterArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterEcsCluster"
payload := strings.NewReader("{\n \"EcsClusterArn\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 25
{
"EcsClusterArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterEcsCluster")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"EcsClusterArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterEcsCluster"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"EcsClusterArn\": \"\"\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 \"EcsClusterArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterEcsCluster")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterEcsCluster")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"EcsClusterArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
EcsClusterArn: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterEcsCluster');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterEcsCluster',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {EcsClusterArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterEcsCluster';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"EcsClusterArn":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterEcsCluster',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "EcsClusterArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"EcsClusterArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterEcsCluster")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({EcsClusterArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterEcsCluster',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {EcsClusterArn: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterEcsCluster');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
EcsClusterArn: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterEcsCluster',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {EcsClusterArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterEcsCluster';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"EcsClusterArn":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"EcsClusterArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterEcsCluster"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterEcsCluster" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"EcsClusterArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterEcsCluster",
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([
'EcsClusterArn' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterEcsCluster', [
'body' => '{
"EcsClusterArn": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterEcsCluster');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'EcsClusterArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'EcsClusterArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterEcsCluster');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterEcsCluster' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EcsClusterArn": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterEcsCluster' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EcsClusterArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"EcsClusterArn\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterEcsCluster"
payload = { "EcsClusterArn": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterEcsCluster"
payload <- "{\n \"EcsClusterArn\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterEcsCluster")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"EcsClusterArn\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"EcsClusterArn\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterEcsCluster";
let payload = json!({"EcsClusterArn": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterEcsCluster' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"EcsClusterArn": ""
}'
echo '{
"EcsClusterArn": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterEcsCluster' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "EcsClusterArn": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterEcsCluster'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["EcsClusterArn": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterEcsCluster")! 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
DeregisterElasticIp
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterElasticIp
HEADERS
X-Amz-Target
BODY json
{
"ElasticIp": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterElasticIp");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"ElasticIp\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterElasticIp" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ElasticIp ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterElasticIp"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ElasticIp\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterElasticIp"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ElasticIp\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterElasticIp");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ElasticIp\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterElasticIp"
payload := strings.NewReader("{\n \"ElasticIp\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 21
{
"ElasticIp": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterElasticIp")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ElasticIp\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterElasticIp"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ElasticIp\": \"\"\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 \"ElasticIp\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterElasticIp")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterElasticIp")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ElasticIp\": \"\"\n}")
.asString();
const data = JSON.stringify({
ElasticIp: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterElasticIp');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterElasticIp',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ElasticIp: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterElasticIp';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ElasticIp":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterElasticIp',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ElasticIp": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ElasticIp\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterElasticIp")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({ElasticIp: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterElasticIp',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {ElasticIp: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterElasticIp');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ElasticIp: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterElasticIp',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ElasticIp: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterElasticIp';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ElasticIp":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"ElasticIp": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterElasticIp"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterElasticIp" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"ElasticIp\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterElasticIp",
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([
'ElasticIp' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterElasticIp', [
'body' => '{
"ElasticIp": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterElasticIp');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ElasticIp' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ElasticIp' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterElasticIp');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterElasticIp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ElasticIp": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterElasticIp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ElasticIp": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ElasticIp\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterElasticIp"
payload = { "ElasticIp": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterElasticIp"
payload <- "{\n \"ElasticIp\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterElasticIp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"ElasticIp\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"ElasticIp\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterElasticIp";
let payload = json!({"ElasticIp": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterElasticIp' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ElasticIp": ""
}'
echo '{
"ElasticIp": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterElasticIp' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ElasticIp": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterElasticIp'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["ElasticIp": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterElasticIp")! 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
DeregisterInstance
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterInstance
HEADERS
X-Amz-Target
BODY json
{
"InstanceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterInstance");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"InstanceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterInstance" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:InstanceId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterInstance"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"InstanceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterInstance"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"InstanceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterInstance");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"InstanceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterInstance"
payload := strings.NewReader("{\n \"InstanceId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 22
{
"InstanceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterInstance")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"InstanceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterInstance"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"InstanceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"InstanceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterInstance")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterInstance")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"InstanceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
InstanceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterInstance');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterInstance';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterInstance',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "InstanceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"InstanceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterInstance")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({InstanceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {InstanceId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterInstance');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
InstanceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterInstance';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"InstanceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterInstance"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterInstance" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"InstanceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterInstance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'InstanceId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterInstance', [
'body' => '{
"InstanceId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterInstance');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'InstanceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'InstanceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterInstance');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterInstance' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterInstance' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"InstanceId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterInstance"
payload = { "InstanceId": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterInstance"
payload <- "{\n \"InstanceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterInstance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"InstanceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"InstanceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterInstance";
let payload = json!({"InstanceId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterInstance' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"InstanceId": ""
}'
echo '{
"InstanceId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterInstance' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "InstanceId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterInstance'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["InstanceId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterInstance")! 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
DeregisterRdsDbInstance
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterRdsDbInstance
HEADERS
X-Amz-Target
BODY json
{
"RdsDbInstanceArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterRdsDbInstance");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"RdsDbInstanceArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterRdsDbInstance" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:RdsDbInstanceArn ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterRdsDbInstance"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"RdsDbInstanceArn\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterRdsDbInstance"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"RdsDbInstanceArn\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterRdsDbInstance");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"RdsDbInstanceArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterRdsDbInstance"
payload := strings.NewReader("{\n \"RdsDbInstanceArn\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 28
{
"RdsDbInstanceArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterRdsDbInstance")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"RdsDbInstanceArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterRdsDbInstance"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"RdsDbInstanceArn\": \"\"\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 \"RdsDbInstanceArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterRdsDbInstance")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterRdsDbInstance")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"RdsDbInstanceArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
RdsDbInstanceArn: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterRdsDbInstance');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterRdsDbInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {RdsDbInstanceArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterRdsDbInstance';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"RdsDbInstanceArn":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterRdsDbInstance',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "RdsDbInstanceArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"RdsDbInstanceArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterRdsDbInstance")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({RdsDbInstanceArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterRdsDbInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {RdsDbInstanceArn: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterRdsDbInstance');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
RdsDbInstanceArn: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterRdsDbInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {RdsDbInstanceArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterRdsDbInstance';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"RdsDbInstanceArn":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"RdsDbInstanceArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterRdsDbInstance"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterRdsDbInstance" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"RdsDbInstanceArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterRdsDbInstance",
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([
'RdsDbInstanceArn' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterRdsDbInstance', [
'body' => '{
"RdsDbInstanceArn": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterRdsDbInstance');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'RdsDbInstanceArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'RdsDbInstanceArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterRdsDbInstance');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterRdsDbInstance' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"RdsDbInstanceArn": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterRdsDbInstance' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"RdsDbInstanceArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"RdsDbInstanceArn\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterRdsDbInstance"
payload = { "RdsDbInstanceArn": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterRdsDbInstance"
payload <- "{\n \"RdsDbInstanceArn\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterRdsDbInstance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"RdsDbInstanceArn\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"RdsDbInstanceArn\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterRdsDbInstance";
let payload = json!({"RdsDbInstanceArn": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterRdsDbInstance' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"RdsDbInstanceArn": ""
}'
echo '{
"RdsDbInstanceArn": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterRdsDbInstance' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "RdsDbInstanceArn": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterRdsDbInstance'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["RdsDbInstanceArn": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterRdsDbInstance")! 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
DeregisterVolume
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterVolume
HEADERS
X-Amz-Target
BODY json
{
"VolumeId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterVolume");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"VolumeId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterVolume" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:VolumeId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterVolume"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"VolumeId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterVolume"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"VolumeId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterVolume");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"VolumeId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterVolume"
payload := strings.NewReader("{\n \"VolumeId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 20
{
"VolumeId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterVolume")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"VolumeId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterVolume"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"VolumeId\": \"\"\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 \"VolumeId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterVolume")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterVolume")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"VolumeId\": \"\"\n}")
.asString();
const data = JSON.stringify({
VolumeId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterVolume');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterVolume',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {VolumeId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterVolume';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"VolumeId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterVolume',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "VolumeId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"VolumeId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterVolume")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({VolumeId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterVolume',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {VolumeId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterVolume');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
VolumeId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterVolume',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {VolumeId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterVolume';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"VolumeId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"VolumeId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterVolume"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterVolume" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"VolumeId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterVolume",
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([
'VolumeId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterVolume', [
'body' => '{
"VolumeId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterVolume');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'VolumeId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'VolumeId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterVolume');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterVolume' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"VolumeId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterVolume' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"VolumeId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"VolumeId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterVolume"
payload = { "VolumeId": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterVolume"
payload <- "{\n \"VolumeId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterVolume")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"VolumeId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"VolumeId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterVolume";
let payload = json!({"VolumeId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterVolume' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"VolumeId": ""
}'
echo '{
"VolumeId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterVolume' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "VolumeId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterVolume'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["VolumeId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DeregisterVolume")! 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
DescribeAgentVersions
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeAgentVersions
HEADERS
X-Amz-Target
BODY json
{
"StackId": "",
"ConfigurationManager": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeAgentVersions");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"StackId\": \"\",\n \"ConfigurationManager\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeAgentVersions" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:StackId ""
:ConfigurationManager ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeAgentVersions"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"StackId\": \"\",\n \"ConfigurationManager\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeAgentVersions"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"StackId\": \"\",\n \"ConfigurationManager\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeAgentVersions");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"StackId\": \"\",\n \"ConfigurationManager\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeAgentVersions"
payload := strings.NewReader("{\n \"StackId\": \"\",\n \"ConfigurationManager\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 49
{
"StackId": "",
"ConfigurationManager": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeAgentVersions")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"StackId\": \"\",\n \"ConfigurationManager\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeAgentVersions"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"StackId\": \"\",\n \"ConfigurationManager\": \"\"\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 \"StackId\": \"\",\n \"ConfigurationManager\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeAgentVersions")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeAgentVersions")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"StackId\": \"\",\n \"ConfigurationManager\": \"\"\n}")
.asString();
const data = JSON.stringify({
StackId: '',
ConfigurationManager: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeAgentVersions');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeAgentVersions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {StackId: '', ConfigurationManager: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeAgentVersions';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":"","ConfigurationManager":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeAgentVersions',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "StackId": "",\n "ConfigurationManager": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"StackId\": \"\",\n \"ConfigurationManager\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeAgentVersions")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({StackId: '', ConfigurationManager: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeAgentVersions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {StackId: '', ConfigurationManager: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeAgentVersions');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
StackId: '',
ConfigurationManager: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeAgentVersions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {StackId: '', ConfigurationManager: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeAgentVersions';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":"","ConfigurationManager":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"StackId": @"",
@"ConfigurationManager": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeAgentVersions"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeAgentVersions" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"StackId\": \"\",\n \"ConfigurationManager\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeAgentVersions",
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([
'StackId' => '',
'ConfigurationManager' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeAgentVersions', [
'body' => '{
"StackId": "",
"ConfigurationManager": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeAgentVersions');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'StackId' => '',
'ConfigurationManager' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'StackId' => '',
'ConfigurationManager' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeAgentVersions');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeAgentVersions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": "",
"ConfigurationManager": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeAgentVersions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": "",
"ConfigurationManager": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"StackId\": \"\",\n \"ConfigurationManager\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeAgentVersions"
payload = {
"StackId": "",
"ConfigurationManager": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeAgentVersions"
payload <- "{\n \"StackId\": \"\",\n \"ConfigurationManager\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeAgentVersions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"StackId\": \"\",\n \"ConfigurationManager\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"StackId\": \"\",\n \"ConfigurationManager\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeAgentVersions";
let payload = json!({
"StackId": "",
"ConfigurationManager": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeAgentVersions' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"StackId": "",
"ConfigurationManager": ""
}'
echo '{
"StackId": "",
"ConfigurationManager": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeAgentVersions' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "StackId": "",\n "ConfigurationManager": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeAgentVersions'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"StackId": "",
"ConfigurationManager": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeAgentVersions")! 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
DescribeApps
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeApps
HEADERS
X-Amz-Target
BODY json
{
"StackId": "",
"AppIds": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeApps");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"StackId\": \"\",\n \"AppIds\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeApps" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:StackId ""
:AppIds ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeApps"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"StackId\": \"\",\n \"AppIds\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeApps"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"StackId\": \"\",\n \"AppIds\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeApps");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"StackId\": \"\",\n \"AppIds\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeApps"
payload := strings.NewReader("{\n \"StackId\": \"\",\n \"AppIds\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 35
{
"StackId": "",
"AppIds": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeApps")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"StackId\": \"\",\n \"AppIds\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeApps"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"StackId\": \"\",\n \"AppIds\": \"\"\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 \"StackId\": \"\",\n \"AppIds\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeApps")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeApps")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"StackId\": \"\",\n \"AppIds\": \"\"\n}")
.asString();
const data = JSON.stringify({
StackId: '',
AppIds: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeApps');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeApps',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {StackId: '', AppIds: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeApps';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":"","AppIds":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeApps',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "StackId": "",\n "AppIds": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"StackId\": \"\",\n \"AppIds\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeApps")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({StackId: '', AppIds: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeApps',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {StackId: '', AppIds: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeApps');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
StackId: '',
AppIds: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeApps',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {StackId: '', AppIds: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeApps';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":"","AppIds":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"StackId": @"",
@"AppIds": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeApps"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeApps" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"StackId\": \"\",\n \"AppIds\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeApps",
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([
'StackId' => '',
'AppIds' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeApps', [
'body' => '{
"StackId": "",
"AppIds": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeApps');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'StackId' => '',
'AppIds' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'StackId' => '',
'AppIds' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeApps');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeApps' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": "",
"AppIds": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeApps' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": "",
"AppIds": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"StackId\": \"\",\n \"AppIds\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeApps"
payload = {
"StackId": "",
"AppIds": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeApps"
payload <- "{\n \"StackId\": \"\",\n \"AppIds\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeApps")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"StackId\": \"\",\n \"AppIds\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"StackId\": \"\",\n \"AppIds\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeApps";
let payload = json!({
"StackId": "",
"AppIds": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeApps' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"StackId": "",
"AppIds": ""
}'
echo '{
"StackId": "",
"AppIds": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeApps' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "StackId": "",\n "AppIds": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeApps'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"StackId": "",
"AppIds": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeApps")! 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
DescribeCommands
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeCommands
HEADERS
X-Amz-Target
BODY json
{
"DeploymentId": "",
"InstanceId": "",
"CommandIds": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeCommands");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DeploymentId\": \"\",\n \"InstanceId\": \"\",\n \"CommandIds\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeCommands" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DeploymentId ""
:InstanceId ""
:CommandIds ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeCommands"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DeploymentId\": \"\",\n \"InstanceId\": \"\",\n \"CommandIds\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeCommands"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DeploymentId\": \"\",\n \"InstanceId\": \"\",\n \"CommandIds\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeCommands");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DeploymentId\": \"\",\n \"InstanceId\": \"\",\n \"CommandIds\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeCommands"
payload := strings.NewReader("{\n \"DeploymentId\": \"\",\n \"InstanceId\": \"\",\n \"CommandIds\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 64
{
"DeploymentId": "",
"InstanceId": "",
"CommandIds": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeCommands")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DeploymentId\": \"\",\n \"InstanceId\": \"\",\n \"CommandIds\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeCommands"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DeploymentId\": \"\",\n \"InstanceId\": \"\",\n \"CommandIds\": \"\"\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 \"DeploymentId\": \"\",\n \"InstanceId\": \"\",\n \"CommandIds\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeCommands")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeCommands")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DeploymentId\": \"\",\n \"InstanceId\": \"\",\n \"CommandIds\": \"\"\n}")
.asString();
const data = JSON.stringify({
DeploymentId: '',
InstanceId: '',
CommandIds: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeCommands');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeCommands',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DeploymentId: '', InstanceId: '', CommandIds: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeCommands';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DeploymentId":"","InstanceId":"","CommandIds":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeCommands',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DeploymentId": "",\n "InstanceId": "",\n "CommandIds": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DeploymentId\": \"\",\n \"InstanceId\": \"\",\n \"CommandIds\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeCommands")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DeploymentId: '', InstanceId: '', CommandIds: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeCommands',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DeploymentId: '', InstanceId: '', CommandIds: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeCommands');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DeploymentId: '',
InstanceId: '',
CommandIds: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeCommands',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DeploymentId: '', InstanceId: '', CommandIds: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeCommands';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DeploymentId":"","InstanceId":"","CommandIds":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DeploymentId": @"",
@"InstanceId": @"",
@"CommandIds": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeCommands"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeCommands" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DeploymentId\": \"\",\n \"InstanceId\": \"\",\n \"CommandIds\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeCommands",
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([
'DeploymentId' => '',
'InstanceId' => '',
'CommandIds' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeCommands', [
'body' => '{
"DeploymentId": "",
"InstanceId": "",
"CommandIds": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeCommands');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DeploymentId' => '',
'InstanceId' => '',
'CommandIds' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DeploymentId' => '',
'InstanceId' => '',
'CommandIds' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeCommands');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeCommands' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DeploymentId": "",
"InstanceId": "",
"CommandIds": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeCommands' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DeploymentId": "",
"InstanceId": "",
"CommandIds": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DeploymentId\": \"\",\n \"InstanceId\": \"\",\n \"CommandIds\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeCommands"
payload = {
"DeploymentId": "",
"InstanceId": "",
"CommandIds": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeCommands"
payload <- "{\n \"DeploymentId\": \"\",\n \"InstanceId\": \"\",\n \"CommandIds\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeCommands")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DeploymentId\": \"\",\n \"InstanceId\": \"\",\n \"CommandIds\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DeploymentId\": \"\",\n \"InstanceId\": \"\",\n \"CommandIds\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeCommands";
let payload = json!({
"DeploymentId": "",
"InstanceId": "",
"CommandIds": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeCommands' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DeploymentId": "",
"InstanceId": "",
"CommandIds": ""
}'
echo '{
"DeploymentId": "",
"InstanceId": "",
"CommandIds": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeCommands' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DeploymentId": "",\n "InstanceId": "",\n "CommandIds": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeCommands'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DeploymentId": "",
"InstanceId": "",
"CommandIds": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeCommands")! 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
DescribeDeployments
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeDeployments
HEADERS
X-Amz-Target
BODY json
{
"StackId": "",
"AppId": "",
"DeploymentIds": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeDeployments");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"StackId\": \"\",\n \"AppId\": \"\",\n \"DeploymentIds\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeDeployments" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:StackId ""
:AppId ""
:DeploymentIds ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeDeployments"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"StackId\": \"\",\n \"AppId\": \"\",\n \"DeploymentIds\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeDeployments"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"StackId\": \"\",\n \"AppId\": \"\",\n \"DeploymentIds\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeDeployments");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"StackId\": \"\",\n \"AppId\": \"\",\n \"DeploymentIds\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeDeployments"
payload := strings.NewReader("{\n \"StackId\": \"\",\n \"AppId\": \"\",\n \"DeploymentIds\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 57
{
"StackId": "",
"AppId": "",
"DeploymentIds": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeDeployments")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"StackId\": \"\",\n \"AppId\": \"\",\n \"DeploymentIds\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeDeployments"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"StackId\": \"\",\n \"AppId\": \"\",\n \"DeploymentIds\": \"\"\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 \"StackId\": \"\",\n \"AppId\": \"\",\n \"DeploymentIds\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeDeployments")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeDeployments")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"StackId\": \"\",\n \"AppId\": \"\",\n \"DeploymentIds\": \"\"\n}")
.asString();
const data = JSON.stringify({
StackId: '',
AppId: '',
DeploymentIds: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeDeployments');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeDeployments',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {StackId: '', AppId: '', DeploymentIds: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeDeployments';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":"","AppId":"","DeploymentIds":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeDeployments',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "StackId": "",\n "AppId": "",\n "DeploymentIds": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"StackId\": \"\",\n \"AppId\": \"\",\n \"DeploymentIds\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeDeployments")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({StackId: '', AppId: '', DeploymentIds: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeDeployments',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {StackId: '', AppId: '', DeploymentIds: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeDeployments');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
StackId: '',
AppId: '',
DeploymentIds: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeDeployments',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {StackId: '', AppId: '', DeploymentIds: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeDeployments';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":"","AppId":"","DeploymentIds":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"StackId": @"",
@"AppId": @"",
@"DeploymentIds": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeDeployments"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeDeployments" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"StackId\": \"\",\n \"AppId\": \"\",\n \"DeploymentIds\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeDeployments",
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([
'StackId' => '',
'AppId' => '',
'DeploymentIds' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeDeployments', [
'body' => '{
"StackId": "",
"AppId": "",
"DeploymentIds": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeDeployments');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'StackId' => '',
'AppId' => '',
'DeploymentIds' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'StackId' => '',
'AppId' => '',
'DeploymentIds' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeDeployments');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeDeployments' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": "",
"AppId": "",
"DeploymentIds": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeDeployments' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": "",
"AppId": "",
"DeploymentIds": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"StackId\": \"\",\n \"AppId\": \"\",\n \"DeploymentIds\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeDeployments"
payload = {
"StackId": "",
"AppId": "",
"DeploymentIds": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeDeployments"
payload <- "{\n \"StackId\": \"\",\n \"AppId\": \"\",\n \"DeploymentIds\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeDeployments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"StackId\": \"\",\n \"AppId\": \"\",\n \"DeploymentIds\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"StackId\": \"\",\n \"AppId\": \"\",\n \"DeploymentIds\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeDeployments";
let payload = json!({
"StackId": "",
"AppId": "",
"DeploymentIds": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeDeployments' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"StackId": "",
"AppId": "",
"DeploymentIds": ""
}'
echo '{
"StackId": "",
"AppId": "",
"DeploymentIds": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeDeployments' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "StackId": "",\n "AppId": "",\n "DeploymentIds": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeDeployments'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"StackId": "",
"AppId": "",
"DeploymentIds": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeDeployments")! 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
DescribeEcsClusters
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeEcsClusters
HEADERS
X-Amz-Target
BODY json
{
"EcsClusterArns": "",
"StackId": "",
"NextToken": "",
"MaxResults": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeEcsClusters");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"EcsClusterArns\": \"\",\n \"StackId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeEcsClusters" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:EcsClusterArns ""
:StackId ""
:NextToken ""
:MaxResults ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeEcsClusters"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"EcsClusterArns\": \"\",\n \"StackId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeEcsClusters"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"EcsClusterArns\": \"\",\n \"StackId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeEcsClusters");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"EcsClusterArns\": \"\",\n \"StackId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeEcsClusters"
payload := strings.NewReader("{\n \"EcsClusterArns\": \"\",\n \"StackId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 82
{
"EcsClusterArns": "",
"StackId": "",
"NextToken": "",
"MaxResults": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeEcsClusters")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"EcsClusterArns\": \"\",\n \"StackId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeEcsClusters"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"EcsClusterArns\": \"\",\n \"StackId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"EcsClusterArns\": \"\",\n \"StackId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeEcsClusters")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeEcsClusters")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"EcsClusterArns\": \"\",\n \"StackId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.asString();
const data = JSON.stringify({
EcsClusterArns: '',
StackId: '',
NextToken: '',
MaxResults: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeEcsClusters');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeEcsClusters',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {EcsClusterArns: '', StackId: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeEcsClusters';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"EcsClusterArns":"","StackId":"","NextToken":"","MaxResults":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeEcsClusters',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "EcsClusterArns": "",\n "StackId": "",\n "NextToken": "",\n "MaxResults": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"EcsClusterArns\": \"\",\n \"StackId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeEcsClusters")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({EcsClusterArns: '', StackId: '', NextToken: '', MaxResults: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeEcsClusters',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {EcsClusterArns: '', StackId: '', NextToken: '', MaxResults: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeEcsClusters');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
EcsClusterArns: '',
StackId: '',
NextToken: '',
MaxResults: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeEcsClusters',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {EcsClusterArns: '', StackId: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeEcsClusters';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"EcsClusterArns":"","StackId":"","NextToken":"","MaxResults":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"EcsClusterArns": @"",
@"StackId": @"",
@"NextToken": @"",
@"MaxResults": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeEcsClusters"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeEcsClusters" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"EcsClusterArns\": \"\",\n \"StackId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeEcsClusters",
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([
'EcsClusterArns' => '',
'StackId' => '',
'NextToken' => '',
'MaxResults' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeEcsClusters', [
'body' => '{
"EcsClusterArns": "",
"StackId": "",
"NextToken": "",
"MaxResults": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeEcsClusters');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'EcsClusterArns' => '',
'StackId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'EcsClusterArns' => '',
'StackId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeEcsClusters');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeEcsClusters' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EcsClusterArns": "",
"StackId": "",
"NextToken": "",
"MaxResults": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeEcsClusters' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EcsClusterArns": "",
"StackId": "",
"NextToken": "",
"MaxResults": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"EcsClusterArns\": \"\",\n \"StackId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeEcsClusters"
payload = {
"EcsClusterArns": "",
"StackId": "",
"NextToken": "",
"MaxResults": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeEcsClusters"
payload <- "{\n \"EcsClusterArns\": \"\",\n \"StackId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeEcsClusters")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"EcsClusterArns\": \"\",\n \"StackId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"EcsClusterArns\": \"\",\n \"StackId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeEcsClusters";
let payload = json!({
"EcsClusterArns": "",
"StackId": "",
"NextToken": "",
"MaxResults": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeEcsClusters' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"EcsClusterArns": "",
"StackId": "",
"NextToken": "",
"MaxResults": ""
}'
echo '{
"EcsClusterArns": "",
"StackId": "",
"NextToken": "",
"MaxResults": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeEcsClusters' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "EcsClusterArns": "",\n "StackId": "",\n "NextToken": "",\n "MaxResults": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeEcsClusters'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"EcsClusterArns": "",
"StackId": "",
"NextToken": "",
"MaxResults": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeEcsClusters")! 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
DescribeElasticIps
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticIps
HEADERS
X-Amz-Target
BODY json
{
"InstanceId": "",
"StackId": "",
"Ips": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticIps");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"Ips\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticIps" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:InstanceId ""
:StackId ""
:Ips ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticIps"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"Ips\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticIps"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"Ips\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticIps");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"Ips\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticIps"
payload := strings.NewReader("{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"Ips\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 52
{
"InstanceId": "",
"StackId": "",
"Ips": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticIps")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"Ips\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticIps"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"Ips\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"Ips\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticIps")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticIps")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"Ips\": \"\"\n}")
.asString();
const data = JSON.stringify({
InstanceId: '',
StackId: '',
Ips: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticIps');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticIps',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: '', StackId: '', Ips: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticIps';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":"","StackId":"","Ips":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticIps',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "InstanceId": "",\n "StackId": "",\n "Ips": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"Ips\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticIps")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({InstanceId: '', StackId: '', Ips: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticIps',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {InstanceId: '', StackId: '', Ips: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticIps');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
InstanceId: '',
StackId: '',
Ips: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticIps',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: '', StackId: '', Ips: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticIps';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":"","StackId":"","Ips":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"InstanceId": @"",
@"StackId": @"",
@"Ips": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticIps"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticIps" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"Ips\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticIps",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'InstanceId' => '',
'StackId' => '',
'Ips' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticIps', [
'body' => '{
"InstanceId": "",
"StackId": "",
"Ips": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticIps');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'InstanceId' => '',
'StackId' => '',
'Ips' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'InstanceId' => '',
'StackId' => '',
'Ips' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticIps');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticIps' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": "",
"StackId": "",
"Ips": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticIps' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": "",
"StackId": "",
"Ips": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"Ips\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticIps"
payload = {
"InstanceId": "",
"StackId": "",
"Ips": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticIps"
payload <- "{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"Ips\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticIps")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"Ips\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"Ips\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticIps";
let payload = json!({
"InstanceId": "",
"StackId": "",
"Ips": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticIps' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"InstanceId": "",
"StackId": "",
"Ips": ""
}'
echo '{
"InstanceId": "",
"StackId": "",
"Ips": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticIps' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "InstanceId": "",\n "StackId": "",\n "Ips": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticIps'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"InstanceId": "",
"StackId": "",
"Ips": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticIps")! 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
DescribeElasticLoadBalancers
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticLoadBalancers
HEADERS
X-Amz-Target
BODY json
{
"StackId": "",
"LayerIds": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticLoadBalancers");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"StackId\": \"\",\n \"LayerIds\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticLoadBalancers" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:StackId ""
:LayerIds ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticLoadBalancers"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"StackId\": \"\",\n \"LayerIds\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticLoadBalancers"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"StackId\": \"\",\n \"LayerIds\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticLoadBalancers");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"StackId\": \"\",\n \"LayerIds\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticLoadBalancers"
payload := strings.NewReader("{\n \"StackId\": \"\",\n \"LayerIds\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 37
{
"StackId": "",
"LayerIds": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticLoadBalancers")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"StackId\": \"\",\n \"LayerIds\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticLoadBalancers"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"StackId\": \"\",\n \"LayerIds\": \"\"\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 \"StackId\": \"\",\n \"LayerIds\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticLoadBalancers")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticLoadBalancers")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"StackId\": \"\",\n \"LayerIds\": \"\"\n}")
.asString();
const data = JSON.stringify({
StackId: '',
LayerIds: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticLoadBalancers');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticLoadBalancers',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {StackId: '', LayerIds: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticLoadBalancers';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":"","LayerIds":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticLoadBalancers',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "StackId": "",\n "LayerIds": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"StackId\": \"\",\n \"LayerIds\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticLoadBalancers")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({StackId: '', LayerIds: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticLoadBalancers',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {StackId: '', LayerIds: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticLoadBalancers');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
StackId: '',
LayerIds: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticLoadBalancers',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {StackId: '', LayerIds: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticLoadBalancers';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":"","LayerIds":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"StackId": @"",
@"LayerIds": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticLoadBalancers"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticLoadBalancers" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"StackId\": \"\",\n \"LayerIds\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticLoadBalancers",
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([
'StackId' => '',
'LayerIds' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticLoadBalancers', [
'body' => '{
"StackId": "",
"LayerIds": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticLoadBalancers');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'StackId' => '',
'LayerIds' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'StackId' => '',
'LayerIds' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticLoadBalancers');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticLoadBalancers' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": "",
"LayerIds": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticLoadBalancers' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": "",
"LayerIds": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"StackId\": \"\",\n \"LayerIds\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticLoadBalancers"
payload = {
"StackId": "",
"LayerIds": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticLoadBalancers"
payload <- "{\n \"StackId\": \"\",\n \"LayerIds\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticLoadBalancers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"StackId\": \"\",\n \"LayerIds\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"StackId\": \"\",\n \"LayerIds\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticLoadBalancers";
let payload = json!({
"StackId": "",
"LayerIds": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticLoadBalancers' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"StackId": "",
"LayerIds": ""
}'
echo '{
"StackId": "",
"LayerIds": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticLoadBalancers' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "StackId": "",\n "LayerIds": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticLoadBalancers'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"StackId": "",
"LayerIds": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeElasticLoadBalancers")! 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
DescribeInstances
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeInstances
HEADERS
X-Amz-Target
BODY json
{
"StackId": "",
"LayerId": "",
"InstanceIds": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeInstances");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"StackId\": \"\",\n \"LayerId\": \"\",\n \"InstanceIds\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeInstances" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:StackId ""
:LayerId ""
:InstanceIds ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeInstances"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"StackId\": \"\",\n \"LayerId\": \"\",\n \"InstanceIds\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeInstances"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"StackId\": \"\",\n \"LayerId\": \"\",\n \"InstanceIds\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeInstances");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"StackId\": \"\",\n \"LayerId\": \"\",\n \"InstanceIds\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeInstances"
payload := strings.NewReader("{\n \"StackId\": \"\",\n \"LayerId\": \"\",\n \"InstanceIds\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 57
{
"StackId": "",
"LayerId": "",
"InstanceIds": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeInstances")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"StackId\": \"\",\n \"LayerId\": \"\",\n \"InstanceIds\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeInstances"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"StackId\": \"\",\n \"LayerId\": \"\",\n \"InstanceIds\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"StackId\": \"\",\n \"LayerId\": \"\",\n \"InstanceIds\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeInstances")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeInstances")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"StackId\": \"\",\n \"LayerId\": \"\",\n \"InstanceIds\": \"\"\n}")
.asString();
const data = JSON.stringify({
StackId: '',
LayerId: '',
InstanceIds: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeInstances');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeInstances',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {StackId: '', LayerId: '', InstanceIds: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeInstances';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":"","LayerId":"","InstanceIds":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeInstances',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "StackId": "",\n "LayerId": "",\n "InstanceIds": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"StackId\": \"\",\n \"LayerId\": \"\",\n \"InstanceIds\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeInstances")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({StackId: '', LayerId: '', InstanceIds: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeInstances',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {StackId: '', LayerId: '', InstanceIds: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeInstances');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
StackId: '',
LayerId: '',
InstanceIds: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeInstances',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {StackId: '', LayerId: '', InstanceIds: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeInstances';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":"","LayerId":"","InstanceIds":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"StackId": @"",
@"LayerId": @"",
@"InstanceIds": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeInstances"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeInstances" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"StackId\": \"\",\n \"LayerId\": \"\",\n \"InstanceIds\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeInstances",
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([
'StackId' => '',
'LayerId' => '',
'InstanceIds' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeInstances', [
'body' => '{
"StackId": "",
"LayerId": "",
"InstanceIds": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeInstances');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'StackId' => '',
'LayerId' => '',
'InstanceIds' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'StackId' => '',
'LayerId' => '',
'InstanceIds' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeInstances');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeInstances' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": "",
"LayerId": "",
"InstanceIds": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeInstances' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": "",
"LayerId": "",
"InstanceIds": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"StackId\": \"\",\n \"LayerId\": \"\",\n \"InstanceIds\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeInstances"
payload = {
"StackId": "",
"LayerId": "",
"InstanceIds": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeInstances"
payload <- "{\n \"StackId\": \"\",\n \"LayerId\": \"\",\n \"InstanceIds\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeInstances")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"StackId\": \"\",\n \"LayerId\": \"\",\n \"InstanceIds\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"StackId\": \"\",\n \"LayerId\": \"\",\n \"InstanceIds\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeInstances";
let payload = json!({
"StackId": "",
"LayerId": "",
"InstanceIds": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeInstances' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"StackId": "",
"LayerId": "",
"InstanceIds": ""
}'
echo '{
"StackId": "",
"LayerId": "",
"InstanceIds": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeInstances' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "StackId": "",\n "LayerId": "",\n "InstanceIds": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeInstances'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"StackId": "",
"LayerId": "",
"InstanceIds": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeInstances")! 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
DescribeLayers
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLayers
HEADERS
X-Amz-Target
BODY json
{
"StackId": "",
"LayerIds": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLayers");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"StackId\": \"\",\n \"LayerIds\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLayers" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:StackId ""
:LayerIds ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLayers"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"StackId\": \"\",\n \"LayerIds\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLayers"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"StackId\": \"\",\n \"LayerIds\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLayers");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"StackId\": \"\",\n \"LayerIds\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLayers"
payload := strings.NewReader("{\n \"StackId\": \"\",\n \"LayerIds\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 37
{
"StackId": "",
"LayerIds": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLayers")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"StackId\": \"\",\n \"LayerIds\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLayers"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"StackId\": \"\",\n \"LayerIds\": \"\"\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 \"StackId\": \"\",\n \"LayerIds\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLayers")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLayers")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"StackId\": \"\",\n \"LayerIds\": \"\"\n}")
.asString();
const data = JSON.stringify({
StackId: '',
LayerIds: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLayers');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLayers',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {StackId: '', LayerIds: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLayers';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":"","LayerIds":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLayers',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "StackId": "",\n "LayerIds": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"StackId\": \"\",\n \"LayerIds\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLayers")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({StackId: '', LayerIds: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLayers',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {StackId: '', LayerIds: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLayers');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
StackId: '',
LayerIds: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLayers',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {StackId: '', LayerIds: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLayers';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":"","LayerIds":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"StackId": @"",
@"LayerIds": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLayers"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLayers" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"StackId\": \"\",\n \"LayerIds\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLayers",
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([
'StackId' => '',
'LayerIds' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLayers', [
'body' => '{
"StackId": "",
"LayerIds": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLayers');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'StackId' => '',
'LayerIds' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'StackId' => '',
'LayerIds' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLayers');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLayers' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": "",
"LayerIds": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLayers' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": "",
"LayerIds": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"StackId\": \"\",\n \"LayerIds\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLayers"
payload = {
"StackId": "",
"LayerIds": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLayers"
payload <- "{\n \"StackId\": \"\",\n \"LayerIds\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLayers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"StackId\": \"\",\n \"LayerIds\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"StackId\": \"\",\n \"LayerIds\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLayers";
let payload = json!({
"StackId": "",
"LayerIds": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLayers' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"StackId": "",
"LayerIds": ""
}'
echo '{
"StackId": "",
"LayerIds": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLayers' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "StackId": "",\n "LayerIds": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLayers'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"StackId": "",
"LayerIds": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLayers")! 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
DescribeLoadBasedAutoScaling
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLoadBasedAutoScaling
HEADERS
X-Amz-Target
BODY json
{
"LayerIds": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLoadBasedAutoScaling");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"LayerIds\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLoadBasedAutoScaling" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:LayerIds ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLoadBasedAutoScaling"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"LayerIds\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLoadBasedAutoScaling"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"LayerIds\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLoadBasedAutoScaling");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"LayerIds\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLoadBasedAutoScaling"
payload := strings.NewReader("{\n \"LayerIds\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 20
{
"LayerIds": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLoadBasedAutoScaling")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"LayerIds\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLoadBasedAutoScaling"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"LayerIds\": \"\"\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 \"LayerIds\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLoadBasedAutoScaling")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLoadBasedAutoScaling")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"LayerIds\": \"\"\n}")
.asString();
const data = JSON.stringify({
LayerIds: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLoadBasedAutoScaling');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLoadBasedAutoScaling',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {LayerIds: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLoadBasedAutoScaling';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"LayerIds":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLoadBasedAutoScaling',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "LayerIds": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"LayerIds\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLoadBasedAutoScaling")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({LayerIds: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLoadBasedAutoScaling',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {LayerIds: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLoadBasedAutoScaling');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
LayerIds: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLoadBasedAutoScaling',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {LayerIds: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLoadBasedAutoScaling';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"LayerIds":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"LayerIds": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLoadBasedAutoScaling"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLoadBasedAutoScaling" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"LayerIds\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLoadBasedAutoScaling",
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([
'LayerIds' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLoadBasedAutoScaling', [
'body' => '{
"LayerIds": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLoadBasedAutoScaling');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'LayerIds' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'LayerIds' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLoadBasedAutoScaling');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLoadBasedAutoScaling' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"LayerIds": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLoadBasedAutoScaling' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"LayerIds": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"LayerIds\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLoadBasedAutoScaling"
payload = { "LayerIds": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLoadBasedAutoScaling"
payload <- "{\n \"LayerIds\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLoadBasedAutoScaling")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"LayerIds\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"LayerIds\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLoadBasedAutoScaling";
let payload = json!({"LayerIds": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLoadBasedAutoScaling' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"LayerIds": ""
}'
echo '{
"LayerIds": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLoadBasedAutoScaling' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "LayerIds": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLoadBasedAutoScaling'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["LayerIds": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeLoadBasedAutoScaling")! 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
DescribeMyUserProfile
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeMyUserProfile
HEADERS
X-Amz-Target
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeMyUserProfile");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeMyUserProfile" {:headers {:x-amz-target ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeMyUserProfile"
headers = HTTP::Headers{
"x-amz-target" => ""
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeMyUserProfile"),
Headers =
{
{ "x-amz-target", "" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeMyUserProfile");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeMyUserProfile"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-amz-target", "")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeMyUserProfile")
.setHeader("x-amz-target", "")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeMyUserProfile"))
.header("x-amz-target", "")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeMyUserProfile")
.post(null)
.addHeader("x-amz-target", "")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeMyUserProfile")
.header("x-amz-target", "")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeMyUserProfile');
xhr.setRequestHeader('x-amz-target', '');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeMyUserProfile',
headers: {'x-amz-target': ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeMyUserProfile';
const options = {method: 'POST', headers: {'x-amz-target': ''}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeMyUserProfile',
method: 'POST',
headers: {
'x-amz-target': ''
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeMyUserProfile")
.post(null)
.addHeader("x-amz-target", "")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': ''
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeMyUserProfile',
headers: {'x-amz-target': ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeMyUserProfile');
req.headers({
'x-amz-target': ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeMyUserProfile',
headers: {'x-amz-target': ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeMyUserProfile';
const options = {method: 'POST', headers: {'x-amz-target': ''}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeMyUserProfile"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeMyUserProfile" in
let headers = Header.add (Header.init ()) "x-amz-target" "" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeMyUserProfile",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeMyUserProfile', [
'headers' => [
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeMyUserProfile');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeMyUserProfile');
$request->setRequestMethod('POST');
$request->setHeaders([
'x-amz-target' => ''
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeMyUserProfile' -Method POST -Headers $headers
$headers=@{}
$headers.Add("x-amz-target", "")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeMyUserProfile' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-amz-target': "" }
conn.request("POST", "/baseUrl/", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeMyUserProfile"
headers = {"x-amz-target": ""}
response = requests.post(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeMyUserProfile"
response <- VERB("POST", url, add_headers('x-amz-target' = ''), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeMyUserProfile")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeMyUserProfile";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeMyUserProfile' \
--header 'x-amz-target: '
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeMyUserProfile' \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeMyUserProfile'
import Foundation
let headers = ["x-amz-target": ""]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeMyUserProfile")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
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
DescribeOperatingSystems
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeOperatingSystems
HEADERS
X-Amz-Target
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeOperatingSystems");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeOperatingSystems" {:headers {:x-amz-target ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeOperatingSystems"
headers = HTTP::Headers{
"x-amz-target" => ""
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeOperatingSystems"),
Headers =
{
{ "x-amz-target", "" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeOperatingSystems");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeOperatingSystems"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-amz-target", "")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeOperatingSystems")
.setHeader("x-amz-target", "")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeOperatingSystems"))
.header("x-amz-target", "")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeOperatingSystems")
.post(null)
.addHeader("x-amz-target", "")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeOperatingSystems")
.header("x-amz-target", "")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeOperatingSystems');
xhr.setRequestHeader('x-amz-target', '');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeOperatingSystems',
headers: {'x-amz-target': ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeOperatingSystems';
const options = {method: 'POST', headers: {'x-amz-target': ''}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeOperatingSystems',
method: 'POST',
headers: {
'x-amz-target': ''
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeOperatingSystems")
.post(null)
.addHeader("x-amz-target", "")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': ''
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeOperatingSystems',
headers: {'x-amz-target': ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeOperatingSystems');
req.headers({
'x-amz-target': ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeOperatingSystems',
headers: {'x-amz-target': ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeOperatingSystems';
const options = {method: 'POST', headers: {'x-amz-target': ''}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeOperatingSystems"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeOperatingSystems" in
let headers = Header.add (Header.init ()) "x-amz-target" "" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeOperatingSystems",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeOperatingSystems', [
'headers' => [
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeOperatingSystems');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeOperatingSystems');
$request->setRequestMethod('POST');
$request->setHeaders([
'x-amz-target' => ''
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeOperatingSystems' -Method POST -Headers $headers
$headers=@{}
$headers.Add("x-amz-target", "")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeOperatingSystems' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-amz-target': "" }
conn.request("POST", "/baseUrl/", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeOperatingSystems"
headers = {"x-amz-target": ""}
response = requests.post(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeOperatingSystems"
response <- VERB("POST", url, add_headers('x-amz-target' = ''), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeOperatingSystems")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeOperatingSystems";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeOperatingSystems' \
--header 'x-amz-target: '
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeOperatingSystems' \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeOperatingSystems'
import Foundation
let headers = ["x-amz-target": ""]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeOperatingSystems")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
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
DescribePermissions
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribePermissions
HEADERS
X-Amz-Target
BODY json
{
"IamUserArn": "",
"StackId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribePermissions");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"IamUserArn\": \"\",\n \"StackId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribePermissions" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IamUserArn ""
:StackId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribePermissions"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IamUserArn\": \"\",\n \"StackId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribePermissions"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IamUserArn\": \"\",\n \"StackId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribePermissions");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IamUserArn\": \"\",\n \"StackId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribePermissions"
payload := strings.NewReader("{\n \"IamUserArn\": \"\",\n \"StackId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 39
{
"IamUserArn": "",
"StackId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribePermissions")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IamUserArn\": \"\",\n \"StackId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribePermissions"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IamUserArn\": \"\",\n \"StackId\": \"\"\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 \"IamUserArn\": \"\",\n \"StackId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribePermissions")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribePermissions")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IamUserArn\": \"\",\n \"StackId\": \"\"\n}")
.asString();
const data = JSON.stringify({
IamUserArn: '',
StackId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribePermissions');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribePermissions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IamUserArn: '', StackId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribePermissions';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IamUserArn":"","StackId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribePermissions',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IamUserArn": "",\n "StackId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"IamUserArn\": \"\",\n \"StackId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribePermissions")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({IamUserArn: '', StackId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribePermissions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {IamUserArn: '', StackId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribePermissions');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IamUserArn: '',
StackId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribePermissions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IamUserArn: '', StackId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribePermissions';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IamUserArn":"","StackId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"IamUserArn": @"",
@"StackId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribePermissions"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribePermissions" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IamUserArn\": \"\",\n \"StackId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribePermissions",
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([
'IamUserArn' => '',
'StackId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribePermissions', [
'body' => '{
"IamUserArn": "",
"StackId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribePermissions');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IamUserArn' => '',
'StackId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IamUserArn' => '',
'StackId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribePermissions');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribePermissions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IamUserArn": "",
"StackId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribePermissions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IamUserArn": "",
"StackId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IamUserArn\": \"\",\n \"StackId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribePermissions"
payload = {
"IamUserArn": "",
"StackId": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribePermissions"
payload <- "{\n \"IamUserArn\": \"\",\n \"StackId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribePermissions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"IamUserArn\": \"\",\n \"StackId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"IamUserArn\": \"\",\n \"StackId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribePermissions";
let payload = json!({
"IamUserArn": "",
"StackId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribePermissions' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IamUserArn": "",
"StackId": ""
}'
echo '{
"IamUserArn": "",
"StackId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribePermissions' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IamUserArn": "",\n "StackId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribePermissions'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"IamUserArn": "",
"StackId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribePermissions")! 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
DescribeRaidArrays
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRaidArrays
HEADERS
X-Amz-Target
BODY json
{
"InstanceId": "",
"StackId": "",
"RaidArrayIds": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRaidArrays");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"RaidArrayIds\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRaidArrays" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:InstanceId ""
:StackId ""
:RaidArrayIds ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRaidArrays"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"RaidArrayIds\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRaidArrays"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"RaidArrayIds\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRaidArrays");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"RaidArrayIds\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRaidArrays"
payload := strings.NewReader("{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"RaidArrayIds\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 61
{
"InstanceId": "",
"StackId": "",
"RaidArrayIds": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRaidArrays")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"RaidArrayIds\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRaidArrays"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"RaidArrayIds\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"RaidArrayIds\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRaidArrays")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRaidArrays")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"RaidArrayIds\": \"\"\n}")
.asString();
const data = JSON.stringify({
InstanceId: '',
StackId: '',
RaidArrayIds: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRaidArrays');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRaidArrays',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: '', StackId: '', RaidArrayIds: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRaidArrays';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":"","StackId":"","RaidArrayIds":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRaidArrays',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "InstanceId": "",\n "StackId": "",\n "RaidArrayIds": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"RaidArrayIds\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRaidArrays")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({InstanceId: '', StackId: '', RaidArrayIds: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRaidArrays',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {InstanceId: '', StackId: '', RaidArrayIds: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRaidArrays');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
InstanceId: '',
StackId: '',
RaidArrayIds: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRaidArrays',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: '', StackId: '', RaidArrayIds: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRaidArrays';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":"","StackId":"","RaidArrayIds":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"InstanceId": @"",
@"StackId": @"",
@"RaidArrayIds": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRaidArrays"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRaidArrays" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"RaidArrayIds\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRaidArrays",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'InstanceId' => '',
'StackId' => '',
'RaidArrayIds' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRaidArrays', [
'body' => '{
"InstanceId": "",
"StackId": "",
"RaidArrayIds": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRaidArrays');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'InstanceId' => '',
'StackId' => '',
'RaidArrayIds' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'InstanceId' => '',
'StackId' => '',
'RaidArrayIds' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRaidArrays');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRaidArrays' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": "",
"StackId": "",
"RaidArrayIds": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRaidArrays' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": "",
"StackId": "",
"RaidArrayIds": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"RaidArrayIds\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRaidArrays"
payload = {
"InstanceId": "",
"StackId": "",
"RaidArrayIds": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRaidArrays"
payload <- "{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"RaidArrayIds\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRaidArrays")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"RaidArrayIds\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"RaidArrayIds\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRaidArrays";
let payload = json!({
"InstanceId": "",
"StackId": "",
"RaidArrayIds": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRaidArrays' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"InstanceId": "",
"StackId": "",
"RaidArrayIds": ""
}'
echo '{
"InstanceId": "",
"StackId": "",
"RaidArrayIds": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRaidArrays' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "InstanceId": "",\n "StackId": "",\n "RaidArrayIds": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRaidArrays'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"InstanceId": "",
"StackId": "",
"RaidArrayIds": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRaidArrays")! 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
DescribeRdsDbInstances
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRdsDbInstances
HEADERS
X-Amz-Target
BODY json
{
"StackId": "",
"RdsDbInstanceArns": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRdsDbInstances");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"StackId\": \"\",\n \"RdsDbInstanceArns\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRdsDbInstances" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:StackId ""
:RdsDbInstanceArns ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRdsDbInstances"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"StackId\": \"\",\n \"RdsDbInstanceArns\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRdsDbInstances"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"StackId\": \"\",\n \"RdsDbInstanceArns\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRdsDbInstances");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"StackId\": \"\",\n \"RdsDbInstanceArns\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRdsDbInstances"
payload := strings.NewReader("{\n \"StackId\": \"\",\n \"RdsDbInstanceArns\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 46
{
"StackId": "",
"RdsDbInstanceArns": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRdsDbInstances")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"StackId\": \"\",\n \"RdsDbInstanceArns\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRdsDbInstances"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"StackId\": \"\",\n \"RdsDbInstanceArns\": \"\"\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 \"StackId\": \"\",\n \"RdsDbInstanceArns\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRdsDbInstances")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRdsDbInstances")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"StackId\": \"\",\n \"RdsDbInstanceArns\": \"\"\n}")
.asString();
const data = JSON.stringify({
StackId: '',
RdsDbInstanceArns: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRdsDbInstances');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRdsDbInstances',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {StackId: '', RdsDbInstanceArns: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRdsDbInstances';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":"","RdsDbInstanceArns":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRdsDbInstances',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "StackId": "",\n "RdsDbInstanceArns": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"StackId\": \"\",\n \"RdsDbInstanceArns\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRdsDbInstances")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({StackId: '', RdsDbInstanceArns: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRdsDbInstances',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {StackId: '', RdsDbInstanceArns: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRdsDbInstances');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
StackId: '',
RdsDbInstanceArns: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRdsDbInstances',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {StackId: '', RdsDbInstanceArns: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRdsDbInstances';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":"","RdsDbInstanceArns":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"StackId": @"",
@"RdsDbInstanceArns": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRdsDbInstances"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRdsDbInstances" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"StackId\": \"\",\n \"RdsDbInstanceArns\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRdsDbInstances",
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([
'StackId' => '',
'RdsDbInstanceArns' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRdsDbInstances', [
'body' => '{
"StackId": "",
"RdsDbInstanceArns": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRdsDbInstances');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'StackId' => '',
'RdsDbInstanceArns' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'StackId' => '',
'RdsDbInstanceArns' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRdsDbInstances');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRdsDbInstances' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": "",
"RdsDbInstanceArns": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRdsDbInstances' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": "",
"RdsDbInstanceArns": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"StackId\": \"\",\n \"RdsDbInstanceArns\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRdsDbInstances"
payload = {
"StackId": "",
"RdsDbInstanceArns": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRdsDbInstances"
payload <- "{\n \"StackId\": \"\",\n \"RdsDbInstanceArns\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRdsDbInstances")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"StackId\": \"\",\n \"RdsDbInstanceArns\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"StackId\": \"\",\n \"RdsDbInstanceArns\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRdsDbInstances";
let payload = json!({
"StackId": "",
"RdsDbInstanceArns": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRdsDbInstances' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"StackId": "",
"RdsDbInstanceArns": ""
}'
echo '{
"StackId": "",
"RdsDbInstanceArns": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRdsDbInstances' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "StackId": "",\n "RdsDbInstanceArns": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRdsDbInstances'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"StackId": "",
"RdsDbInstanceArns": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeRdsDbInstances")! 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
DescribeServiceErrors
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeServiceErrors
HEADERS
X-Amz-Target
BODY json
{
"StackId": "",
"InstanceId": "",
"ServiceErrorIds": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeServiceErrors");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"StackId\": \"\",\n \"InstanceId\": \"\",\n \"ServiceErrorIds\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeServiceErrors" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:StackId ""
:InstanceId ""
:ServiceErrorIds ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeServiceErrors"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"StackId\": \"\",\n \"InstanceId\": \"\",\n \"ServiceErrorIds\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeServiceErrors"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"StackId\": \"\",\n \"InstanceId\": \"\",\n \"ServiceErrorIds\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeServiceErrors");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"StackId\": \"\",\n \"InstanceId\": \"\",\n \"ServiceErrorIds\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeServiceErrors"
payload := strings.NewReader("{\n \"StackId\": \"\",\n \"InstanceId\": \"\",\n \"ServiceErrorIds\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 64
{
"StackId": "",
"InstanceId": "",
"ServiceErrorIds": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeServiceErrors")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"StackId\": \"\",\n \"InstanceId\": \"\",\n \"ServiceErrorIds\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeServiceErrors"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"StackId\": \"\",\n \"InstanceId\": \"\",\n \"ServiceErrorIds\": \"\"\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 \"StackId\": \"\",\n \"InstanceId\": \"\",\n \"ServiceErrorIds\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeServiceErrors")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeServiceErrors")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"StackId\": \"\",\n \"InstanceId\": \"\",\n \"ServiceErrorIds\": \"\"\n}")
.asString();
const data = JSON.stringify({
StackId: '',
InstanceId: '',
ServiceErrorIds: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeServiceErrors');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeServiceErrors',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {StackId: '', InstanceId: '', ServiceErrorIds: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeServiceErrors';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":"","InstanceId":"","ServiceErrorIds":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeServiceErrors',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "StackId": "",\n "InstanceId": "",\n "ServiceErrorIds": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"StackId\": \"\",\n \"InstanceId\": \"\",\n \"ServiceErrorIds\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeServiceErrors")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({StackId: '', InstanceId: '', ServiceErrorIds: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeServiceErrors',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {StackId: '', InstanceId: '', ServiceErrorIds: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeServiceErrors');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
StackId: '',
InstanceId: '',
ServiceErrorIds: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeServiceErrors',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {StackId: '', InstanceId: '', ServiceErrorIds: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeServiceErrors';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":"","InstanceId":"","ServiceErrorIds":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"StackId": @"",
@"InstanceId": @"",
@"ServiceErrorIds": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeServiceErrors"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeServiceErrors" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"StackId\": \"\",\n \"InstanceId\": \"\",\n \"ServiceErrorIds\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeServiceErrors",
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([
'StackId' => '',
'InstanceId' => '',
'ServiceErrorIds' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeServiceErrors', [
'body' => '{
"StackId": "",
"InstanceId": "",
"ServiceErrorIds": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeServiceErrors');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'StackId' => '',
'InstanceId' => '',
'ServiceErrorIds' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'StackId' => '',
'InstanceId' => '',
'ServiceErrorIds' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeServiceErrors');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeServiceErrors' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": "",
"InstanceId": "",
"ServiceErrorIds": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeServiceErrors' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": "",
"InstanceId": "",
"ServiceErrorIds": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"StackId\": \"\",\n \"InstanceId\": \"\",\n \"ServiceErrorIds\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeServiceErrors"
payload = {
"StackId": "",
"InstanceId": "",
"ServiceErrorIds": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeServiceErrors"
payload <- "{\n \"StackId\": \"\",\n \"InstanceId\": \"\",\n \"ServiceErrorIds\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeServiceErrors")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"StackId\": \"\",\n \"InstanceId\": \"\",\n \"ServiceErrorIds\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"StackId\": \"\",\n \"InstanceId\": \"\",\n \"ServiceErrorIds\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeServiceErrors";
let payload = json!({
"StackId": "",
"InstanceId": "",
"ServiceErrorIds": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeServiceErrors' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"StackId": "",
"InstanceId": "",
"ServiceErrorIds": ""
}'
echo '{
"StackId": "",
"InstanceId": "",
"ServiceErrorIds": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeServiceErrors' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "StackId": "",\n "InstanceId": "",\n "ServiceErrorIds": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeServiceErrors'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"StackId": "",
"InstanceId": "",
"ServiceErrorIds": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeServiceErrors")! 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
DescribeStackProvisioningParameters
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackProvisioningParameters
HEADERS
X-Amz-Target
BODY json
{
"StackId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackProvisioningParameters");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"StackId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackProvisioningParameters" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:StackId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackProvisioningParameters"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"StackId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackProvisioningParameters"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"StackId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackProvisioningParameters");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"StackId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackProvisioningParameters"
payload := strings.NewReader("{\n \"StackId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 19
{
"StackId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackProvisioningParameters")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"StackId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackProvisioningParameters"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"StackId\": \"\"\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 \"StackId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackProvisioningParameters")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackProvisioningParameters")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"StackId\": \"\"\n}")
.asString();
const data = JSON.stringify({
StackId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackProvisioningParameters');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackProvisioningParameters',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {StackId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackProvisioningParameters';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackProvisioningParameters',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "StackId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"StackId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackProvisioningParameters")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({StackId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackProvisioningParameters',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {StackId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackProvisioningParameters');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
StackId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackProvisioningParameters',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {StackId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackProvisioningParameters';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"StackId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackProvisioningParameters"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackProvisioningParameters" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"StackId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackProvisioningParameters",
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([
'StackId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackProvisioningParameters', [
'body' => '{
"StackId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackProvisioningParameters');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'StackId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'StackId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackProvisioningParameters');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackProvisioningParameters' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackProvisioningParameters' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"StackId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackProvisioningParameters"
payload = { "StackId": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackProvisioningParameters"
payload <- "{\n \"StackId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackProvisioningParameters")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"StackId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"StackId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackProvisioningParameters";
let payload = json!({"StackId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackProvisioningParameters' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"StackId": ""
}'
echo '{
"StackId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackProvisioningParameters' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "StackId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackProvisioningParameters'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["StackId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackProvisioningParameters")! 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
DescribeStackSummary
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackSummary
HEADERS
X-Amz-Target
BODY json
{
"StackId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackSummary");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"StackId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackSummary" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:StackId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackSummary"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"StackId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackSummary"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"StackId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackSummary");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"StackId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackSummary"
payload := strings.NewReader("{\n \"StackId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 19
{
"StackId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackSummary")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"StackId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackSummary"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"StackId\": \"\"\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 \"StackId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackSummary")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackSummary")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"StackId\": \"\"\n}")
.asString();
const data = JSON.stringify({
StackId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackSummary');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackSummary',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {StackId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackSummary';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackSummary',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "StackId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"StackId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackSummary")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({StackId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackSummary',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {StackId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackSummary');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
StackId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackSummary',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {StackId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackSummary';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"StackId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackSummary"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackSummary" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"StackId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackSummary",
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([
'StackId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackSummary', [
'body' => '{
"StackId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackSummary');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'StackId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'StackId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackSummary');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackSummary' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackSummary' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"StackId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackSummary"
payload = { "StackId": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackSummary"
payload <- "{\n \"StackId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackSummary")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"StackId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"StackId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackSummary";
let payload = json!({"StackId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackSummary' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"StackId": ""
}'
echo '{
"StackId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackSummary' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "StackId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackSummary'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["StackId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStackSummary")! 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
DescribeStacks
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStacks
HEADERS
X-Amz-Target
BODY json
{
"StackIds": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStacks");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"StackIds\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStacks" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:StackIds ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStacks"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"StackIds\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStacks"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"StackIds\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStacks");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"StackIds\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStacks"
payload := strings.NewReader("{\n \"StackIds\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 20
{
"StackIds": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStacks")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"StackIds\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStacks"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"StackIds\": \"\"\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 \"StackIds\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStacks")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStacks")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"StackIds\": \"\"\n}")
.asString();
const data = JSON.stringify({
StackIds: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStacks');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStacks',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {StackIds: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStacks';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackIds":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStacks',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "StackIds": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"StackIds\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStacks")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({StackIds: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStacks',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {StackIds: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStacks');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
StackIds: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStacks',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {StackIds: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStacks';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackIds":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"StackIds": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStacks"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStacks" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"StackIds\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStacks",
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([
'StackIds' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStacks', [
'body' => '{
"StackIds": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStacks');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'StackIds' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'StackIds' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStacks');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStacks' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackIds": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStacks' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackIds": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"StackIds\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStacks"
payload = { "StackIds": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStacks"
payload <- "{\n \"StackIds\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStacks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"StackIds\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"StackIds\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStacks";
let payload = json!({"StackIds": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStacks' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"StackIds": ""
}'
echo '{
"StackIds": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStacks' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "StackIds": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStacks'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["StackIds": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeStacks")! 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
DescribeTimeBasedAutoScaling
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeTimeBasedAutoScaling
HEADERS
X-Amz-Target
BODY json
{
"InstanceIds": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeTimeBasedAutoScaling");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"InstanceIds\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeTimeBasedAutoScaling" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:InstanceIds ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeTimeBasedAutoScaling"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"InstanceIds\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeTimeBasedAutoScaling"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"InstanceIds\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeTimeBasedAutoScaling");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"InstanceIds\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeTimeBasedAutoScaling"
payload := strings.NewReader("{\n \"InstanceIds\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 23
{
"InstanceIds": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeTimeBasedAutoScaling")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"InstanceIds\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeTimeBasedAutoScaling"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"InstanceIds\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"InstanceIds\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeTimeBasedAutoScaling")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeTimeBasedAutoScaling")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"InstanceIds\": \"\"\n}")
.asString();
const data = JSON.stringify({
InstanceIds: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeTimeBasedAutoScaling');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeTimeBasedAutoScaling',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceIds: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeTimeBasedAutoScaling';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceIds":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeTimeBasedAutoScaling',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "InstanceIds": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"InstanceIds\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeTimeBasedAutoScaling")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({InstanceIds: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeTimeBasedAutoScaling',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {InstanceIds: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeTimeBasedAutoScaling');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
InstanceIds: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeTimeBasedAutoScaling',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceIds: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeTimeBasedAutoScaling';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceIds":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"InstanceIds": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeTimeBasedAutoScaling"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeTimeBasedAutoScaling" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"InstanceIds\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeTimeBasedAutoScaling",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'InstanceIds' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeTimeBasedAutoScaling', [
'body' => '{
"InstanceIds": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeTimeBasedAutoScaling');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'InstanceIds' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'InstanceIds' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeTimeBasedAutoScaling');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeTimeBasedAutoScaling' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceIds": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeTimeBasedAutoScaling' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceIds": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"InstanceIds\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeTimeBasedAutoScaling"
payload = { "InstanceIds": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeTimeBasedAutoScaling"
payload <- "{\n \"InstanceIds\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeTimeBasedAutoScaling")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"InstanceIds\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"InstanceIds\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeTimeBasedAutoScaling";
let payload = json!({"InstanceIds": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeTimeBasedAutoScaling' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"InstanceIds": ""
}'
echo '{
"InstanceIds": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeTimeBasedAutoScaling' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "InstanceIds": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeTimeBasedAutoScaling'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["InstanceIds": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeTimeBasedAutoScaling")! 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
DescribeUserProfiles
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeUserProfiles
HEADERS
X-Amz-Target
BODY json
{
"IamUserArns": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeUserProfiles");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"IamUserArns\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeUserProfiles" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IamUserArns ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeUserProfiles"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IamUserArns\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeUserProfiles"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IamUserArns\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeUserProfiles");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IamUserArns\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeUserProfiles"
payload := strings.NewReader("{\n \"IamUserArns\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 23
{
"IamUserArns": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeUserProfiles")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IamUserArns\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeUserProfiles"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IamUserArns\": \"\"\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 \"IamUserArns\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeUserProfiles")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeUserProfiles")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IamUserArns\": \"\"\n}")
.asString();
const data = JSON.stringify({
IamUserArns: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeUserProfiles');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeUserProfiles',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IamUserArns: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeUserProfiles';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IamUserArns":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeUserProfiles',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IamUserArns": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"IamUserArns\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeUserProfiles")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({IamUserArns: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeUserProfiles',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {IamUserArns: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeUserProfiles');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IamUserArns: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeUserProfiles',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IamUserArns: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeUserProfiles';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IamUserArns":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"IamUserArns": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeUserProfiles"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeUserProfiles" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IamUserArns\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeUserProfiles",
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([
'IamUserArns' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeUserProfiles', [
'body' => '{
"IamUserArns": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeUserProfiles');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IamUserArns' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IamUserArns' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeUserProfiles');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeUserProfiles' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IamUserArns": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeUserProfiles' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IamUserArns": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IamUserArns\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeUserProfiles"
payload = { "IamUserArns": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeUserProfiles"
payload <- "{\n \"IamUserArns\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeUserProfiles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"IamUserArns\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"IamUserArns\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeUserProfiles";
let payload = json!({"IamUserArns": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeUserProfiles' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IamUserArns": ""
}'
echo '{
"IamUserArns": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeUserProfiles' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IamUserArns": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeUserProfiles'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["IamUserArns": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeUserProfiles")! 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
DescribeVolumes
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeVolumes
HEADERS
X-Amz-Target
BODY json
{
"InstanceId": "",
"StackId": "",
"RaidArrayId": "",
"VolumeIds": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeVolumes");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"RaidArrayId\": \"\",\n \"VolumeIds\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeVolumes" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:InstanceId ""
:StackId ""
:RaidArrayId ""
:VolumeIds ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeVolumes"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"RaidArrayId\": \"\",\n \"VolumeIds\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeVolumes"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"RaidArrayId\": \"\",\n \"VolumeIds\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeVolumes");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"RaidArrayId\": \"\",\n \"VolumeIds\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeVolumes"
payload := strings.NewReader("{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"RaidArrayId\": \"\",\n \"VolumeIds\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 79
{
"InstanceId": "",
"StackId": "",
"RaidArrayId": "",
"VolumeIds": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeVolumes")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"RaidArrayId\": \"\",\n \"VolumeIds\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeVolumes"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"RaidArrayId\": \"\",\n \"VolumeIds\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"RaidArrayId\": \"\",\n \"VolumeIds\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeVolumes")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeVolumes")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"RaidArrayId\": \"\",\n \"VolumeIds\": \"\"\n}")
.asString();
const data = JSON.stringify({
InstanceId: '',
StackId: '',
RaidArrayId: '',
VolumeIds: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeVolumes');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeVolumes',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: '', StackId: '', RaidArrayId: '', VolumeIds: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeVolumes';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":"","StackId":"","RaidArrayId":"","VolumeIds":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeVolumes',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "InstanceId": "",\n "StackId": "",\n "RaidArrayId": "",\n "VolumeIds": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"RaidArrayId\": \"\",\n \"VolumeIds\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeVolumes")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({InstanceId: '', StackId: '', RaidArrayId: '', VolumeIds: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeVolumes',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {InstanceId: '', StackId: '', RaidArrayId: '', VolumeIds: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeVolumes');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
InstanceId: '',
StackId: '',
RaidArrayId: '',
VolumeIds: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeVolumes',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: '', StackId: '', RaidArrayId: '', VolumeIds: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeVolumes';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":"","StackId":"","RaidArrayId":"","VolumeIds":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"InstanceId": @"",
@"StackId": @"",
@"RaidArrayId": @"",
@"VolumeIds": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeVolumes"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeVolumes" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"RaidArrayId\": \"\",\n \"VolumeIds\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeVolumes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'InstanceId' => '',
'StackId' => '',
'RaidArrayId' => '',
'VolumeIds' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeVolumes', [
'body' => '{
"InstanceId": "",
"StackId": "",
"RaidArrayId": "",
"VolumeIds": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeVolumes');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'InstanceId' => '',
'StackId' => '',
'RaidArrayId' => '',
'VolumeIds' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'InstanceId' => '',
'StackId' => '',
'RaidArrayId' => '',
'VolumeIds' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeVolumes');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeVolumes' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": "",
"StackId": "",
"RaidArrayId": "",
"VolumeIds": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeVolumes' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": "",
"StackId": "",
"RaidArrayId": "",
"VolumeIds": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"RaidArrayId\": \"\",\n \"VolumeIds\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeVolumes"
payload = {
"InstanceId": "",
"StackId": "",
"RaidArrayId": "",
"VolumeIds": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeVolumes"
payload <- "{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"RaidArrayId\": \"\",\n \"VolumeIds\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeVolumes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"RaidArrayId\": \"\",\n \"VolumeIds\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"InstanceId\": \"\",\n \"StackId\": \"\",\n \"RaidArrayId\": \"\",\n \"VolumeIds\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeVolumes";
let payload = json!({
"InstanceId": "",
"StackId": "",
"RaidArrayId": "",
"VolumeIds": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeVolumes' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"InstanceId": "",
"StackId": "",
"RaidArrayId": "",
"VolumeIds": ""
}'
echo '{
"InstanceId": "",
"StackId": "",
"RaidArrayId": "",
"VolumeIds": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeVolumes' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "InstanceId": "",\n "StackId": "",\n "RaidArrayId": "",\n "VolumeIds": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeVolumes'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"InstanceId": "",
"StackId": "",
"RaidArrayId": "",
"VolumeIds": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DescribeVolumes")! 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
DetachElasticLoadBalancer
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DetachElasticLoadBalancer
HEADERS
X-Amz-Target
BODY json
{
"ElasticLoadBalancerName": "",
"LayerId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DetachElasticLoadBalancer");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"ElasticLoadBalancerName\": \"\",\n \"LayerId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DetachElasticLoadBalancer" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ElasticLoadBalancerName ""
:LayerId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DetachElasticLoadBalancer"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ElasticLoadBalancerName\": \"\",\n \"LayerId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DetachElasticLoadBalancer"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ElasticLoadBalancerName\": \"\",\n \"LayerId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DetachElasticLoadBalancer");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ElasticLoadBalancerName\": \"\",\n \"LayerId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DetachElasticLoadBalancer"
payload := strings.NewReader("{\n \"ElasticLoadBalancerName\": \"\",\n \"LayerId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 52
{
"ElasticLoadBalancerName": "",
"LayerId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DetachElasticLoadBalancer")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ElasticLoadBalancerName\": \"\",\n \"LayerId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DetachElasticLoadBalancer"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ElasticLoadBalancerName\": \"\",\n \"LayerId\": \"\"\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 \"ElasticLoadBalancerName\": \"\",\n \"LayerId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DetachElasticLoadBalancer")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DetachElasticLoadBalancer")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ElasticLoadBalancerName\": \"\",\n \"LayerId\": \"\"\n}")
.asString();
const data = JSON.stringify({
ElasticLoadBalancerName: '',
LayerId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DetachElasticLoadBalancer');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DetachElasticLoadBalancer',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ElasticLoadBalancerName: '', LayerId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DetachElasticLoadBalancer';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ElasticLoadBalancerName":"","LayerId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DetachElasticLoadBalancer',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ElasticLoadBalancerName": "",\n "LayerId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ElasticLoadBalancerName\": \"\",\n \"LayerId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DetachElasticLoadBalancer")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({ElasticLoadBalancerName: '', LayerId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DetachElasticLoadBalancer',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {ElasticLoadBalancerName: '', LayerId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DetachElasticLoadBalancer');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ElasticLoadBalancerName: '',
LayerId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DetachElasticLoadBalancer',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ElasticLoadBalancerName: '', LayerId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DetachElasticLoadBalancer';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ElasticLoadBalancerName":"","LayerId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"ElasticLoadBalancerName": @"",
@"LayerId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DetachElasticLoadBalancer"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DetachElasticLoadBalancer" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"ElasticLoadBalancerName\": \"\",\n \"LayerId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DetachElasticLoadBalancer",
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([
'ElasticLoadBalancerName' => '',
'LayerId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DetachElasticLoadBalancer', [
'body' => '{
"ElasticLoadBalancerName": "",
"LayerId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DetachElasticLoadBalancer');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ElasticLoadBalancerName' => '',
'LayerId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ElasticLoadBalancerName' => '',
'LayerId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DetachElasticLoadBalancer');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DetachElasticLoadBalancer' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ElasticLoadBalancerName": "",
"LayerId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DetachElasticLoadBalancer' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ElasticLoadBalancerName": "",
"LayerId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ElasticLoadBalancerName\": \"\",\n \"LayerId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DetachElasticLoadBalancer"
payload = {
"ElasticLoadBalancerName": "",
"LayerId": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DetachElasticLoadBalancer"
payload <- "{\n \"ElasticLoadBalancerName\": \"\",\n \"LayerId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DetachElasticLoadBalancer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"ElasticLoadBalancerName\": \"\",\n \"LayerId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"ElasticLoadBalancerName\": \"\",\n \"LayerId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DetachElasticLoadBalancer";
let payload = json!({
"ElasticLoadBalancerName": "",
"LayerId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DetachElasticLoadBalancer' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ElasticLoadBalancerName": "",
"LayerId": ""
}'
echo '{
"ElasticLoadBalancerName": "",
"LayerId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DetachElasticLoadBalancer' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ElasticLoadBalancerName": "",\n "LayerId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DetachElasticLoadBalancer'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"ElasticLoadBalancerName": "",
"LayerId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DetachElasticLoadBalancer")! 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
DisassociateElasticIp
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DisassociateElasticIp
HEADERS
X-Amz-Target
BODY json
{
"ElasticIp": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DisassociateElasticIp");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"ElasticIp\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DisassociateElasticIp" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ElasticIp ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DisassociateElasticIp"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ElasticIp\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DisassociateElasticIp"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ElasticIp\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DisassociateElasticIp");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ElasticIp\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DisassociateElasticIp"
payload := strings.NewReader("{\n \"ElasticIp\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 21
{
"ElasticIp": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DisassociateElasticIp")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ElasticIp\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DisassociateElasticIp"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ElasticIp\": \"\"\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 \"ElasticIp\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DisassociateElasticIp")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DisassociateElasticIp")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ElasticIp\": \"\"\n}")
.asString();
const data = JSON.stringify({
ElasticIp: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DisassociateElasticIp');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DisassociateElasticIp',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ElasticIp: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DisassociateElasticIp';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ElasticIp":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DisassociateElasticIp',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ElasticIp": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ElasticIp\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DisassociateElasticIp")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({ElasticIp: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DisassociateElasticIp',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {ElasticIp: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DisassociateElasticIp');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ElasticIp: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DisassociateElasticIp',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ElasticIp: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DisassociateElasticIp';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ElasticIp":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"ElasticIp": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DisassociateElasticIp"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DisassociateElasticIp" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"ElasticIp\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DisassociateElasticIp",
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([
'ElasticIp' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DisassociateElasticIp', [
'body' => '{
"ElasticIp": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DisassociateElasticIp');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ElasticIp' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ElasticIp' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DisassociateElasticIp');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DisassociateElasticIp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ElasticIp": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DisassociateElasticIp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ElasticIp": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ElasticIp\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DisassociateElasticIp"
payload = { "ElasticIp": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DisassociateElasticIp"
payload <- "{\n \"ElasticIp\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DisassociateElasticIp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"ElasticIp\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"ElasticIp\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DisassociateElasticIp";
let payload = json!({"ElasticIp": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DisassociateElasticIp' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ElasticIp": ""
}'
echo '{
"ElasticIp": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DisassociateElasticIp' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ElasticIp": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DisassociateElasticIp'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["ElasticIp": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.DisassociateElasticIp")! 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
GetHostnameSuggestion
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GetHostnameSuggestion
HEADERS
X-Amz-Target
BODY json
{
"LayerId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GetHostnameSuggestion");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"LayerId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GetHostnameSuggestion" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:LayerId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GetHostnameSuggestion"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"LayerId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GetHostnameSuggestion"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"LayerId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GetHostnameSuggestion");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"LayerId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GetHostnameSuggestion"
payload := strings.NewReader("{\n \"LayerId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 19
{
"LayerId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GetHostnameSuggestion")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"LayerId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GetHostnameSuggestion"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"LayerId\": \"\"\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 \"LayerId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GetHostnameSuggestion")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GetHostnameSuggestion")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"LayerId\": \"\"\n}")
.asString();
const data = JSON.stringify({
LayerId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GetHostnameSuggestion');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GetHostnameSuggestion',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {LayerId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GetHostnameSuggestion';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"LayerId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GetHostnameSuggestion',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "LayerId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"LayerId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GetHostnameSuggestion")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({LayerId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GetHostnameSuggestion',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {LayerId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GetHostnameSuggestion');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
LayerId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GetHostnameSuggestion',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {LayerId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GetHostnameSuggestion';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"LayerId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"LayerId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GetHostnameSuggestion"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GetHostnameSuggestion" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"LayerId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GetHostnameSuggestion",
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([
'LayerId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GetHostnameSuggestion', [
'body' => '{
"LayerId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GetHostnameSuggestion');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'LayerId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'LayerId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GetHostnameSuggestion');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GetHostnameSuggestion' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"LayerId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GetHostnameSuggestion' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"LayerId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"LayerId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GetHostnameSuggestion"
payload = { "LayerId": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GetHostnameSuggestion"
payload <- "{\n \"LayerId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GetHostnameSuggestion")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"LayerId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"LayerId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GetHostnameSuggestion";
let payload = json!({"LayerId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GetHostnameSuggestion' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"LayerId": ""
}'
echo '{
"LayerId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GetHostnameSuggestion' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "LayerId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GetHostnameSuggestion'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["LayerId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GetHostnameSuggestion")! 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
GrantAccess
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GrantAccess
HEADERS
X-Amz-Target
BODY json
{
"InstanceId": "",
"ValidForInMinutes": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GrantAccess");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"InstanceId\": \"\",\n \"ValidForInMinutes\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GrantAccess" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:InstanceId ""
:ValidForInMinutes ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GrantAccess"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"InstanceId\": \"\",\n \"ValidForInMinutes\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GrantAccess"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"InstanceId\": \"\",\n \"ValidForInMinutes\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GrantAccess");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"InstanceId\": \"\",\n \"ValidForInMinutes\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GrantAccess"
payload := strings.NewReader("{\n \"InstanceId\": \"\",\n \"ValidForInMinutes\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 49
{
"InstanceId": "",
"ValidForInMinutes": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GrantAccess")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"InstanceId\": \"\",\n \"ValidForInMinutes\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GrantAccess"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"InstanceId\": \"\",\n \"ValidForInMinutes\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"InstanceId\": \"\",\n \"ValidForInMinutes\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GrantAccess")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GrantAccess")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"InstanceId\": \"\",\n \"ValidForInMinutes\": \"\"\n}")
.asString();
const data = JSON.stringify({
InstanceId: '',
ValidForInMinutes: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GrantAccess');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GrantAccess',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: '', ValidForInMinutes: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GrantAccess';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":"","ValidForInMinutes":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GrantAccess',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "InstanceId": "",\n "ValidForInMinutes": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"InstanceId\": \"\",\n \"ValidForInMinutes\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GrantAccess")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({InstanceId: '', ValidForInMinutes: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GrantAccess',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {InstanceId: '', ValidForInMinutes: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GrantAccess');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
InstanceId: '',
ValidForInMinutes: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GrantAccess',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: '', ValidForInMinutes: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GrantAccess';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":"","ValidForInMinutes":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"InstanceId": @"",
@"ValidForInMinutes": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GrantAccess"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GrantAccess" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"InstanceId\": \"\",\n \"ValidForInMinutes\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GrantAccess",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'InstanceId' => '',
'ValidForInMinutes' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GrantAccess', [
'body' => '{
"InstanceId": "",
"ValidForInMinutes": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GrantAccess');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'InstanceId' => '',
'ValidForInMinutes' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'InstanceId' => '',
'ValidForInMinutes' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GrantAccess');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GrantAccess' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": "",
"ValidForInMinutes": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GrantAccess' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": "",
"ValidForInMinutes": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"InstanceId\": \"\",\n \"ValidForInMinutes\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GrantAccess"
payload = {
"InstanceId": "",
"ValidForInMinutes": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GrantAccess"
payload <- "{\n \"InstanceId\": \"\",\n \"ValidForInMinutes\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GrantAccess")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"InstanceId\": \"\",\n \"ValidForInMinutes\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"InstanceId\": \"\",\n \"ValidForInMinutes\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GrantAccess";
let payload = json!({
"InstanceId": "",
"ValidForInMinutes": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GrantAccess' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"InstanceId": "",
"ValidForInMinutes": ""
}'
echo '{
"InstanceId": "",
"ValidForInMinutes": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GrantAccess' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "InstanceId": "",\n "ValidForInMinutes": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GrantAccess'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"InstanceId": "",
"ValidForInMinutes": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.GrantAccess")! 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
ListTags
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.ListTags
HEADERS
X-Amz-Target
BODY json
{
"ResourceArn": "",
"MaxResults": "",
"NextToken": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.ListTags");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"ResourceArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.ListTags" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ResourceArn ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.ListTags"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ResourceArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.ListTags"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ResourceArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.ListTags");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ResourceArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.ListTags"
payload := strings.NewReader("{\n \"ResourceArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 62
{
"ResourceArn": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.ListTags")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ResourceArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.ListTags"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ResourceArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"ResourceArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.ListTags")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.ListTags")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ResourceArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
ResourceArn: '',
MaxResults: '',
NextToken: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.ListTags');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.ListTags',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ResourceArn: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.ListTags';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ResourceArn":"","MaxResults":"","NextToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.ListTags',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ResourceArn": "",\n "MaxResults": "",\n "NextToken": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ResourceArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.ListTags")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({ResourceArn: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.ListTags',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {ResourceArn: '', MaxResults: '', NextToken: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.ListTags');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ResourceArn: '',
MaxResults: '',
NextToken: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.ListTags',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ResourceArn: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.ListTags';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ResourceArn":"","MaxResults":"","NextToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"ResourceArn": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.ListTags"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.ListTags" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"ResourceArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.ListTags",
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' => '',
'MaxResults' => '',
'NextToken' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.ListTags', [
'body' => '{
"ResourceArn": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.ListTags');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ResourceArn' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ResourceArn' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.ListTags');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.ListTags' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ResourceArn": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.ListTags' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ResourceArn": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ResourceArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.ListTags"
payload = {
"ResourceArn": "",
"MaxResults": "",
"NextToken": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.ListTags"
payload <- "{\n \"ResourceArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.ListTags")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"ResourceArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"ResourceArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.ListTags";
let payload = json!({
"ResourceArn": "",
"MaxResults": "",
"NextToken": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.ListTags' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ResourceArn": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"ResourceArn": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.ListTags' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ResourceArn": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.ListTags'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"ResourceArn": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.ListTags")! 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
RebootInstance
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RebootInstance
HEADERS
X-Amz-Target
BODY json
{
"InstanceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RebootInstance");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"InstanceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RebootInstance" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:InstanceId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RebootInstance"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"InstanceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RebootInstance"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"InstanceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RebootInstance");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"InstanceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RebootInstance"
payload := strings.NewReader("{\n \"InstanceId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 22
{
"InstanceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RebootInstance")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"InstanceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RebootInstance"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"InstanceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"InstanceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RebootInstance")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RebootInstance")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"InstanceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
InstanceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RebootInstance');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RebootInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RebootInstance';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RebootInstance',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "InstanceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"InstanceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RebootInstance")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({InstanceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RebootInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {InstanceId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RebootInstance');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
InstanceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RebootInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RebootInstance';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"InstanceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RebootInstance"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RebootInstance" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"InstanceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RebootInstance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'InstanceId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RebootInstance', [
'body' => '{
"InstanceId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RebootInstance');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'InstanceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'InstanceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RebootInstance');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RebootInstance' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RebootInstance' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"InstanceId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RebootInstance"
payload = { "InstanceId": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RebootInstance"
payload <- "{\n \"InstanceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RebootInstance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"InstanceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"InstanceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RebootInstance";
let payload = json!({"InstanceId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RebootInstance' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"InstanceId": ""
}'
echo '{
"InstanceId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RebootInstance' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "InstanceId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RebootInstance'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["InstanceId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RebootInstance")! 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
RegisterEcsCluster
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterEcsCluster
HEADERS
X-Amz-Target
BODY json
{
"EcsClusterArn": "",
"StackId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterEcsCluster");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"EcsClusterArn\": \"\",\n \"StackId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterEcsCluster" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:EcsClusterArn ""
:StackId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterEcsCluster"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"EcsClusterArn\": \"\",\n \"StackId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterEcsCluster"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"EcsClusterArn\": \"\",\n \"StackId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterEcsCluster");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"EcsClusterArn\": \"\",\n \"StackId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterEcsCluster"
payload := strings.NewReader("{\n \"EcsClusterArn\": \"\",\n \"StackId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 42
{
"EcsClusterArn": "",
"StackId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterEcsCluster")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"EcsClusterArn\": \"\",\n \"StackId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterEcsCluster"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"EcsClusterArn\": \"\",\n \"StackId\": \"\"\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 \"EcsClusterArn\": \"\",\n \"StackId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterEcsCluster")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterEcsCluster")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"EcsClusterArn\": \"\",\n \"StackId\": \"\"\n}")
.asString();
const data = JSON.stringify({
EcsClusterArn: '',
StackId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterEcsCluster');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterEcsCluster',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {EcsClusterArn: '', StackId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterEcsCluster';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"EcsClusterArn":"","StackId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterEcsCluster',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "EcsClusterArn": "",\n "StackId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"EcsClusterArn\": \"\",\n \"StackId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterEcsCluster")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({EcsClusterArn: '', StackId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterEcsCluster',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {EcsClusterArn: '', StackId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterEcsCluster');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
EcsClusterArn: '',
StackId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterEcsCluster',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {EcsClusterArn: '', StackId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterEcsCluster';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"EcsClusterArn":"","StackId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"EcsClusterArn": @"",
@"StackId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterEcsCluster"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterEcsCluster" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"EcsClusterArn\": \"\",\n \"StackId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterEcsCluster",
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([
'EcsClusterArn' => '',
'StackId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterEcsCluster', [
'body' => '{
"EcsClusterArn": "",
"StackId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterEcsCluster');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'EcsClusterArn' => '',
'StackId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'EcsClusterArn' => '',
'StackId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterEcsCluster');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterEcsCluster' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EcsClusterArn": "",
"StackId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterEcsCluster' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EcsClusterArn": "",
"StackId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"EcsClusterArn\": \"\",\n \"StackId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterEcsCluster"
payload = {
"EcsClusterArn": "",
"StackId": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterEcsCluster"
payload <- "{\n \"EcsClusterArn\": \"\",\n \"StackId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterEcsCluster")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"EcsClusterArn\": \"\",\n \"StackId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"EcsClusterArn\": \"\",\n \"StackId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterEcsCluster";
let payload = json!({
"EcsClusterArn": "",
"StackId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterEcsCluster' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"EcsClusterArn": "",
"StackId": ""
}'
echo '{
"EcsClusterArn": "",
"StackId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterEcsCluster' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "EcsClusterArn": "",\n "StackId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterEcsCluster'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"EcsClusterArn": "",
"StackId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterEcsCluster")! 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
RegisterElasticIp
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterElasticIp
HEADERS
X-Amz-Target
BODY json
{
"ElasticIp": "",
"StackId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterElasticIp");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"ElasticIp\": \"\",\n \"StackId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterElasticIp" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ElasticIp ""
:StackId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterElasticIp"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ElasticIp\": \"\",\n \"StackId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterElasticIp"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ElasticIp\": \"\",\n \"StackId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterElasticIp");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ElasticIp\": \"\",\n \"StackId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterElasticIp"
payload := strings.NewReader("{\n \"ElasticIp\": \"\",\n \"StackId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 38
{
"ElasticIp": "",
"StackId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterElasticIp")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ElasticIp\": \"\",\n \"StackId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterElasticIp"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ElasticIp\": \"\",\n \"StackId\": \"\"\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 \"ElasticIp\": \"\",\n \"StackId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterElasticIp")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterElasticIp")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ElasticIp\": \"\",\n \"StackId\": \"\"\n}")
.asString();
const data = JSON.stringify({
ElasticIp: '',
StackId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterElasticIp');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterElasticIp',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ElasticIp: '', StackId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterElasticIp';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ElasticIp":"","StackId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterElasticIp',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ElasticIp": "",\n "StackId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ElasticIp\": \"\",\n \"StackId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterElasticIp")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({ElasticIp: '', StackId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterElasticIp',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {ElasticIp: '', StackId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterElasticIp');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ElasticIp: '',
StackId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterElasticIp',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ElasticIp: '', StackId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterElasticIp';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ElasticIp":"","StackId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"ElasticIp": @"",
@"StackId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterElasticIp"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterElasticIp" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"ElasticIp\": \"\",\n \"StackId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterElasticIp",
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([
'ElasticIp' => '',
'StackId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterElasticIp', [
'body' => '{
"ElasticIp": "",
"StackId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterElasticIp');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ElasticIp' => '',
'StackId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ElasticIp' => '',
'StackId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterElasticIp');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterElasticIp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ElasticIp": "",
"StackId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterElasticIp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ElasticIp": "",
"StackId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ElasticIp\": \"\",\n \"StackId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterElasticIp"
payload = {
"ElasticIp": "",
"StackId": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterElasticIp"
payload <- "{\n \"ElasticIp\": \"\",\n \"StackId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterElasticIp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"ElasticIp\": \"\",\n \"StackId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"ElasticIp\": \"\",\n \"StackId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterElasticIp";
let payload = json!({
"ElasticIp": "",
"StackId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterElasticIp' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ElasticIp": "",
"StackId": ""
}'
echo '{
"ElasticIp": "",
"StackId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterElasticIp' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ElasticIp": "",\n "StackId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterElasticIp'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"ElasticIp": "",
"StackId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterElasticIp")! 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
RegisterInstance
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterInstance
HEADERS
X-Amz-Target
BODY json
{
"StackId": "",
"Hostname": "",
"PublicIp": "",
"PrivateIp": "",
"RsaPublicKey": "",
"RsaPublicKeyFingerprint": "",
"InstanceIdentity": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterInstance");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"StackId\": \"\",\n \"Hostname\": \"\",\n \"PublicIp\": \"\",\n \"PrivateIp\": \"\",\n \"RsaPublicKey\": \"\",\n \"RsaPublicKeyFingerprint\": \"\",\n \"InstanceIdentity\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterInstance" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:StackId ""
:Hostname ""
:PublicIp ""
:PrivateIp ""
:RsaPublicKey ""
:RsaPublicKeyFingerprint ""
:InstanceIdentity ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterInstance"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"StackId\": \"\",\n \"Hostname\": \"\",\n \"PublicIp\": \"\",\n \"PrivateIp\": \"\",\n \"RsaPublicKey\": \"\",\n \"RsaPublicKeyFingerprint\": \"\",\n \"InstanceIdentity\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterInstance"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"StackId\": \"\",\n \"Hostname\": \"\",\n \"PublicIp\": \"\",\n \"PrivateIp\": \"\",\n \"RsaPublicKey\": \"\",\n \"RsaPublicKeyFingerprint\": \"\",\n \"InstanceIdentity\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterInstance");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"StackId\": \"\",\n \"Hostname\": \"\",\n \"PublicIp\": \"\",\n \"PrivateIp\": \"\",\n \"RsaPublicKey\": \"\",\n \"RsaPublicKeyFingerprint\": \"\",\n \"InstanceIdentity\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterInstance"
payload := strings.NewReader("{\n \"StackId\": \"\",\n \"Hostname\": \"\",\n \"PublicIp\": \"\",\n \"PrivateIp\": \"\",\n \"RsaPublicKey\": \"\",\n \"RsaPublicKeyFingerprint\": \"\",\n \"InstanceIdentity\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 155
{
"StackId": "",
"Hostname": "",
"PublicIp": "",
"PrivateIp": "",
"RsaPublicKey": "",
"RsaPublicKeyFingerprint": "",
"InstanceIdentity": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterInstance")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"StackId\": \"\",\n \"Hostname\": \"\",\n \"PublicIp\": \"\",\n \"PrivateIp\": \"\",\n \"RsaPublicKey\": \"\",\n \"RsaPublicKeyFingerprint\": \"\",\n \"InstanceIdentity\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterInstance"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"StackId\": \"\",\n \"Hostname\": \"\",\n \"PublicIp\": \"\",\n \"PrivateIp\": \"\",\n \"RsaPublicKey\": \"\",\n \"RsaPublicKeyFingerprint\": \"\",\n \"InstanceIdentity\": \"\"\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 \"StackId\": \"\",\n \"Hostname\": \"\",\n \"PublicIp\": \"\",\n \"PrivateIp\": \"\",\n \"RsaPublicKey\": \"\",\n \"RsaPublicKeyFingerprint\": \"\",\n \"InstanceIdentity\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterInstance")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterInstance")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"StackId\": \"\",\n \"Hostname\": \"\",\n \"PublicIp\": \"\",\n \"PrivateIp\": \"\",\n \"RsaPublicKey\": \"\",\n \"RsaPublicKeyFingerprint\": \"\",\n \"InstanceIdentity\": \"\"\n}")
.asString();
const data = JSON.stringify({
StackId: '',
Hostname: '',
PublicIp: '',
PrivateIp: '',
RsaPublicKey: '',
RsaPublicKeyFingerprint: '',
InstanceIdentity: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterInstance');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
StackId: '',
Hostname: '',
PublicIp: '',
PrivateIp: '',
RsaPublicKey: '',
RsaPublicKeyFingerprint: '',
InstanceIdentity: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterInstance';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":"","Hostname":"","PublicIp":"","PrivateIp":"","RsaPublicKey":"","RsaPublicKeyFingerprint":"","InstanceIdentity":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterInstance',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "StackId": "",\n "Hostname": "",\n "PublicIp": "",\n "PrivateIp": "",\n "RsaPublicKey": "",\n "RsaPublicKeyFingerprint": "",\n "InstanceIdentity": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"StackId\": \"\",\n \"Hostname\": \"\",\n \"PublicIp\": \"\",\n \"PrivateIp\": \"\",\n \"RsaPublicKey\": \"\",\n \"RsaPublicKeyFingerprint\": \"\",\n \"InstanceIdentity\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterInstance")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
StackId: '',
Hostname: '',
PublicIp: '',
PrivateIp: '',
RsaPublicKey: '',
RsaPublicKeyFingerprint: '',
InstanceIdentity: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
StackId: '',
Hostname: '',
PublicIp: '',
PrivateIp: '',
RsaPublicKey: '',
RsaPublicKeyFingerprint: '',
InstanceIdentity: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterInstance');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
StackId: '',
Hostname: '',
PublicIp: '',
PrivateIp: '',
RsaPublicKey: '',
RsaPublicKeyFingerprint: '',
InstanceIdentity: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
StackId: '',
Hostname: '',
PublicIp: '',
PrivateIp: '',
RsaPublicKey: '',
RsaPublicKeyFingerprint: '',
InstanceIdentity: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterInstance';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":"","Hostname":"","PublicIp":"","PrivateIp":"","RsaPublicKey":"","RsaPublicKeyFingerprint":"","InstanceIdentity":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"StackId": @"",
@"Hostname": @"",
@"PublicIp": @"",
@"PrivateIp": @"",
@"RsaPublicKey": @"",
@"RsaPublicKeyFingerprint": @"",
@"InstanceIdentity": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterInstance"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterInstance" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"StackId\": \"\",\n \"Hostname\": \"\",\n \"PublicIp\": \"\",\n \"PrivateIp\": \"\",\n \"RsaPublicKey\": \"\",\n \"RsaPublicKeyFingerprint\": \"\",\n \"InstanceIdentity\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterInstance",
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([
'StackId' => '',
'Hostname' => '',
'PublicIp' => '',
'PrivateIp' => '',
'RsaPublicKey' => '',
'RsaPublicKeyFingerprint' => '',
'InstanceIdentity' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterInstance', [
'body' => '{
"StackId": "",
"Hostname": "",
"PublicIp": "",
"PrivateIp": "",
"RsaPublicKey": "",
"RsaPublicKeyFingerprint": "",
"InstanceIdentity": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterInstance');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'StackId' => '',
'Hostname' => '',
'PublicIp' => '',
'PrivateIp' => '',
'RsaPublicKey' => '',
'RsaPublicKeyFingerprint' => '',
'InstanceIdentity' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'StackId' => '',
'Hostname' => '',
'PublicIp' => '',
'PrivateIp' => '',
'RsaPublicKey' => '',
'RsaPublicKeyFingerprint' => '',
'InstanceIdentity' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterInstance');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterInstance' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": "",
"Hostname": "",
"PublicIp": "",
"PrivateIp": "",
"RsaPublicKey": "",
"RsaPublicKeyFingerprint": "",
"InstanceIdentity": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterInstance' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": "",
"Hostname": "",
"PublicIp": "",
"PrivateIp": "",
"RsaPublicKey": "",
"RsaPublicKeyFingerprint": "",
"InstanceIdentity": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"StackId\": \"\",\n \"Hostname\": \"\",\n \"PublicIp\": \"\",\n \"PrivateIp\": \"\",\n \"RsaPublicKey\": \"\",\n \"RsaPublicKeyFingerprint\": \"\",\n \"InstanceIdentity\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterInstance"
payload = {
"StackId": "",
"Hostname": "",
"PublicIp": "",
"PrivateIp": "",
"RsaPublicKey": "",
"RsaPublicKeyFingerprint": "",
"InstanceIdentity": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterInstance"
payload <- "{\n \"StackId\": \"\",\n \"Hostname\": \"\",\n \"PublicIp\": \"\",\n \"PrivateIp\": \"\",\n \"RsaPublicKey\": \"\",\n \"RsaPublicKeyFingerprint\": \"\",\n \"InstanceIdentity\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterInstance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"StackId\": \"\",\n \"Hostname\": \"\",\n \"PublicIp\": \"\",\n \"PrivateIp\": \"\",\n \"RsaPublicKey\": \"\",\n \"RsaPublicKeyFingerprint\": \"\",\n \"InstanceIdentity\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"StackId\": \"\",\n \"Hostname\": \"\",\n \"PublicIp\": \"\",\n \"PrivateIp\": \"\",\n \"RsaPublicKey\": \"\",\n \"RsaPublicKeyFingerprint\": \"\",\n \"InstanceIdentity\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterInstance";
let payload = json!({
"StackId": "",
"Hostname": "",
"PublicIp": "",
"PrivateIp": "",
"RsaPublicKey": "",
"RsaPublicKeyFingerprint": "",
"InstanceIdentity": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterInstance' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"StackId": "",
"Hostname": "",
"PublicIp": "",
"PrivateIp": "",
"RsaPublicKey": "",
"RsaPublicKeyFingerprint": "",
"InstanceIdentity": ""
}'
echo '{
"StackId": "",
"Hostname": "",
"PublicIp": "",
"PrivateIp": "",
"RsaPublicKey": "",
"RsaPublicKeyFingerprint": "",
"InstanceIdentity": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterInstance' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "StackId": "",\n "Hostname": "",\n "PublicIp": "",\n "PrivateIp": "",\n "RsaPublicKey": "",\n "RsaPublicKeyFingerprint": "",\n "InstanceIdentity": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterInstance'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"StackId": "",
"Hostname": "",
"PublicIp": "",
"PrivateIp": "",
"RsaPublicKey": "",
"RsaPublicKeyFingerprint": "",
"InstanceIdentity": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterInstance")! 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
RegisterRdsDbInstance
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterRdsDbInstance
HEADERS
X-Amz-Target
BODY json
{
"StackId": "",
"RdsDbInstanceArn": "",
"DbUser": "",
"DbPassword": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterRdsDbInstance");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"StackId\": \"\",\n \"RdsDbInstanceArn\": \"\",\n \"DbUser\": \"\",\n \"DbPassword\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterRdsDbInstance" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:StackId ""
:RdsDbInstanceArn ""
:DbUser ""
:DbPassword ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterRdsDbInstance"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"StackId\": \"\",\n \"RdsDbInstanceArn\": \"\",\n \"DbUser\": \"\",\n \"DbPassword\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterRdsDbInstance"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"StackId\": \"\",\n \"RdsDbInstanceArn\": \"\",\n \"DbUser\": \"\",\n \"DbPassword\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterRdsDbInstance");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"StackId\": \"\",\n \"RdsDbInstanceArn\": \"\",\n \"DbUser\": \"\",\n \"DbPassword\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterRdsDbInstance"
payload := strings.NewReader("{\n \"StackId\": \"\",\n \"RdsDbInstanceArn\": \"\",\n \"DbUser\": \"\",\n \"DbPassword\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 81
{
"StackId": "",
"RdsDbInstanceArn": "",
"DbUser": "",
"DbPassword": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterRdsDbInstance")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"StackId\": \"\",\n \"RdsDbInstanceArn\": \"\",\n \"DbUser\": \"\",\n \"DbPassword\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterRdsDbInstance"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"StackId\": \"\",\n \"RdsDbInstanceArn\": \"\",\n \"DbUser\": \"\",\n \"DbPassword\": \"\"\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 \"StackId\": \"\",\n \"RdsDbInstanceArn\": \"\",\n \"DbUser\": \"\",\n \"DbPassword\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterRdsDbInstance")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterRdsDbInstance")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"StackId\": \"\",\n \"RdsDbInstanceArn\": \"\",\n \"DbUser\": \"\",\n \"DbPassword\": \"\"\n}")
.asString();
const data = JSON.stringify({
StackId: '',
RdsDbInstanceArn: '',
DbUser: '',
DbPassword: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterRdsDbInstance');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterRdsDbInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {StackId: '', RdsDbInstanceArn: '', DbUser: '', DbPassword: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterRdsDbInstance';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":"","RdsDbInstanceArn":"","DbUser":"","DbPassword":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterRdsDbInstance',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "StackId": "",\n "RdsDbInstanceArn": "",\n "DbUser": "",\n "DbPassword": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"StackId\": \"\",\n \"RdsDbInstanceArn\": \"\",\n \"DbUser\": \"\",\n \"DbPassword\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterRdsDbInstance")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({StackId: '', RdsDbInstanceArn: '', DbUser: '', DbPassword: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterRdsDbInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {StackId: '', RdsDbInstanceArn: '', DbUser: '', DbPassword: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterRdsDbInstance');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
StackId: '',
RdsDbInstanceArn: '',
DbUser: '',
DbPassword: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterRdsDbInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {StackId: '', RdsDbInstanceArn: '', DbUser: '', DbPassword: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterRdsDbInstance';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":"","RdsDbInstanceArn":"","DbUser":"","DbPassword":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"StackId": @"",
@"RdsDbInstanceArn": @"",
@"DbUser": @"",
@"DbPassword": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterRdsDbInstance"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterRdsDbInstance" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"StackId\": \"\",\n \"RdsDbInstanceArn\": \"\",\n \"DbUser\": \"\",\n \"DbPassword\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterRdsDbInstance",
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([
'StackId' => '',
'RdsDbInstanceArn' => '',
'DbUser' => '',
'DbPassword' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterRdsDbInstance', [
'body' => '{
"StackId": "",
"RdsDbInstanceArn": "",
"DbUser": "",
"DbPassword": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterRdsDbInstance');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'StackId' => '',
'RdsDbInstanceArn' => '',
'DbUser' => '',
'DbPassword' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'StackId' => '',
'RdsDbInstanceArn' => '',
'DbUser' => '',
'DbPassword' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterRdsDbInstance');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterRdsDbInstance' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": "",
"RdsDbInstanceArn": "",
"DbUser": "",
"DbPassword": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterRdsDbInstance' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": "",
"RdsDbInstanceArn": "",
"DbUser": "",
"DbPassword": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"StackId\": \"\",\n \"RdsDbInstanceArn\": \"\",\n \"DbUser\": \"\",\n \"DbPassword\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterRdsDbInstance"
payload = {
"StackId": "",
"RdsDbInstanceArn": "",
"DbUser": "",
"DbPassword": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterRdsDbInstance"
payload <- "{\n \"StackId\": \"\",\n \"RdsDbInstanceArn\": \"\",\n \"DbUser\": \"\",\n \"DbPassword\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterRdsDbInstance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"StackId\": \"\",\n \"RdsDbInstanceArn\": \"\",\n \"DbUser\": \"\",\n \"DbPassword\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"StackId\": \"\",\n \"RdsDbInstanceArn\": \"\",\n \"DbUser\": \"\",\n \"DbPassword\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterRdsDbInstance";
let payload = json!({
"StackId": "",
"RdsDbInstanceArn": "",
"DbUser": "",
"DbPassword": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterRdsDbInstance' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"StackId": "",
"RdsDbInstanceArn": "",
"DbUser": "",
"DbPassword": ""
}'
echo '{
"StackId": "",
"RdsDbInstanceArn": "",
"DbUser": "",
"DbPassword": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterRdsDbInstance' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "StackId": "",\n "RdsDbInstanceArn": "",\n "DbUser": "",\n "DbPassword": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterRdsDbInstance'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"StackId": "",
"RdsDbInstanceArn": "",
"DbUser": "",
"DbPassword": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterRdsDbInstance")! 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
RegisterVolume
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterVolume
HEADERS
X-Amz-Target
BODY json
{
"Ec2VolumeId": "",
"StackId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterVolume");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"Ec2VolumeId\": \"\",\n \"StackId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterVolume" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Ec2VolumeId ""
:StackId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterVolume"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Ec2VolumeId\": \"\",\n \"StackId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterVolume"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Ec2VolumeId\": \"\",\n \"StackId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterVolume");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Ec2VolumeId\": \"\",\n \"StackId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterVolume"
payload := strings.NewReader("{\n \"Ec2VolumeId\": \"\",\n \"StackId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 40
{
"Ec2VolumeId": "",
"StackId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterVolume")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Ec2VolumeId\": \"\",\n \"StackId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterVolume"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Ec2VolumeId\": \"\",\n \"StackId\": \"\"\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 \"Ec2VolumeId\": \"\",\n \"StackId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterVolume")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterVolume")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Ec2VolumeId\": \"\",\n \"StackId\": \"\"\n}")
.asString();
const data = JSON.stringify({
Ec2VolumeId: '',
StackId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterVolume');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterVolume',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Ec2VolumeId: '', StackId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterVolume';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Ec2VolumeId":"","StackId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterVolume',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Ec2VolumeId": "",\n "StackId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Ec2VolumeId\": \"\",\n \"StackId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterVolume")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({Ec2VolumeId: '', StackId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterVolume',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Ec2VolumeId: '', StackId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterVolume');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Ec2VolumeId: '',
StackId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterVolume',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Ec2VolumeId: '', StackId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterVolume';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Ec2VolumeId":"","StackId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"Ec2VolumeId": @"",
@"StackId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterVolume"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterVolume" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Ec2VolumeId\": \"\",\n \"StackId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterVolume",
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([
'Ec2VolumeId' => '',
'StackId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterVolume', [
'body' => '{
"Ec2VolumeId": "",
"StackId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterVolume');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Ec2VolumeId' => '',
'StackId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Ec2VolumeId' => '',
'StackId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterVolume');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterVolume' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Ec2VolumeId": "",
"StackId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterVolume' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Ec2VolumeId": "",
"StackId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Ec2VolumeId\": \"\",\n \"StackId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterVolume"
payload = {
"Ec2VolumeId": "",
"StackId": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterVolume"
payload <- "{\n \"Ec2VolumeId\": \"\",\n \"StackId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterVolume")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"Ec2VolumeId\": \"\",\n \"StackId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"Ec2VolumeId\": \"\",\n \"StackId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterVolume";
let payload = json!({
"Ec2VolumeId": "",
"StackId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterVolume' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Ec2VolumeId": "",
"StackId": ""
}'
echo '{
"Ec2VolumeId": "",
"StackId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterVolume' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Ec2VolumeId": "",\n "StackId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterVolume'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Ec2VolumeId": "",
"StackId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.RegisterVolume")! 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
SetLoadBasedAutoScaling
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetLoadBasedAutoScaling
HEADERS
X-Amz-Target
BODY json
{
"LayerId": "",
"Enable": "",
"UpScaling": "",
"DownScaling": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetLoadBasedAutoScaling");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"LayerId\": \"\",\n \"Enable\": \"\",\n \"UpScaling\": \"\",\n \"DownScaling\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetLoadBasedAutoScaling" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:LayerId ""
:Enable ""
:UpScaling ""
:DownScaling ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetLoadBasedAutoScaling"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"LayerId\": \"\",\n \"Enable\": \"\",\n \"UpScaling\": \"\",\n \"DownScaling\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetLoadBasedAutoScaling"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"LayerId\": \"\",\n \"Enable\": \"\",\n \"UpScaling\": \"\",\n \"DownScaling\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetLoadBasedAutoScaling");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"LayerId\": \"\",\n \"Enable\": \"\",\n \"UpScaling\": \"\",\n \"DownScaling\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetLoadBasedAutoScaling"
payload := strings.NewReader("{\n \"LayerId\": \"\",\n \"Enable\": \"\",\n \"UpScaling\": \"\",\n \"DownScaling\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 75
{
"LayerId": "",
"Enable": "",
"UpScaling": "",
"DownScaling": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetLoadBasedAutoScaling")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"LayerId\": \"\",\n \"Enable\": \"\",\n \"UpScaling\": \"\",\n \"DownScaling\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetLoadBasedAutoScaling"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"LayerId\": \"\",\n \"Enable\": \"\",\n \"UpScaling\": \"\",\n \"DownScaling\": \"\"\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 \"LayerId\": \"\",\n \"Enable\": \"\",\n \"UpScaling\": \"\",\n \"DownScaling\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetLoadBasedAutoScaling")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetLoadBasedAutoScaling")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"LayerId\": \"\",\n \"Enable\": \"\",\n \"UpScaling\": \"\",\n \"DownScaling\": \"\"\n}")
.asString();
const data = JSON.stringify({
LayerId: '',
Enable: '',
UpScaling: '',
DownScaling: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetLoadBasedAutoScaling');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetLoadBasedAutoScaling',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {LayerId: '', Enable: '', UpScaling: '', DownScaling: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetLoadBasedAutoScaling';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"LayerId":"","Enable":"","UpScaling":"","DownScaling":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetLoadBasedAutoScaling',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "LayerId": "",\n "Enable": "",\n "UpScaling": "",\n "DownScaling": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"LayerId\": \"\",\n \"Enable\": \"\",\n \"UpScaling\": \"\",\n \"DownScaling\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetLoadBasedAutoScaling")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({LayerId: '', Enable: '', UpScaling: '', DownScaling: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetLoadBasedAutoScaling',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {LayerId: '', Enable: '', UpScaling: '', DownScaling: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetLoadBasedAutoScaling');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
LayerId: '',
Enable: '',
UpScaling: '',
DownScaling: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetLoadBasedAutoScaling',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {LayerId: '', Enable: '', UpScaling: '', DownScaling: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetLoadBasedAutoScaling';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"LayerId":"","Enable":"","UpScaling":"","DownScaling":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"LayerId": @"",
@"Enable": @"",
@"UpScaling": @"",
@"DownScaling": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetLoadBasedAutoScaling"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetLoadBasedAutoScaling" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"LayerId\": \"\",\n \"Enable\": \"\",\n \"UpScaling\": \"\",\n \"DownScaling\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetLoadBasedAutoScaling",
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([
'LayerId' => '',
'Enable' => '',
'UpScaling' => '',
'DownScaling' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetLoadBasedAutoScaling', [
'body' => '{
"LayerId": "",
"Enable": "",
"UpScaling": "",
"DownScaling": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetLoadBasedAutoScaling');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'LayerId' => '',
'Enable' => '',
'UpScaling' => '',
'DownScaling' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'LayerId' => '',
'Enable' => '',
'UpScaling' => '',
'DownScaling' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetLoadBasedAutoScaling');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetLoadBasedAutoScaling' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"LayerId": "",
"Enable": "",
"UpScaling": "",
"DownScaling": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetLoadBasedAutoScaling' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"LayerId": "",
"Enable": "",
"UpScaling": "",
"DownScaling": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"LayerId\": \"\",\n \"Enable\": \"\",\n \"UpScaling\": \"\",\n \"DownScaling\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetLoadBasedAutoScaling"
payload = {
"LayerId": "",
"Enable": "",
"UpScaling": "",
"DownScaling": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetLoadBasedAutoScaling"
payload <- "{\n \"LayerId\": \"\",\n \"Enable\": \"\",\n \"UpScaling\": \"\",\n \"DownScaling\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetLoadBasedAutoScaling")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"LayerId\": \"\",\n \"Enable\": \"\",\n \"UpScaling\": \"\",\n \"DownScaling\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"LayerId\": \"\",\n \"Enable\": \"\",\n \"UpScaling\": \"\",\n \"DownScaling\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetLoadBasedAutoScaling";
let payload = json!({
"LayerId": "",
"Enable": "",
"UpScaling": "",
"DownScaling": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetLoadBasedAutoScaling' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"LayerId": "",
"Enable": "",
"UpScaling": "",
"DownScaling": ""
}'
echo '{
"LayerId": "",
"Enable": "",
"UpScaling": "",
"DownScaling": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetLoadBasedAutoScaling' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "LayerId": "",\n "Enable": "",\n "UpScaling": "",\n "DownScaling": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetLoadBasedAutoScaling'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"LayerId": "",
"Enable": "",
"UpScaling": "",
"DownScaling": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetLoadBasedAutoScaling")! 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
SetPermission
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetPermission
HEADERS
X-Amz-Target
BODY json
{
"StackId": "",
"IamUserArn": "",
"AllowSsh": "",
"AllowSudo": "",
"Level": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetPermission");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"StackId\": \"\",\n \"IamUserArn\": \"\",\n \"AllowSsh\": \"\",\n \"AllowSudo\": \"\",\n \"Level\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetPermission" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:StackId ""
:IamUserArn ""
:AllowSsh ""
:AllowSudo ""
:Level ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetPermission"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"StackId\": \"\",\n \"IamUserArn\": \"\",\n \"AllowSsh\": \"\",\n \"AllowSudo\": \"\",\n \"Level\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetPermission"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"StackId\": \"\",\n \"IamUserArn\": \"\",\n \"AllowSsh\": \"\",\n \"AllowSudo\": \"\",\n \"Level\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetPermission");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"StackId\": \"\",\n \"IamUserArn\": \"\",\n \"AllowSsh\": \"\",\n \"AllowSudo\": \"\",\n \"Level\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetPermission"
payload := strings.NewReader("{\n \"StackId\": \"\",\n \"IamUserArn\": \"\",\n \"AllowSsh\": \"\",\n \"AllowSudo\": \"\",\n \"Level\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 91
{
"StackId": "",
"IamUserArn": "",
"AllowSsh": "",
"AllowSudo": "",
"Level": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetPermission")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"StackId\": \"\",\n \"IamUserArn\": \"\",\n \"AllowSsh\": \"\",\n \"AllowSudo\": \"\",\n \"Level\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetPermission"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"StackId\": \"\",\n \"IamUserArn\": \"\",\n \"AllowSsh\": \"\",\n \"AllowSudo\": \"\",\n \"Level\": \"\"\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 \"StackId\": \"\",\n \"IamUserArn\": \"\",\n \"AllowSsh\": \"\",\n \"AllowSudo\": \"\",\n \"Level\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetPermission")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetPermission")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"StackId\": \"\",\n \"IamUserArn\": \"\",\n \"AllowSsh\": \"\",\n \"AllowSudo\": \"\",\n \"Level\": \"\"\n}")
.asString();
const data = JSON.stringify({
StackId: '',
IamUserArn: '',
AllowSsh: '',
AllowSudo: '',
Level: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetPermission');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetPermission',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {StackId: '', IamUserArn: '', AllowSsh: '', AllowSudo: '', Level: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetPermission';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":"","IamUserArn":"","AllowSsh":"","AllowSudo":"","Level":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetPermission',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "StackId": "",\n "IamUserArn": "",\n "AllowSsh": "",\n "AllowSudo": "",\n "Level": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"StackId\": \"\",\n \"IamUserArn\": \"\",\n \"AllowSsh\": \"\",\n \"AllowSudo\": \"\",\n \"Level\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetPermission")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({StackId: '', IamUserArn: '', AllowSsh: '', AllowSudo: '', Level: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetPermission',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {StackId: '', IamUserArn: '', AllowSsh: '', AllowSudo: '', Level: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetPermission');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
StackId: '',
IamUserArn: '',
AllowSsh: '',
AllowSudo: '',
Level: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetPermission',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {StackId: '', IamUserArn: '', AllowSsh: '', AllowSudo: '', Level: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetPermission';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":"","IamUserArn":"","AllowSsh":"","AllowSudo":"","Level":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"StackId": @"",
@"IamUserArn": @"",
@"AllowSsh": @"",
@"AllowSudo": @"",
@"Level": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetPermission"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetPermission" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"StackId\": \"\",\n \"IamUserArn\": \"\",\n \"AllowSsh\": \"\",\n \"AllowSudo\": \"\",\n \"Level\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetPermission",
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([
'StackId' => '',
'IamUserArn' => '',
'AllowSsh' => '',
'AllowSudo' => '',
'Level' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetPermission', [
'body' => '{
"StackId": "",
"IamUserArn": "",
"AllowSsh": "",
"AllowSudo": "",
"Level": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetPermission');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'StackId' => '',
'IamUserArn' => '',
'AllowSsh' => '',
'AllowSudo' => '',
'Level' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'StackId' => '',
'IamUserArn' => '',
'AllowSsh' => '',
'AllowSudo' => '',
'Level' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetPermission');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetPermission' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": "",
"IamUserArn": "",
"AllowSsh": "",
"AllowSudo": "",
"Level": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetPermission' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": "",
"IamUserArn": "",
"AllowSsh": "",
"AllowSudo": "",
"Level": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"StackId\": \"\",\n \"IamUserArn\": \"\",\n \"AllowSsh\": \"\",\n \"AllowSudo\": \"\",\n \"Level\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetPermission"
payload = {
"StackId": "",
"IamUserArn": "",
"AllowSsh": "",
"AllowSudo": "",
"Level": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetPermission"
payload <- "{\n \"StackId\": \"\",\n \"IamUserArn\": \"\",\n \"AllowSsh\": \"\",\n \"AllowSudo\": \"\",\n \"Level\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetPermission")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"StackId\": \"\",\n \"IamUserArn\": \"\",\n \"AllowSsh\": \"\",\n \"AllowSudo\": \"\",\n \"Level\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"StackId\": \"\",\n \"IamUserArn\": \"\",\n \"AllowSsh\": \"\",\n \"AllowSudo\": \"\",\n \"Level\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetPermission";
let payload = json!({
"StackId": "",
"IamUserArn": "",
"AllowSsh": "",
"AllowSudo": "",
"Level": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetPermission' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"StackId": "",
"IamUserArn": "",
"AllowSsh": "",
"AllowSudo": "",
"Level": ""
}'
echo '{
"StackId": "",
"IamUserArn": "",
"AllowSsh": "",
"AllowSudo": "",
"Level": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetPermission' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "StackId": "",\n "IamUserArn": "",\n "AllowSsh": "",\n "AllowSudo": "",\n "Level": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetPermission'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"StackId": "",
"IamUserArn": "",
"AllowSsh": "",
"AllowSudo": "",
"Level": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetPermission")! 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
SetTimeBasedAutoScaling
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetTimeBasedAutoScaling
HEADERS
X-Amz-Target
BODY json
{
"InstanceId": "",
"AutoScalingSchedule": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetTimeBasedAutoScaling");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"InstanceId\": \"\",\n \"AutoScalingSchedule\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetTimeBasedAutoScaling" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:InstanceId ""
:AutoScalingSchedule ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetTimeBasedAutoScaling"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"InstanceId\": \"\",\n \"AutoScalingSchedule\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetTimeBasedAutoScaling"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"InstanceId\": \"\",\n \"AutoScalingSchedule\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetTimeBasedAutoScaling");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"InstanceId\": \"\",\n \"AutoScalingSchedule\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetTimeBasedAutoScaling"
payload := strings.NewReader("{\n \"InstanceId\": \"\",\n \"AutoScalingSchedule\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 51
{
"InstanceId": "",
"AutoScalingSchedule": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetTimeBasedAutoScaling")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"InstanceId\": \"\",\n \"AutoScalingSchedule\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetTimeBasedAutoScaling"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"InstanceId\": \"\",\n \"AutoScalingSchedule\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"InstanceId\": \"\",\n \"AutoScalingSchedule\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetTimeBasedAutoScaling")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetTimeBasedAutoScaling")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"InstanceId\": \"\",\n \"AutoScalingSchedule\": \"\"\n}")
.asString();
const data = JSON.stringify({
InstanceId: '',
AutoScalingSchedule: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetTimeBasedAutoScaling');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetTimeBasedAutoScaling',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: '', AutoScalingSchedule: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetTimeBasedAutoScaling';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":"","AutoScalingSchedule":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetTimeBasedAutoScaling',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "InstanceId": "",\n "AutoScalingSchedule": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"InstanceId\": \"\",\n \"AutoScalingSchedule\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetTimeBasedAutoScaling")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({InstanceId: '', AutoScalingSchedule: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetTimeBasedAutoScaling',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {InstanceId: '', AutoScalingSchedule: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetTimeBasedAutoScaling');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
InstanceId: '',
AutoScalingSchedule: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetTimeBasedAutoScaling',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: '', AutoScalingSchedule: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetTimeBasedAutoScaling';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":"","AutoScalingSchedule":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"InstanceId": @"",
@"AutoScalingSchedule": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetTimeBasedAutoScaling"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetTimeBasedAutoScaling" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"InstanceId\": \"\",\n \"AutoScalingSchedule\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetTimeBasedAutoScaling",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'InstanceId' => '',
'AutoScalingSchedule' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetTimeBasedAutoScaling', [
'body' => '{
"InstanceId": "",
"AutoScalingSchedule": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetTimeBasedAutoScaling');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'InstanceId' => '',
'AutoScalingSchedule' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'InstanceId' => '',
'AutoScalingSchedule' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetTimeBasedAutoScaling');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetTimeBasedAutoScaling' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": "",
"AutoScalingSchedule": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetTimeBasedAutoScaling' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": "",
"AutoScalingSchedule": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"InstanceId\": \"\",\n \"AutoScalingSchedule\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetTimeBasedAutoScaling"
payload = {
"InstanceId": "",
"AutoScalingSchedule": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetTimeBasedAutoScaling"
payload <- "{\n \"InstanceId\": \"\",\n \"AutoScalingSchedule\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetTimeBasedAutoScaling")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"InstanceId\": \"\",\n \"AutoScalingSchedule\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"InstanceId\": \"\",\n \"AutoScalingSchedule\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetTimeBasedAutoScaling";
let payload = json!({
"InstanceId": "",
"AutoScalingSchedule": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetTimeBasedAutoScaling' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"InstanceId": "",
"AutoScalingSchedule": ""
}'
echo '{
"InstanceId": "",
"AutoScalingSchedule": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetTimeBasedAutoScaling' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "InstanceId": "",\n "AutoScalingSchedule": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetTimeBasedAutoScaling'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"InstanceId": "",
"AutoScalingSchedule": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.SetTimeBasedAutoScaling")! 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
StartInstance
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartInstance
HEADERS
X-Amz-Target
BODY json
{
"InstanceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartInstance");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"InstanceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartInstance" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:InstanceId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartInstance"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"InstanceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartInstance"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"InstanceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartInstance");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"InstanceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartInstance"
payload := strings.NewReader("{\n \"InstanceId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 22
{
"InstanceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartInstance")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"InstanceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartInstance"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"InstanceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"InstanceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartInstance")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartInstance")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"InstanceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
InstanceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartInstance');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartInstance';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartInstance',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "InstanceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"InstanceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartInstance")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({InstanceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {InstanceId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartInstance');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
InstanceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartInstance';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"InstanceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartInstance"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartInstance" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"InstanceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartInstance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'InstanceId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartInstance', [
'body' => '{
"InstanceId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartInstance');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'InstanceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'InstanceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartInstance');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartInstance' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartInstance' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"InstanceId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartInstance"
payload = { "InstanceId": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartInstance"
payload <- "{\n \"InstanceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartInstance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"InstanceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"InstanceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartInstance";
let payload = json!({"InstanceId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartInstance' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"InstanceId": ""
}'
echo '{
"InstanceId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartInstance' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "InstanceId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartInstance'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["InstanceId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartInstance")! 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
StartStack
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartStack
HEADERS
X-Amz-Target
BODY json
{
"StackId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartStack");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"StackId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartStack" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:StackId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartStack"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"StackId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartStack"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"StackId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartStack");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"StackId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartStack"
payload := strings.NewReader("{\n \"StackId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 19
{
"StackId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartStack")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"StackId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartStack"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"StackId\": \"\"\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 \"StackId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartStack")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartStack")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"StackId\": \"\"\n}")
.asString();
const data = JSON.stringify({
StackId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartStack');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartStack',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {StackId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartStack';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartStack',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "StackId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"StackId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartStack")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({StackId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartStack',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {StackId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartStack');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
StackId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartStack',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {StackId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartStack';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"StackId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartStack"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartStack" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"StackId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartStack",
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([
'StackId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartStack', [
'body' => '{
"StackId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartStack');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'StackId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'StackId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartStack');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartStack' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartStack' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"StackId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartStack"
payload = { "StackId": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartStack"
payload <- "{\n \"StackId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartStack")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"StackId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"StackId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartStack";
let payload = json!({"StackId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartStack' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"StackId": ""
}'
echo '{
"StackId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartStack' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "StackId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartStack'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["StackId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StartStack")! 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
StopInstance
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopInstance
HEADERS
X-Amz-Target
BODY json
{
"InstanceId": "",
"Force": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopInstance");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"InstanceId\": \"\",\n \"Force\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopInstance" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:InstanceId ""
:Force ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopInstance"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"InstanceId\": \"\",\n \"Force\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopInstance"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"InstanceId\": \"\",\n \"Force\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopInstance");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"InstanceId\": \"\",\n \"Force\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopInstance"
payload := strings.NewReader("{\n \"InstanceId\": \"\",\n \"Force\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 37
{
"InstanceId": "",
"Force": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopInstance")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"InstanceId\": \"\",\n \"Force\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopInstance"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"InstanceId\": \"\",\n \"Force\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"InstanceId\": \"\",\n \"Force\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopInstance")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopInstance")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"InstanceId\": \"\",\n \"Force\": \"\"\n}")
.asString();
const data = JSON.stringify({
InstanceId: '',
Force: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopInstance');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: '', Force: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopInstance';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":"","Force":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopInstance',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "InstanceId": "",\n "Force": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"InstanceId\": \"\",\n \"Force\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopInstance")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({InstanceId: '', Force: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {InstanceId: '', Force: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopInstance');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
InstanceId: '',
Force: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: '', Force: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopInstance';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":"","Force":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"InstanceId": @"",
@"Force": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopInstance"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopInstance" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"InstanceId\": \"\",\n \"Force\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopInstance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'InstanceId' => '',
'Force' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopInstance', [
'body' => '{
"InstanceId": "",
"Force": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopInstance');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'InstanceId' => '',
'Force' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'InstanceId' => '',
'Force' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopInstance');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopInstance' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": "",
"Force": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopInstance' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": "",
"Force": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"InstanceId\": \"\",\n \"Force\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopInstance"
payload = {
"InstanceId": "",
"Force": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopInstance"
payload <- "{\n \"InstanceId\": \"\",\n \"Force\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopInstance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"InstanceId\": \"\",\n \"Force\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"InstanceId\": \"\",\n \"Force\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopInstance";
let payload = json!({
"InstanceId": "",
"Force": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopInstance' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"InstanceId": "",
"Force": ""
}'
echo '{
"InstanceId": "",
"Force": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopInstance' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "InstanceId": "",\n "Force": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopInstance'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"InstanceId": "",
"Force": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopInstance")! 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
StopStack
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopStack
HEADERS
X-Amz-Target
BODY json
{
"StackId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopStack");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"StackId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopStack" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:StackId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopStack"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"StackId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopStack"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"StackId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopStack");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"StackId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopStack"
payload := strings.NewReader("{\n \"StackId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 19
{
"StackId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopStack")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"StackId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopStack"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"StackId\": \"\"\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 \"StackId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopStack")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopStack")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"StackId\": \"\"\n}")
.asString();
const data = JSON.stringify({
StackId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopStack');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopStack',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {StackId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopStack';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopStack',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "StackId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"StackId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopStack")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({StackId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopStack',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {StackId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopStack');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
StackId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopStack',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {StackId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopStack';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"StackId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopStack"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopStack" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"StackId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopStack",
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([
'StackId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopStack', [
'body' => '{
"StackId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopStack');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'StackId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'StackId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopStack');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopStack' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopStack' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"StackId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopStack"
payload = { "StackId": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopStack"
payload <- "{\n \"StackId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopStack")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"StackId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"StackId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopStack";
let payload = json!({"StackId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopStack' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"StackId": ""
}'
echo '{
"StackId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopStack' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "StackId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopStack'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["StackId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.StopStack")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
TagResource
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.TagResource
HEADERS
X-Amz-Target
BODY json
{
"ResourceArn": "",
"Tags": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.TagResource");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"ResourceArn\": \"\",\n \"Tags\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.TagResource" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ResourceArn ""
:Tags ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.TagResource"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ResourceArn\": \"\",\n \"Tags\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.TagResource"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ResourceArn\": \"\",\n \"Tags\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.TagResource");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ResourceArn\": \"\",\n \"Tags\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.TagResource"
payload := strings.NewReader("{\n \"ResourceArn\": \"\",\n \"Tags\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 37
{
"ResourceArn": "",
"Tags": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.TagResource")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ResourceArn\": \"\",\n \"Tags\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.TagResource"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ResourceArn\": \"\",\n \"Tags\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"ResourceArn\": \"\",\n \"Tags\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.TagResource")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.TagResource")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ResourceArn\": \"\",\n \"Tags\": \"\"\n}")
.asString();
const data = JSON.stringify({
ResourceArn: '',
Tags: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.TagResource');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.TagResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ResourceArn: '', Tags: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.TagResource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ResourceArn":"","Tags":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.TagResource',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ResourceArn": "",\n "Tags": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ResourceArn\": \"\",\n \"Tags\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.TagResource")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({ResourceArn: '', Tags: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.TagResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {ResourceArn: '', Tags: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.TagResource');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ResourceArn: '',
Tags: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.TagResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ResourceArn: '', Tags: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.TagResource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ResourceArn":"","Tags":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"ResourceArn": @"",
@"Tags": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.TagResource"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.TagResource" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"ResourceArn\": \"\",\n \"Tags\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.TagResource",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ResourceArn' => '',
'Tags' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.TagResource', [
'body' => '{
"ResourceArn": "",
"Tags": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.TagResource');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ResourceArn' => '',
'Tags' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ResourceArn' => '',
'Tags' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.TagResource');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.TagResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ResourceArn": "",
"Tags": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.TagResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ResourceArn": "",
"Tags": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ResourceArn\": \"\",\n \"Tags\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.TagResource"
payload = {
"ResourceArn": "",
"Tags": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.TagResource"
payload <- "{\n \"ResourceArn\": \"\",\n \"Tags\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.TagResource")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"ResourceArn\": \"\",\n \"Tags\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"ResourceArn\": \"\",\n \"Tags\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.TagResource";
let payload = json!({
"ResourceArn": "",
"Tags": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.TagResource' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ResourceArn": "",
"Tags": ""
}'
echo '{
"ResourceArn": "",
"Tags": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.TagResource' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ResourceArn": "",\n "Tags": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.TagResource'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"ResourceArn": "",
"Tags": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.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
UnassignInstance
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignInstance
HEADERS
X-Amz-Target
BODY json
{
"InstanceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignInstance");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"InstanceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignInstance" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:InstanceId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignInstance"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"InstanceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignInstance"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"InstanceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignInstance");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"InstanceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignInstance"
payload := strings.NewReader("{\n \"InstanceId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 22
{
"InstanceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignInstance")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"InstanceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignInstance"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"InstanceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"InstanceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignInstance")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignInstance")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"InstanceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
InstanceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignInstance');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignInstance';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignInstance',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "InstanceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"InstanceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignInstance")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({InstanceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {InstanceId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignInstance');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
InstanceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {InstanceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignInstance';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"InstanceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignInstance"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignInstance" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"InstanceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignInstance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'InstanceId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignInstance', [
'body' => '{
"InstanceId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignInstance');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'InstanceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'InstanceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignInstance');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignInstance' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignInstance' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"InstanceId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignInstance"
payload = { "InstanceId": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignInstance"
payload <- "{\n \"InstanceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignInstance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"InstanceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"InstanceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignInstance";
let payload = json!({"InstanceId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignInstance' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"InstanceId": ""
}'
echo '{
"InstanceId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignInstance' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "InstanceId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignInstance'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["InstanceId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignInstance")! 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
UnassignVolume
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignVolume
HEADERS
X-Amz-Target
BODY json
{
"VolumeId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignVolume");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"VolumeId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignVolume" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:VolumeId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignVolume"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"VolumeId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignVolume"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"VolumeId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignVolume");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"VolumeId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignVolume"
payload := strings.NewReader("{\n \"VolumeId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 20
{
"VolumeId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignVolume")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"VolumeId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignVolume"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"VolumeId\": \"\"\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 \"VolumeId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignVolume")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignVolume")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"VolumeId\": \"\"\n}")
.asString();
const data = JSON.stringify({
VolumeId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignVolume');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignVolume',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {VolumeId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignVolume';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"VolumeId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignVolume',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "VolumeId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"VolumeId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignVolume")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({VolumeId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignVolume',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {VolumeId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignVolume');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
VolumeId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignVolume',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {VolumeId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignVolume';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"VolumeId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"VolumeId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignVolume"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignVolume" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"VolumeId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignVolume",
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([
'VolumeId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignVolume', [
'body' => '{
"VolumeId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignVolume');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'VolumeId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'VolumeId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignVolume');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignVolume' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"VolumeId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignVolume' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"VolumeId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"VolumeId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignVolume"
payload = { "VolumeId": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignVolume"
payload <- "{\n \"VolumeId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignVolume")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"VolumeId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"VolumeId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignVolume";
let payload = json!({"VolumeId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignVolume' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"VolumeId": ""
}'
echo '{
"VolumeId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignVolume' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "VolumeId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignVolume'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["VolumeId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UnassignVolume")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
UntagResource
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UntagResource
HEADERS
X-Amz-Target
BODY json
{
"ResourceArn": "",
"TagKeys": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UntagResource");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"ResourceArn\": \"\",\n \"TagKeys\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UntagResource" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ResourceArn ""
:TagKeys ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UntagResource"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ResourceArn\": \"\",\n \"TagKeys\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UntagResource"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ResourceArn\": \"\",\n \"TagKeys\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UntagResource");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ResourceArn\": \"\",\n \"TagKeys\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UntagResource"
payload := strings.NewReader("{\n \"ResourceArn\": \"\",\n \"TagKeys\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 40
{
"ResourceArn": "",
"TagKeys": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UntagResource")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ResourceArn\": \"\",\n \"TagKeys\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UntagResource"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ResourceArn\": \"\",\n \"TagKeys\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"ResourceArn\": \"\",\n \"TagKeys\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UntagResource")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UntagResource")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ResourceArn\": \"\",\n \"TagKeys\": \"\"\n}")
.asString();
const data = JSON.stringify({
ResourceArn: '',
TagKeys: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UntagResource');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UntagResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ResourceArn: '', TagKeys: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UntagResource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ResourceArn":"","TagKeys":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UntagResource',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ResourceArn": "",\n "TagKeys": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ResourceArn\": \"\",\n \"TagKeys\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UntagResource")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({ResourceArn: '', TagKeys: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UntagResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {ResourceArn: '', TagKeys: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UntagResource');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ResourceArn: '',
TagKeys: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UntagResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ResourceArn: '', TagKeys: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UntagResource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ResourceArn":"","TagKeys":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"ResourceArn": @"",
@"TagKeys": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UntagResource"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UntagResource" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"ResourceArn\": \"\",\n \"TagKeys\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UntagResource",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ResourceArn' => '',
'TagKeys' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UntagResource', [
'body' => '{
"ResourceArn": "",
"TagKeys": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UntagResource');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ResourceArn' => '',
'TagKeys' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ResourceArn' => '',
'TagKeys' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UntagResource');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UntagResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ResourceArn": "",
"TagKeys": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UntagResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ResourceArn": "",
"TagKeys": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ResourceArn\": \"\",\n \"TagKeys\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UntagResource"
payload = {
"ResourceArn": "",
"TagKeys": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UntagResource"
payload <- "{\n \"ResourceArn\": \"\",\n \"TagKeys\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UntagResource")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"ResourceArn\": \"\",\n \"TagKeys\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"ResourceArn\": \"\",\n \"TagKeys\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UntagResource";
let payload = json!({
"ResourceArn": "",
"TagKeys": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UntagResource' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ResourceArn": "",
"TagKeys": ""
}'
echo '{
"ResourceArn": "",
"TagKeys": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UntagResource' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ResourceArn": "",\n "TagKeys": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UntagResource'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"ResourceArn": "",
"TagKeys": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.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()
POST
UpdateApp
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateApp
HEADERS
X-Amz-Target
BODY json
{
"AppId": "",
"Name": "",
"Description": "",
"DataSources": "",
"Type": "",
"AppSource": "",
"Domains": "",
"EnableSsl": "",
"SslConfiguration": "",
"Attributes": "",
"Environment": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateApp");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"AppId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"DataSources\": \"\",\n \"Type\": \"\",\n \"AppSource\": \"\",\n \"Domains\": \"\",\n \"EnableSsl\": \"\",\n \"SslConfiguration\": \"\",\n \"Attributes\": \"\",\n \"Environment\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateApp" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:AppId ""
:Name ""
:Description ""
:DataSources ""
:Type ""
:AppSource ""
:Domains ""
:EnableSsl ""
:SslConfiguration ""
:Attributes ""
:Environment ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateApp"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"AppId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"DataSources\": \"\",\n \"Type\": \"\",\n \"AppSource\": \"\",\n \"Domains\": \"\",\n \"EnableSsl\": \"\",\n \"SslConfiguration\": \"\",\n \"Attributes\": \"\",\n \"Environment\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateApp"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"AppId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"DataSources\": \"\",\n \"Type\": \"\",\n \"AppSource\": \"\",\n \"Domains\": \"\",\n \"EnableSsl\": \"\",\n \"SslConfiguration\": \"\",\n \"Attributes\": \"\",\n \"Environment\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateApp");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AppId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"DataSources\": \"\",\n \"Type\": \"\",\n \"AppSource\": \"\",\n \"Domains\": \"\",\n \"EnableSsl\": \"\",\n \"SslConfiguration\": \"\",\n \"Attributes\": \"\",\n \"Environment\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateApp"
payload := strings.NewReader("{\n \"AppId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"DataSources\": \"\",\n \"Type\": \"\",\n \"AppSource\": \"\",\n \"Domains\": \"\",\n \"EnableSsl\": \"\",\n \"SslConfiguration\": \"\",\n \"Attributes\": \"\",\n \"Environment\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 209
{
"AppId": "",
"Name": "",
"Description": "",
"DataSources": "",
"Type": "",
"AppSource": "",
"Domains": "",
"EnableSsl": "",
"SslConfiguration": "",
"Attributes": "",
"Environment": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateApp")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"AppId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"DataSources\": \"\",\n \"Type\": \"\",\n \"AppSource\": \"\",\n \"Domains\": \"\",\n \"EnableSsl\": \"\",\n \"SslConfiguration\": \"\",\n \"Attributes\": \"\",\n \"Environment\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateApp"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AppId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"DataSources\": \"\",\n \"Type\": \"\",\n \"AppSource\": \"\",\n \"Domains\": \"\",\n \"EnableSsl\": \"\",\n \"SslConfiguration\": \"\",\n \"Attributes\": \"\",\n \"Environment\": \"\"\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 \"AppId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"DataSources\": \"\",\n \"Type\": \"\",\n \"AppSource\": \"\",\n \"Domains\": \"\",\n \"EnableSsl\": \"\",\n \"SslConfiguration\": \"\",\n \"Attributes\": \"\",\n \"Environment\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateApp")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateApp")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"AppId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"DataSources\": \"\",\n \"Type\": \"\",\n \"AppSource\": \"\",\n \"Domains\": \"\",\n \"EnableSsl\": \"\",\n \"SslConfiguration\": \"\",\n \"Attributes\": \"\",\n \"Environment\": \"\"\n}")
.asString();
const data = JSON.stringify({
AppId: '',
Name: '',
Description: '',
DataSources: '',
Type: '',
AppSource: '',
Domains: '',
EnableSsl: '',
SslConfiguration: '',
Attributes: '',
Environment: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateApp');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateApp',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
AppId: '',
Name: '',
Description: '',
DataSources: '',
Type: '',
AppSource: '',
Domains: '',
EnableSsl: '',
SslConfiguration: '',
Attributes: '',
Environment: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateApp';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AppId":"","Name":"","Description":"","DataSources":"","Type":"","AppSource":"","Domains":"","EnableSsl":"","SslConfiguration":"","Attributes":"","Environment":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateApp',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "AppId": "",\n "Name": "",\n "Description": "",\n "DataSources": "",\n "Type": "",\n "AppSource": "",\n "Domains": "",\n "EnableSsl": "",\n "SslConfiguration": "",\n "Attributes": "",\n "Environment": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AppId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"DataSources\": \"\",\n \"Type\": \"\",\n \"AppSource\": \"\",\n \"Domains\": \"\",\n \"EnableSsl\": \"\",\n \"SslConfiguration\": \"\",\n \"Attributes\": \"\",\n \"Environment\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateApp")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
AppId: '',
Name: '',
Description: '',
DataSources: '',
Type: '',
AppSource: '',
Domains: '',
EnableSsl: '',
SslConfiguration: '',
Attributes: '',
Environment: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateApp',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
AppId: '',
Name: '',
Description: '',
DataSources: '',
Type: '',
AppSource: '',
Domains: '',
EnableSsl: '',
SslConfiguration: '',
Attributes: '',
Environment: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateApp');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
AppId: '',
Name: '',
Description: '',
DataSources: '',
Type: '',
AppSource: '',
Domains: '',
EnableSsl: '',
SslConfiguration: '',
Attributes: '',
Environment: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateApp',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
AppId: '',
Name: '',
Description: '',
DataSources: '',
Type: '',
AppSource: '',
Domains: '',
EnableSsl: '',
SslConfiguration: '',
Attributes: '',
Environment: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateApp';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AppId":"","Name":"","Description":"","DataSources":"","Type":"","AppSource":"","Domains":"","EnableSsl":"","SslConfiguration":"","Attributes":"","Environment":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"AppId": @"",
@"Name": @"",
@"Description": @"",
@"DataSources": @"",
@"Type": @"",
@"AppSource": @"",
@"Domains": @"",
@"EnableSsl": @"",
@"SslConfiguration": @"",
@"Attributes": @"",
@"Environment": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateApp"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateApp" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"AppId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"DataSources\": \"\",\n \"Type\": \"\",\n \"AppSource\": \"\",\n \"Domains\": \"\",\n \"EnableSsl\": \"\",\n \"SslConfiguration\": \"\",\n \"Attributes\": \"\",\n \"Environment\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateApp",
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([
'AppId' => '',
'Name' => '',
'Description' => '',
'DataSources' => '',
'Type' => '',
'AppSource' => '',
'Domains' => '',
'EnableSsl' => '',
'SslConfiguration' => '',
'Attributes' => '',
'Environment' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateApp', [
'body' => '{
"AppId": "",
"Name": "",
"Description": "",
"DataSources": "",
"Type": "",
"AppSource": "",
"Domains": "",
"EnableSsl": "",
"SslConfiguration": "",
"Attributes": "",
"Environment": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateApp');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AppId' => '',
'Name' => '',
'Description' => '',
'DataSources' => '',
'Type' => '',
'AppSource' => '',
'Domains' => '',
'EnableSsl' => '',
'SslConfiguration' => '',
'Attributes' => '',
'Environment' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AppId' => '',
'Name' => '',
'Description' => '',
'DataSources' => '',
'Type' => '',
'AppSource' => '',
'Domains' => '',
'EnableSsl' => '',
'SslConfiguration' => '',
'Attributes' => '',
'Environment' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateApp');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateApp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AppId": "",
"Name": "",
"Description": "",
"DataSources": "",
"Type": "",
"AppSource": "",
"Domains": "",
"EnableSsl": "",
"SslConfiguration": "",
"Attributes": "",
"Environment": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateApp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AppId": "",
"Name": "",
"Description": "",
"DataSources": "",
"Type": "",
"AppSource": "",
"Domains": "",
"EnableSsl": "",
"SslConfiguration": "",
"Attributes": "",
"Environment": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AppId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"DataSources\": \"\",\n \"Type\": \"\",\n \"AppSource\": \"\",\n \"Domains\": \"\",\n \"EnableSsl\": \"\",\n \"SslConfiguration\": \"\",\n \"Attributes\": \"\",\n \"Environment\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateApp"
payload = {
"AppId": "",
"Name": "",
"Description": "",
"DataSources": "",
"Type": "",
"AppSource": "",
"Domains": "",
"EnableSsl": "",
"SslConfiguration": "",
"Attributes": "",
"Environment": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateApp"
payload <- "{\n \"AppId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"DataSources\": \"\",\n \"Type\": \"\",\n \"AppSource\": \"\",\n \"Domains\": \"\",\n \"EnableSsl\": \"\",\n \"SslConfiguration\": \"\",\n \"Attributes\": \"\",\n \"Environment\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateApp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"AppId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"DataSources\": \"\",\n \"Type\": \"\",\n \"AppSource\": \"\",\n \"Domains\": \"\",\n \"EnableSsl\": \"\",\n \"SslConfiguration\": \"\",\n \"Attributes\": \"\",\n \"Environment\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"AppId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"DataSources\": \"\",\n \"Type\": \"\",\n \"AppSource\": \"\",\n \"Domains\": \"\",\n \"EnableSsl\": \"\",\n \"SslConfiguration\": \"\",\n \"Attributes\": \"\",\n \"Environment\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateApp";
let payload = json!({
"AppId": "",
"Name": "",
"Description": "",
"DataSources": "",
"Type": "",
"AppSource": "",
"Domains": "",
"EnableSsl": "",
"SslConfiguration": "",
"Attributes": "",
"Environment": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateApp' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"AppId": "",
"Name": "",
"Description": "",
"DataSources": "",
"Type": "",
"AppSource": "",
"Domains": "",
"EnableSsl": "",
"SslConfiguration": "",
"Attributes": "",
"Environment": ""
}'
echo '{
"AppId": "",
"Name": "",
"Description": "",
"DataSources": "",
"Type": "",
"AppSource": "",
"Domains": "",
"EnableSsl": "",
"SslConfiguration": "",
"Attributes": "",
"Environment": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateApp' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "AppId": "",\n "Name": "",\n "Description": "",\n "DataSources": "",\n "Type": "",\n "AppSource": "",\n "Domains": "",\n "EnableSsl": "",\n "SslConfiguration": "",\n "Attributes": "",\n "Environment": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateApp'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"AppId": "",
"Name": "",
"Description": "",
"DataSources": "",
"Type": "",
"AppSource": "",
"Domains": "",
"EnableSsl": "",
"SslConfiguration": "",
"Attributes": "",
"Environment": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateApp")! 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
UpdateElasticIp
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateElasticIp
HEADERS
X-Amz-Target
BODY json
{
"ElasticIp": "",
"Name": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateElasticIp");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"ElasticIp\": \"\",\n \"Name\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateElasticIp" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ElasticIp ""
:Name ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateElasticIp"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ElasticIp\": \"\",\n \"Name\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateElasticIp"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ElasticIp\": \"\",\n \"Name\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateElasticIp");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ElasticIp\": \"\",\n \"Name\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateElasticIp"
payload := strings.NewReader("{\n \"ElasticIp\": \"\",\n \"Name\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 35
{
"ElasticIp": "",
"Name": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateElasticIp")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ElasticIp\": \"\",\n \"Name\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateElasticIp"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ElasticIp\": \"\",\n \"Name\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"ElasticIp\": \"\",\n \"Name\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateElasticIp")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateElasticIp")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ElasticIp\": \"\",\n \"Name\": \"\"\n}")
.asString();
const data = JSON.stringify({
ElasticIp: '',
Name: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateElasticIp');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateElasticIp',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ElasticIp: '', Name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateElasticIp';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ElasticIp":"","Name":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateElasticIp',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ElasticIp": "",\n "Name": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ElasticIp\": \"\",\n \"Name\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateElasticIp")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({ElasticIp: '', Name: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateElasticIp',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {ElasticIp: '', Name: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateElasticIp');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ElasticIp: '',
Name: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateElasticIp',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ElasticIp: '', Name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateElasticIp';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ElasticIp":"","Name":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"ElasticIp": @"",
@"Name": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateElasticIp"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateElasticIp" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"ElasticIp\": \"\",\n \"Name\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateElasticIp",
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([
'ElasticIp' => '',
'Name' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateElasticIp', [
'body' => '{
"ElasticIp": "",
"Name": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateElasticIp');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ElasticIp' => '',
'Name' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ElasticIp' => '',
'Name' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateElasticIp');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateElasticIp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ElasticIp": "",
"Name": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateElasticIp' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ElasticIp": "",
"Name": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ElasticIp\": \"\",\n \"Name\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateElasticIp"
payload = {
"ElasticIp": "",
"Name": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateElasticIp"
payload <- "{\n \"ElasticIp\": \"\",\n \"Name\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateElasticIp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"ElasticIp\": \"\",\n \"Name\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"ElasticIp\": \"\",\n \"Name\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateElasticIp";
let payload = json!({
"ElasticIp": "",
"Name": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateElasticIp' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ElasticIp": "",
"Name": ""
}'
echo '{
"ElasticIp": "",
"Name": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateElasticIp' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ElasticIp": "",\n "Name": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateElasticIp'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"ElasticIp": "",
"Name": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateElasticIp")! 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
UpdateInstance
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateInstance
HEADERS
X-Amz-Target
BODY json
{
"InstanceId": "",
"LayerIds": "",
"InstanceType": "",
"AutoScalingType": "",
"Hostname": "",
"Os": "",
"AmiId": "",
"SshKeyName": "",
"Architecture": "",
"InstallUpdatesOnBoot": "",
"EbsOptimized": "",
"AgentVersion": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateInstance");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"InstanceId\": \"\",\n \"LayerIds\": \"\",\n \"InstanceType\": \"\",\n \"AutoScalingType\": \"\",\n \"Hostname\": \"\",\n \"Os\": \"\",\n \"AmiId\": \"\",\n \"SshKeyName\": \"\",\n \"Architecture\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"EbsOptimized\": \"\",\n \"AgentVersion\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateInstance" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:InstanceId ""
:LayerIds ""
:InstanceType ""
:AutoScalingType ""
:Hostname ""
:Os ""
:AmiId ""
:SshKeyName ""
:Architecture ""
:InstallUpdatesOnBoot ""
:EbsOptimized ""
:AgentVersion ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateInstance"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"InstanceId\": \"\",\n \"LayerIds\": \"\",\n \"InstanceType\": \"\",\n \"AutoScalingType\": \"\",\n \"Hostname\": \"\",\n \"Os\": \"\",\n \"AmiId\": \"\",\n \"SshKeyName\": \"\",\n \"Architecture\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"EbsOptimized\": \"\",\n \"AgentVersion\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateInstance"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"InstanceId\": \"\",\n \"LayerIds\": \"\",\n \"InstanceType\": \"\",\n \"AutoScalingType\": \"\",\n \"Hostname\": \"\",\n \"Os\": \"\",\n \"AmiId\": \"\",\n \"SshKeyName\": \"\",\n \"Architecture\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"EbsOptimized\": \"\",\n \"AgentVersion\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateInstance");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"InstanceId\": \"\",\n \"LayerIds\": \"\",\n \"InstanceType\": \"\",\n \"AutoScalingType\": \"\",\n \"Hostname\": \"\",\n \"Os\": \"\",\n \"AmiId\": \"\",\n \"SshKeyName\": \"\",\n \"Architecture\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"EbsOptimized\": \"\",\n \"AgentVersion\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateInstance"
payload := strings.NewReader("{\n \"InstanceId\": \"\",\n \"LayerIds\": \"\",\n \"InstanceType\": \"\",\n \"AutoScalingType\": \"\",\n \"Hostname\": \"\",\n \"Os\": \"\",\n \"AmiId\": \"\",\n \"SshKeyName\": \"\",\n \"Architecture\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"EbsOptimized\": \"\",\n \"AgentVersion\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 248
{
"InstanceId": "",
"LayerIds": "",
"InstanceType": "",
"AutoScalingType": "",
"Hostname": "",
"Os": "",
"AmiId": "",
"SshKeyName": "",
"Architecture": "",
"InstallUpdatesOnBoot": "",
"EbsOptimized": "",
"AgentVersion": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateInstance")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"InstanceId\": \"\",\n \"LayerIds\": \"\",\n \"InstanceType\": \"\",\n \"AutoScalingType\": \"\",\n \"Hostname\": \"\",\n \"Os\": \"\",\n \"AmiId\": \"\",\n \"SshKeyName\": \"\",\n \"Architecture\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"EbsOptimized\": \"\",\n \"AgentVersion\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateInstance"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"InstanceId\": \"\",\n \"LayerIds\": \"\",\n \"InstanceType\": \"\",\n \"AutoScalingType\": \"\",\n \"Hostname\": \"\",\n \"Os\": \"\",\n \"AmiId\": \"\",\n \"SshKeyName\": \"\",\n \"Architecture\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"EbsOptimized\": \"\",\n \"AgentVersion\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"InstanceId\": \"\",\n \"LayerIds\": \"\",\n \"InstanceType\": \"\",\n \"AutoScalingType\": \"\",\n \"Hostname\": \"\",\n \"Os\": \"\",\n \"AmiId\": \"\",\n \"SshKeyName\": \"\",\n \"Architecture\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"EbsOptimized\": \"\",\n \"AgentVersion\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateInstance")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateInstance")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"InstanceId\": \"\",\n \"LayerIds\": \"\",\n \"InstanceType\": \"\",\n \"AutoScalingType\": \"\",\n \"Hostname\": \"\",\n \"Os\": \"\",\n \"AmiId\": \"\",\n \"SshKeyName\": \"\",\n \"Architecture\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"EbsOptimized\": \"\",\n \"AgentVersion\": \"\"\n}")
.asString();
const data = JSON.stringify({
InstanceId: '',
LayerIds: '',
InstanceType: '',
AutoScalingType: '',
Hostname: '',
Os: '',
AmiId: '',
SshKeyName: '',
Architecture: '',
InstallUpdatesOnBoot: '',
EbsOptimized: '',
AgentVersion: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateInstance');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
InstanceId: '',
LayerIds: '',
InstanceType: '',
AutoScalingType: '',
Hostname: '',
Os: '',
AmiId: '',
SshKeyName: '',
Architecture: '',
InstallUpdatesOnBoot: '',
EbsOptimized: '',
AgentVersion: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateInstance';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":"","LayerIds":"","InstanceType":"","AutoScalingType":"","Hostname":"","Os":"","AmiId":"","SshKeyName":"","Architecture":"","InstallUpdatesOnBoot":"","EbsOptimized":"","AgentVersion":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateInstance',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "InstanceId": "",\n "LayerIds": "",\n "InstanceType": "",\n "AutoScalingType": "",\n "Hostname": "",\n "Os": "",\n "AmiId": "",\n "SshKeyName": "",\n "Architecture": "",\n "InstallUpdatesOnBoot": "",\n "EbsOptimized": "",\n "AgentVersion": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"InstanceId\": \"\",\n \"LayerIds\": \"\",\n \"InstanceType\": \"\",\n \"AutoScalingType\": \"\",\n \"Hostname\": \"\",\n \"Os\": \"\",\n \"AmiId\": \"\",\n \"SshKeyName\": \"\",\n \"Architecture\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"EbsOptimized\": \"\",\n \"AgentVersion\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateInstance")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
InstanceId: '',
LayerIds: '',
InstanceType: '',
AutoScalingType: '',
Hostname: '',
Os: '',
AmiId: '',
SshKeyName: '',
Architecture: '',
InstallUpdatesOnBoot: '',
EbsOptimized: '',
AgentVersion: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
InstanceId: '',
LayerIds: '',
InstanceType: '',
AutoScalingType: '',
Hostname: '',
Os: '',
AmiId: '',
SshKeyName: '',
Architecture: '',
InstallUpdatesOnBoot: '',
EbsOptimized: '',
AgentVersion: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateInstance');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
InstanceId: '',
LayerIds: '',
InstanceType: '',
AutoScalingType: '',
Hostname: '',
Os: '',
AmiId: '',
SshKeyName: '',
Architecture: '',
InstallUpdatesOnBoot: '',
EbsOptimized: '',
AgentVersion: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
InstanceId: '',
LayerIds: '',
InstanceType: '',
AutoScalingType: '',
Hostname: '',
Os: '',
AmiId: '',
SshKeyName: '',
Architecture: '',
InstallUpdatesOnBoot: '',
EbsOptimized: '',
AgentVersion: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateInstance';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"InstanceId":"","LayerIds":"","InstanceType":"","AutoScalingType":"","Hostname":"","Os":"","AmiId":"","SshKeyName":"","Architecture":"","InstallUpdatesOnBoot":"","EbsOptimized":"","AgentVersion":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"InstanceId": @"",
@"LayerIds": @"",
@"InstanceType": @"",
@"AutoScalingType": @"",
@"Hostname": @"",
@"Os": @"",
@"AmiId": @"",
@"SshKeyName": @"",
@"Architecture": @"",
@"InstallUpdatesOnBoot": @"",
@"EbsOptimized": @"",
@"AgentVersion": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateInstance"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateInstance" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"InstanceId\": \"\",\n \"LayerIds\": \"\",\n \"InstanceType\": \"\",\n \"AutoScalingType\": \"\",\n \"Hostname\": \"\",\n \"Os\": \"\",\n \"AmiId\": \"\",\n \"SshKeyName\": \"\",\n \"Architecture\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"EbsOptimized\": \"\",\n \"AgentVersion\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateInstance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'InstanceId' => '',
'LayerIds' => '',
'InstanceType' => '',
'AutoScalingType' => '',
'Hostname' => '',
'Os' => '',
'AmiId' => '',
'SshKeyName' => '',
'Architecture' => '',
'InstallUpdatesOnBoot' => '',
'EbsOptimized' => '',
'AgentVersion' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateInstance', [
'body' => '{
"InstanceId": "",
"LayerIds": "",
"InstanceType": "",
"AutoScalingType": "",
"Hostname": "",
"Os": "",
"AmiId": "",
"SshKeyName": "",
"Architecture": "",
"InstallUpdatesOnBoot": "",
"EbsOptimized": "",
"AgentVersion": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateInstance');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'InstanceId' => '',
'LayerIds' => '',
'InstanceType' => '',
'AutoScalingType' => '',
'Hostname' => '',
'Os' => '',
'AmiId' => '',
'SshKeyName' => '',
'Architecture' => '',
'InstallUpdatesOnBoot' => '',
'EbsOptimized' => '',
'AgentVersion' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'InstanceId' => '',
'LayerIds' => '',
'InstanceType' => '',
'AutoScalingType' => '',
'Hostname' => '',
'Os' => '',
'AmiId' => '',
'SshKeyName' => '',
'Architecture' => '',
'InstallUpdatesOnBoot' => '',
'EbsOptimized' => '',
'AgentVersion' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateInstance');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateInstance' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": "",
"LayerIds": "",
"InstanceType": "",
"AutoScalingType": "",
"Hostname": "",
"Os": "",
"AmiId": "",
"SshKeyName": "",
"Architecture": "",
"InstallUpdatesOnBoot": "",
"EbsOptimized": "",
"AgentVersion": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateInstance' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"InstanceId": "",
"LayerIds": "",
"InstanceType": "",
"AutoScalingType": "",
"Hostname": "",
"Os": "",
"AmiId": "",
"SshKeyName": "",
"Architecture": "",
"InstallUpdatesOnBoot": "",
"EbsOptimized": "",
"AgentVersion": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"InstanceId\": \"\",\n \"LayerIds\": \"\",\n \"InstanceType\": \"\",\n \"AutoScalingType\": \"\",\n \"Hostname\": \"\",\n \"Os\": \"\",\n \"AmiId\": \"\",\n \"SshKeyName\": \"\",\n \"Architecture\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"EbsOptimized\": \"\",\n \"AgentVersion\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateInstance"
payload = {
"InstanceId": "",
"LayerIds": "",
"InstanceType": "",
"AutoScalingType": "",
"Hostname": "",
"Os": "",
"AmiId": "",
"SshKeyName": "",
"Architecture": "",
"InstallUpdatesOnBoot": "",
"EbsOptimized": "",
"AgentVersion": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateInstance"
payload <- "{\n \"InstanceId\": \"\",\n \"LayerIds\": \"\",\n \"InstanceType\": \"\",\n \"AutoScalingType\": \"\",\n \"Hostname\": \"\",\n \"Os\": \"\",\n \"AmiId\": \"\",\n \"SshKeyName\": \"\",\n \"Architecture\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"EbsOptimized\": \"\",\n \"AgentVersion\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateInstance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"InstanceId\": \"\",\n \"LayerIds\": \"\",\n \"InstanceType\": \"\",\n \"AutoScalingType\": \"\",\n \"Hostname\": \"\",\n \"Os\": \"\",\n \"AmiId\": \"\",\n \"SshKeyName\": \"\",\n \"Architecture\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"EbsOptimized\": \"\",\n \"AgentVersion\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"InstanceId\": \"\",\n \"LayerIds\": \"\",\n \"InstanceType\": \"\",\n \"AutoScalingType\": \"\",\n \"Hostname\": \"\",\n \"Os\": \"\",\n \"AmiId\": \"\",\n \"SshKeyName\": \"\",\n \"Architecture\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"EbsOptimized\": \"\",\n \"AgentVersion\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateInstance";
let payload = json!({
"InstanceId": "",
"LayerIds": "",
"InstanceType": "",
"AutoScalingType": "",
"Hostname": "",
"Os": "",
"AmiId": "",
"SshKeyName": "",
"Architecture": "",
"InstallUpdatesOnBoot": "",
"EbsOptimized": "",
"AgentVersion": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateInstance' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"InstanceId": "",
"LayerIds": "",
"InstanceType": "",
"AutoScalingType": "",
"Hostname": "",
"Os": "",
"AmiId": "",
"SshKeyName": "",
"Architecture": "",
"InstallUpdatesOnBoot": "",
"EbsOptimized": "",
"AgentVersion": ""
}'
echo '{
"InstanceId": "",
"LayerIds": "",
"InstanceType": "",
"AutoScalingType": "",
"Hostname": "",
"Os": "",
"AmiId": "",
"SshKeyName": "",
"Architecture": "",
"InstallUpdatesOnBoot": "",
"EbsOptimized": "",
"AgentVersion": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateInstance' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "InstanceId": "",\n "LayerIds": "",\n "InstanceType": "",\n "AutoScalingType": "",\n "Hostname": "",\n "Os": "",\n "AmiId": "",\n "SshKeyName": "",\n "Architecture": "",\n "InstallUpdatesOnBoot": "",\n "EbsOptimized": "",\n "AgentVersion": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateInstance'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"InstanceId": "",
"LayerIds": "",
"InstanceType": "",
"AutoScalingType": "",
"Hostname": "",
"Os": "",
"AmiId": "",
"SshKeyName": "",
"Architecture": "",
"InstallUpdatesOnBoot": "",
"EbsOptimized": "",
"AgentVersion": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateInstance")! 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
UpdateLayer
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateLayer
HEADERS
X-Amz-Target
BODY json
{
"LayerId": "",
"Name": "",
"Shortname": "",
"Attributes": "",
"CloudWatchLogsConfiguration": "",
"CustomInstanceProfileArn": "",
"CustomJson": "",
"CustomSecurityGroupIds": "",
"Packages": "",
"VolumeConfigurations": "",
"EnableAutoHealing": "",
"AutoAssignElasticIps": "",
"AutoAssignPublicIps": "",
"CustomRecipes": "",
"InstallUpdatesOnBoot": "",
"UseEbsOptimizedInstances": "",
"LifecycleEventConfiguration": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateLayer");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"LayerId\": \"\",\n \"Name\": \"\",\n \"Shortname\": \"\",\n \"Attributes\": \"\",\n \"CloudWatchLogsConfiguration\": \"\",\n \"CustomInstanceProfileArn\": \"\",\n \"CustomJson\": \"\",\n \"CustomSecurityGroupIds\": \"\",\n \"Packages\": \"\",\n \"VolumeConfigurations\": \"\",\n \"EnableAutoHealing\": \"\",\n \"AutoAssignElasticIps\": \"\",\n \"AutoAssignPublicIps\": \"\",\n \"CustomRecipes\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"UseEbsOptimizedInstances\": \"\",\n \"LifecycleEventConfiguration\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateLayer" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:LayerId ""
:Name ""
:Shortname ""
:Attributes ""
:CloudWatchLogsConfiguration ""
:CustomInstanceProfileArn ""
:CustomJson ""
:CustomSecurityGroupIds ""
:Packages ""
:VolumeConfigurations ""
:EnableAutoHealing ""
:AutoAssignElasticIps ""
:AutoAssignPublicIps ""
:CustomRecipes ""
:InstallUpdatesOnBoot ""
:UseEbsOptimizedInstances ""
:LifecycleEventConfiguration ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateLayer"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"LayerId\": \"\",\n \"Name\": \"\",\n \"Shortname\": \"\",\n \"Attributes\": \"\",\n \"CloudWatchLogsConfiguration\": \"\",\n \"CustomInstanceProfileArn\": \"\",\n \"CustomJson\": \"\",\n \"CustomSecurityGroupIds\": \"\",\n \"Packages\": \"\",\n \"VolumeConfigurations\": \"\",\n \"EnableAutoHealing\": \"\",\n \"AutoAssignElasticIps\": \"\",\n \"AutoAssignPublicIps\": \"\",\n \"CustomRecipes\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"UseEbsOptimizedInstances\": \"\",\n \"LifecycleEventConfiguration\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateLayer"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"LayerId\": \"\",\n \"Name\": \"\",\n \"Shortname\": \"\",\n \"Attributes\": \"\",\n \"CloudWatchLogsConfiguration\": \"\",\n \"CustomInstanceProfileArn\": \"\",\n \"CustomJson\": \"\",\n \"CustomSecurityGroupIds\": \"\",\n \"Packages\": \"\",\n \"VolumeConfigurations\": \"\",\n \"EnableAutoHealing\": \"\",\n \"AutoAssignElasticIps\": \"\",\n \"AutoAssignPublicIps\": \"\",\n \"CustomRecipes\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"UseEbsOptimizedInstances\": \"\",\n \"LifecycleEventConfiguration\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateLayer");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"LayerId\": \"\",\n \"Name\": \"\",\n \"Shortname\": \"\",\n \"Attributes\": \"\",\n \"CloudWatchLogsConfiguration\": \"\",\n \"CustomInstanceProfileArn\": \"\",\n \"CustomJson\": \"\",\n \"CustomSecurityGroupIds\": \"\",\n \"Packages\": \"\",\n \"VolumeConfigurations\": \"\",\n \"EnableAutoHealing\": \"\",\n \"AutoAssignElasticIps\": \"\",\n \"AutoAssignPublicIps\": \"\",\n \"CustomRecipes\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"UseEbsOptimizedInstances\": \"\",\n \"LifecycleEventConfiguration\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateLayer"
payload := strings.NewReader("{\n \"LayerId\": \"\",\n \"Name\": \"\",\n \"Shortname\": \"\",\n \"Attributes\": \"\",\n \"CloudWatchLogsConfiguration\": \"\",\n \"CustomInstanceProfileArn\": \"\",\n \"CustomJson\": \"\",\n \"CustomSecurityGroupIds\": \"\",\n \"Packages\": \"\",\n \"VolumeConfigurations\": \"\",\n \"EnableAutoHealing\": \"\",\n \"AutoAssignElasticIps\": \"\",\n \"AutoAssignPublicIps\": \"\",\n \"CustomRecipes\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"UseEbsOptimizedInstances\": \"\",\n \"LifecycleEventConfiguration\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 453
{
"LayerId": "",
"Name": "",
"Shortname": "",
"Attributes": "",
"CloudWatchLogsConfiguration": "",
"CustomInstanceProfileArn": "",
"CustomJson": "",
"CustomSecurityGroupIds": "",
"Packages": "",
"VolumeConfigurations": "",
"EnableAutoHealing": "",
"AutoAssignElasticIps": "",
"AutoAssignPublicIps": "",
"CustomRecipes": "",
"InstallUpdatesOnBoot": "",
"UseEbsOptimizedInstances": "",
"LifecycleEventConfiguration": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateLayer")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"LayerId\": \"\",\n \"Name\": \"\",\n \"Shortname\": \"\",\n \"Attributes\": \"\",\n \"CloudWatchLogsConfiguration\": \"\",\n \"CustomInstanceProfileArn\": \"\",\n \"CustomJson\": \"\",\n \"CustomSecurityGroupIds\": \"\",\n \"Packages\": \"\",\n \"VolumeConfigurations\": \"\",\n \"EnableAutoHealing\": \"\",\n \"AutoAssignElasticIps\": \"\",\n \"AutoAssignPublicIps\": \"\",\n \"CustomRecipes\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"UseEbsOptimizedInstances\": \"\",\n \"LifecycleEventConfiguration\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateLayer"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"LayerId\": \"\",\n \"Name\": \"\",\n \"Shortname\": \"\",\n \"Attributes\": \"\",\n \"CloudWatchLogsConfiguration\": \"\",\n \"CustomInstanceProfileArn\": \"\",\n \"CustomJson\": \"\",\n \"CustomSecurityGroupIds\": \"\",\n \"Packages\": \"\",\n \"VolumeConfigurations\": \"\",\n \"EnableAutoHealing\": \"\",\n \"AutoAssignElasticIps\": \"\",\n \"AutoAssignPublicIps\": \"\",\n \"CustomRecipes\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"UseEbsOptimizedInstances\": \"\",\n \"LifecycleEventConfiguration\": \"\"\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 \"LayerId\": \"\",\n \"Name\": \"\",\n \"Shortname\": \"\",\n \"Attributes\": \"\",\n \"CloudWatchLogsConfiguration\": \"\",\n \"CustomInstanceProfileArn\": \"\",\n \"CustomJson\": \"\",\n \"CustomSecurityGroupIds\": \"\",\n \"Packages\": \"\",\n \"VolumeConfigurations\": \"\",\n \"EnableAutoHealing\": \"\",\n \"AutoAssignElasticIps\": \"\",\n \"AutoAssignPublicIps\": \"\",\n \"CustomRecipes\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"UseEbsOptimizedInstances\": \"\",\n \"LifecycleEventConfiguration\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateLayer")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateLayer")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"LayerId\": \"\",\n \"Name\": \"\",\n \"Shortname\": \"\",\n \"Attributes\": \"\",\n \"CloudWatchLogsConfiguration\": \"\",\n \"CustomInstanceProfileArn\": \"\",\n \"CustomJson\": \"\",\n \"CustomSecurityGroupIds\": \"\",\n \"Packages\": \"\",\n \"VolumeConfigurations\": \"\",\n \"EnableAutoHealing\": \"\",\n \"AutoAssignElasticIps\": \"\",\n \"AutoAssignPublicIps\": \"\",\n \"CustomRecipes\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"UseEbsOptimizedInstances\": \"\",\n \"LifecycleEventConfiguration\": \"\"\n}")
.asString();
const data = JSON.stringify({
LayerId: '',
Name: '',
Shortname: '',
Attributes: '',
CloudWatchLogsConfiguration: '',
CustomInstanceProfileArn: '',
CustomJson: '',
CustomSecurityGroupIds: '',
Packages: '',
VolumeConfigurations: '',
EnableAutoHealing: '',
AutoAssignElasticIps: '',
AutoAssignPublicIps: '',
CustomRecipes: '',
InstallUpdatesOnBoot: '',
UseEbsOptimizedInstances: '',
LifecycleEventConfiguration: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateLayer');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateLayer',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
LayerId: '',
Name: '',
Shortname: '',
Attributes: '',
CloudWatchLogsConfiguration: '',
CustomInstanceProfileArn: '',
CustomJson: '',
CustomSecurityGroupIds: '',
Packages: '',
VolumeConfigurations: '',
EnableAutoHealing: '',
AutoAssignElasticIps: '',
AutoAssignPublicIps: '',
CustomRecipes: '',
InstallUpdatesOnBoot: '',
UseEbsOptimizedInstances: '',
LifecycleEventConfiguration: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateLayer';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"LayerId":"","Name":"","Shortname":"","Attributes":"","CloudWatchLogsConfiguration":"","CustomInstanceProfileArn":"","CustomJson":"","CustomSecurityGroupIds":"","Packages":"","VolumeConfigurations":"","EnableAutoHealing":"","AutoAssignElasticIps":"","AutoAssignPublicIps":"","CustomRecipes":"","InstallUpdatesOnBoot":"","UseEbsOptimizedInstances":"","LifecycleEventConfiguration":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateLayer',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "LayerId": "",\n "Name": "",\n "Shortname": "",\n "Attributes": "",\n "CloudWatchLogsConfiguration": "",\n "CustomInstanceProfileArn": "",\n "CustomJson": "",\n "CustomSecurityGroupIds": "",\n "Packages": "",\n "VolumeConfigurations": "",\n "EnableAutoHealing": "",\n "AutoAssignElasticIps": "",\n "AutoAssignPublicIps": "",\n "CustomRecipes": "",\n "InstallUpdatesOnBoot": "",\n "UseEbsOptimizedInstances": "",\n "LifecycleEventConfiguration": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"LayerId\": \"\",\n \"Name\": \"\",\n \"Shortname\": \"\",\n \"Attributes\": \"\",\n \"CloudWatchLogsConfiguration\": \"\",\n \"CustomInstanceProfileArn\": \"\",\n \"CustomJson\": \"\",\n \"CustomSecurityGroupIds\": \"\",\n \"Packages\": \"\",\n \"VolumeConfigurations\": \"\",\n \"EnableAutoHealing\": \"\",\n \"AutoAssignElasticIps\": \"\",\n \"AutoAssignPublicIps\": \"\",\n \"CustomRecipes\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"UseEbsOptimizedInstances\": \"\",\n \"LifecycleEventConfiguration\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateLayer")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
LayerId: '',
Name: '',
Shortname: '',
Attributes: '',
CloudWatchLogsConfiguration: '',
CustomInstanceProfileArn: '',
CustomJson: '',
CustomSecurityGroupIds: '',
Packages: '',
VolumeConfigurations: '',
EnableAutoHealing: '',
AutoAssignElasticIps: '',
AutoAssignPublicIps: '',
CustomRecipes: '',
InstallUpdatesOnBoot: '',
UseEbsOptimizedInstances: '',
LifecycleEventConfiguration: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateLayer',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
LayerId: '',
Name: '',
Shortname: '',
Attributes: '',
CloudWatchLogsConfiguration: '',
CustomInstanceProfileArn: '',
CustomJson: '',
CustomSecurityGroupIds: '',
Packages: '',
VolumeConfigurations: '',
EnableAutoHealing: '',
AutoAssignElasticIps: '',
AutoAssignPublicIps: '',
CustomRecipes: '',
InstallUpdatesOnBoot: '',
UseEbsOptimizedInstances: '',
LifecycleEventConfiguration: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateLayer');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
LayerId: '',
Name: '',
Shortname: '',
Attributes: '',
CloudWatchLogsConfiguration: '',
CustomInstanceProfileArn: '',
CustomJson: '',
CustomSecurityGroupIds: '',
Packages: '',
VolumeConfigurations: '',
EnableAutoHealing: '',
AutoAssignElasticIps: '',
AutoAssignPublicIps: '',
CustomRecipes: '',
InstallUpdatesOnBoot: '',
UseEbsOptimizedInstances: '',
LifecycleEventConfiguration: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateLayer',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
LayerId: '',
Name: '',
Shortname: '',
Attributes: '',
CloudWatchLogsConfiguration: '',
CustomInstanceProfileArn: '',
CustomJson: '',
CustomSecurityGroupIds: '',
Packages: '',
VolumeConfigurations: '',
EnableAutoHealing: '',
AutoAssignElasticIps: '',
AutoAssignPublicIps: '',
CustomRecipes: '',
InstallUpdatesOnBoot: '',
UseEbsOptimizedInstances: '',
LifecycleEventConfiguration: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateLayer';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"LayerId":"","Name":"","Shortname":"","Attributes":"","CloudWatchLogsConfiguration":"","CustomInstanceProfileArn":"","CustomJson":"","CustomSecurityGroupIds":"","Packages":"","VolumeConfigurations":"","EnableAutoHealing":"","AutoAssignElasticIps":"","AutoAssignPublicIps":"","CustomRecipes":"","InstallUpdatesOnBoot":"","UseEbsOptimizedInstances":"","LifecycleEventConfiguration":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"LayerId": @"",
@"Name": @"",
@"Shortname": @"",
@"Attributes": @"",
@"CloudWatchLogsConfiguration": @"",
@"CustomInstanceProfileArn": @"",
@"CustomJson": @"",
@"CustomSecurityGroupIds": @"",
@"Packages": @"",
@"VolumeConfigurations": @"",
@"EnableAutoHealing": @"",
@"AutoAssignElasticIps": @"",
@"AutoAssignPublicIps": @"",
@"CustomRecipes": @"",
@"InstallUpdatesOnBoot": @"",
@"UseEbsOptimizedInstances": @"",
@"LifecycleEventConfiguration": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateLayer"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateLayer" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"LayerId\": \"\",\n \"Name\": \"\",\n \"Shortname\": \"\",\n \"Attributes\": \"\",\n \"CloudWatchLogsConfiguration\": \"\",\n \"CustomInstanceProfileArn\": \"\",\n \"CustomJson\": \"\",\n \"CustomSecurityGroupIds\": \"\",\n \"Packages\": \"\",\n \"VolumeConfigurations\": \"\",\n \"EnableAutoHealing\": \"\",\n \"AutoAssignElasticIps\": \"\",\n \"AutoAssignPublicIps\": \"\",\n \"CustomRecipes\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"UseEbsOptimizedInstances\": \"\",\n \"LifecycleEventConfiguration\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateLayer",
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([
'LayerId' => '',
'Name' => '',
'Shortname' => '',
'Attributes' => '',
'CloudWatchLogsConfiguration' => '',
'CustomInstanceProfileArn' => '',
'CustomJson' => '',
'CustomSecurityGroupIds' => '',
'Packages' => '',
'VolumeConfigurations' => '',
'EnableAutoHealing' => '',
'AutoAssignElasticIps' => '',
'AutoAssignPublicIps' => '',
'CustomRecipes' => '',
'InstallUpdatesOnBoot' => '',
'UseEbsOptimizedInstances' => '',
'LifecycleEventConfiguration' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateLayer', [
'body' => '{
"LayerId": "",
"Name": "",
"Shortname": "",
"Attributes": "",
"CloudWatchLogsConfiguration": "",
"CustomInstanceProfileArn": "",
"CustomJson": "",
"CustomSecurityGroupIds": "",
"Packages": "",
"VolumeConfigurations": "",
"EnableAutoHealing": "",
"AutoAssignElasticIps": "",
"AutoAssignPublicIps": "",
"CustomRecipes": "",
"InstallUpdatesOnBoot": "",
"UseEbsOptimizedInstances": "",
"LifecycleEventConfiguration": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateLayer');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'LayerId' => '',
'Name' => '',
'Shortname' => '',
'Attributes' => '',
'CloudWatchLogsConfiguration' => '',
'CustomInstanceProfileArn' => '',
'CustomJson' => '',
'CustomSecurityGroupIds' => '',
'Packages' => '',
'VolumeConfigurations' => '',
'EnableAutoHealing' => '',
'AutoAssignElasticIps' => '',
'AutoAssignPublicIps' => '',
'CustomRecipes' => '',
'InstallUpdatesOnBoot' => '',
'UseEbsOptimizedInstances' => '',
'LifecycleEventConfiguration' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'LayerId' => '',
'Name' => '',
'Shortname' => '',
'Attributes' => '',
'CloudWatchLogsConfiguration' => '',
'CustomInstanceProfileArn' => '',
'CustomJson' => '',
'CustomSecurityGroupIds' => '',
'Packages' => '',
'VolumeConfigurations' => '',
'EnableAutoHealing' => '',
'AutoAssignElasticIps' => '',
'AutoAssignPublicIps' => '',
'CustomRecipes' => '',
'InstallUpdatesOnBoot' => '',
'UseEbsOptimizedInstances' => '',
'LifecycleEventConfiguration' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateLayer');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateLayer' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"LayerId": "",
"Name": "",
"Shortname": "",
"Attributes": "",
"CloudWatchLogsConfiguration": "",
"CustomInstanceProfileArn": "",
"CustomJson": "",
"CustomSecurityGroupIds": "",
"Packages": "",
"VolumeConfigurations": "",
"EnableAutoHealing": "",
"AutoAssignElasticIps": "",
"AutoAssignPublicIps": "",
"CustomRecipes": "",
"InstallUpdatesOnBoot": "",
"UseEbsOptimizedInstances": "",
"LifecycleEventConfiguration": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateLayer' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"LayerId": "",
"Name": "",
"Shortname": "",
"Attributes": "",
"CloudWatchLogsConfiguration": "",
"CustomInstanceProfileArn": "",
"CustomJson": "",
"CustomSecurityGroupIds": "",
"Packages": "",
"VolumeConfigurations": "",
"EnableAutoHealing": "",
"AutoAssignElasticIps": "",
"AutoAssignPublicIps": "",
"CustomRecipes": "",
"InstallUpdatesOnBoot": "",
"UseEbsOptimizedInstances": "",
"LifecycleEventConfiguration": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"LayerId\": \"\",\n \"Name\": \"\",\n \"Shortname\": \"\",\n \"Attributes\": \"\",\n \"CloudWatchLogsConfiguration\": \"\",\n \"CustomInstanceProfileArn\": \"\",\n \"CustomJson\": \"\",\n \"CustomSecurityGroupIds\": \"\",\n \"Packages\": \"\",\n \"VolumeConfigurations\": \"\",\n \"EnableAutoHealing\": \"\",\n \"AutoAssignElasticIps\": \"\",\n \"AutoAssignPublicIps\": \"\",\n \"CustomRecipes\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"UseEbsOptimizedInstances\": \"\",\n \"LifecycleEventConfiguration\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateLayer"
payload = {
"LayerId": "",
"Name": "",
"Shortname": "",
"Attributes": "",
"CloudWatchLogsConfiguration": "",
"CustomInstanceProfileArn": "",
"CustomJson": "",
"CustomSecurityGroupIds": "",
"Packages": "",
"VolumeConfigurations": "",
"EnableAutoHealing": "",
"AutoAssignElasticIps": "",
"AutoAssignPublicIps": "",
"CustomRecipes": "",
"InstallUpdatesOnBoot": "",
"UseEbsOptimizedInstances": "",
"LifecycleEventConfiguration": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateLayer"
payload <- "{\n \"LayerId\": \"\",\n \"Name\": \"\",\n \"Shortname\": \"\",\n \"Attributes\": \"\",\n \"CloudWatchLogsConfiguration\": \"\",\n \"CustomInstanceProfileArn\": \"\",\n \"CustomJson\": \"\",\n \"CustomSecurityGroupIds\": \"\",\n \"Packages\": \"\",\n \"VolumeConfigurations\": \"\",\n \"EnableAutoHealing\": \"\",\n \"AutoAssignElasticIps\": \"\",\n \"AutoAssignPublicIps\": \"\",\n \"CustomRecipes\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"UseEbsOptimizedInstances\": \"\",\n \"LifecycleEventConfiguration\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateLayer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"LayerId\": \"\",\n \"Name\": \"\",\n \"Shortname\": \"\",\n \"Attributes\": \"\",\n \"CloudWatchLogsConfiguration\": \"\",\n \"CustomInstanceProfileArn\": \"\",\n \"CustomJson\": \"\",\n \"CustomSecurityGroupIds\": \"\",\n \"Packages\": \"\",\n \"VolumeConfigurations\": \"\",\n \"EnableAutoHealing\": \"\",\n \"AutoAssignElasticIps\": \"\",\n \"AutoAssignPublicIps\": \"\",\n \"CustomRecipes\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"UseEbsOptimizedInstances\": \"\",\n \"LifecycleEventConfiguration\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"LayerId\": \"\",\n \"Name\": \"\",\n \"Shortname\": \"\",\n \"Attributes\": \"\",\n \"CloudWatchLogsConfiguration\": \"\",\n \"CustomInstanceProfileArn\": \"\",\n \"CustomJson\": \"\",\n \"CustomSecurityGroupIds\": \"\",\n \"Packages\": \"\",\n \"VolumeConfigurations\": \"\",\n \"EnableAutoHealing\": \"\",\n \"AutoAssignElasticIps\": \"\",\n \"AutoAssignPublicIps\": \"\",\n \"CustomRecipes\": \"\",\n \"InstallUpdatesOnBoot\": \"\",\n \"UseEbsOptimizedInstances\": \"\",\n \"LifecycleEventConfiguration\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateLayer";
let payload = json!({
"LayerId": "",
"Name": "",
"Shortname": "",
"Attributes": "",
"CloudWatchLogsConfiguration": "",
"CustomInstanceProfileArn": "",
"CustomJson": "",
"CustomSecurityGroupIds": "",
"Packages": "",
"VolumeConfigurations": "",
"EnableAutoHealing": "",
"AutoAssignElasticIps": "",
"AutoAssignPublicIps": "",
"CustomRecipes": "",
"InstallUpdatesOnBoot": "",
"UseEbsOptimizedInstances": "",
"LifecycleEventConfiguration": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateLayer' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"LayerId": "",
"Name": "",
"Shortname": "",
"Attributes": "",
"CloudWatchLogsConfiguration": "",
"CustomInstanceProfileArn": "",
"CustomJson": "",
"CustomSecurityGroupIds": "",
"Packages": "",
"VolumeConfigurations": "",
"EnableAutoHealing": "",
"AutoAssignElasticIps": "",
"AutoAssignPublicIps": "",
"CustomRecipes": "",
"InstallUpdatesOnBoot": "",
"UseEbsOptimizedInstances": "",
"LifecycleEventConfiguration": ""
}'
echo '{
"LayerId": "",
"Name": "",
"Shortname": "",
"Attributes": "",
"CloudWatchLogsConfiguration": "",
"CustomInstanceProfileArn": "",
"CustomJson": "",
"CustomSecurityGroupIds": "",
"Packages": "",
"VolumeConfigurations": "",
"EnableAutoHealing": "",
"AutoAssignElasticIps": "",
"AutoAssignPublicIps": "",
"CustomRecipes": "",
"InstallUpdatesOnBoot": "",
"UseEbsOptimizedInstances": "",
"LifecycleEventConfiguration": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateLayer' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "LayerId": "",\n "Name": "",\n "Shortname": "",\n "Attributes": "",\n "CloudWatchLogsConfiguration": "",\n "CustomInstanceProfileArn": "",\n "CustomJson": "",\n "CustomSecurityGroupIds": "",\n "Packages": "",\n "VolumeConfigurations": "",\n "EnableAutoHealing": "",\n "AutoAssignElasticIps": "",\n "AutoAssignPublicIps": "",\n "CustomRecipes": "",\n "InstallUpdatesOnBoot": "",\n "UseEbsOptimizedInstances": "",\n "LifecycleEventConfiguration": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateLayer'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"LayerId": "",
"Name": "",
"Shortname": "",
"Attributes": "",
"CloudWatchLogsConfiguration": "",
"CustomInstanceProfileArn": "",
"CustomJson": "",
"CustomSecurityGroupIds": "",
"Packages": "",
"VolumeConfigurations": "",
"EnableAutoHealing": "",
"AutoAssignElasticIps": "",
"AutoAssignPublicIps": "",
"CustomRecipes": "",
"InstallUpdatesOnBoot": "",
"UseEbsOptimizedInstances": "",
"LifecycleEventConfiguration": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateLayer")! 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
UpdateMyUserProfile
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateMyUserProfile
HEADERS
X-Amz-Target
BODY json
{
"SshPublicKey": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateMyUserProfile");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"SshPublicKey\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateMyUserProfile" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:SshPublicKey ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateMyUserProfile"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"SshPublicKey\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateMyUserProfile"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"SshPublicKey\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateMyUserProfile");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"SshPublicKey\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateMyUserProfile"
payload := strings.NewReader("{\n \"SshPublicKey\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 24
{
"SshPublicKey": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateMyUserProfile")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"SshPublicKey\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateMyUserProfile"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"SshPublicKey\": \"\"\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 \"SshPublicKey\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateMyUserProfile")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateMyUserProfile")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"SshPublicKey\": \"\"\n}")
.asString();
const data = JSON.stringify({
SshPublicKey: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateMyUserProfile');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateMyUserProfile',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {SshPublicKey: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateMyUserProfile';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"SshPublicKey":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateMyUserProfile',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "SshPublicKey": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"SshPublicKey\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateMyUserProfile")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({SshPublicKey: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateMyUserProfile',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {SshPublicKey: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateMyUserProfile');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
SshPublicKey: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateMyUserProfile',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {SshPublicKey: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateMyUserProfile';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"SshPublicKey":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"SshPublicKey": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateMyUserProfile"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateMyUserProfile" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"SshPublicKey\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateMyUserProfile",
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([
'SshPublicKey' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateMyUserProfile', [
'body' => '{
"SshPublicKey": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateMyUserProfile');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'SshPublicKey' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'SshPublicKey' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateMyUserProfile');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateMyUserProfile' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SshPublicKey": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateMyUserProfile' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"SshPublicKey": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"SshPublicKey\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateMyUserProfile"
payload = { "SshPublicKey": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateMyUserProfile"
payload <- "{\n \"SshPublicKey\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateMyUserProfile")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"SshPublicKey\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"SshPublicKey\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateMyUserProfile";
let payload = json!({"SshPublicKey": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateMyUserProfile' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"SshPublicKey": ""
}'
echo '{
"SshPublicKey": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateMyUserProfile' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "SshPublicKey": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateMyUserProfile'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["SshPublicKey": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateMyUserProfile")! 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
UpdateRdsDbInstance
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateRdsDbInstance
HEADERS
X-Amz-Target
BODY json
{
"RdsDbInstanceArn": "",
"DbUser": "",
"DbPassword": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateRdsDbInstance");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"RdsDbInstanceArn\": \"\",\n \"DbUser\": \"\",\n \"DbPassword\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateRdsDbInstance" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:RdsDbInstanceArn ""
:DbUser ""
:DbPassword ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateRdsDbInstance"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"RdsDbInstanceArn\": \"\",\n \"DbUser\": \"\",\n \"DbPassword\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateRdsDbInstance"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"RdsDbInstanceArn\": \"\",\n \"DbUser\": \"\",\n \"DbPassword\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateRdsDbInstance");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"RdsDbInstanceArn\": \"\",\n \"DbUser\": \"\",\n \"DbPassword\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateRdsDbInstance"
payload := strings.NewReader("{\n \"RdsDbInstanceArn\": \"\",\n \"DbUser\": \"\",\n \"DbPassword\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 64
{
"RdsDbInstanceArn": "",
"DbUser": "",
"DbPassword": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateRdsDbInstance")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"RdsDbInstanceArn\": \"\",\n \"DbUser\": \"\",\n \"DbPassword\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateRdsDbInstance"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"RdsDbInstanceArn\": \"\",\n \"DbUser\": \"\",\n \"DbPassword\": \"\"\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 \"RdsDbInstanceArn\": \"\",\n \"DbUser\": \"\",\n \"DbPassword\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateRdsDbInstance")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateRdsDbInstance")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"RdsDbInstanceArn\": \"\",\n \"DbUser\": \"\",\n \"DbPassword\": \"\"\n}")
.asString();
const data = JSON.stringify({
RdsDbInstanceArn: '',
DbUser: '',
DbPassword: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateRdsDbInstance');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateRdsDbInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {RdsDbInstanceArn: '', DbUser: '', DbPassword: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateRdsDbInstance';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"RdsDbInstanceArn":"","DbUser":"","DbPassword":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateRdsDbInstance',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "RdsDbInstanceArn": "",\n "DbUser": "",\n "DbPassword": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"RdsDbInstanceArn\": \"\",\n \"DbUser\": \"\",\n \"DbPassword\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateRdsDbInstance")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({RdsDbInstanceArn: '', DbUser: '', DbPassword: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateRdsDbInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {RdsDbInstanceArn: '', DbUser: '', DbPassword: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateRdsDbInstance');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
RdsDbInstanceArn: '',
DbUser: '',
DbPassword: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateRdsDbInstance',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {RdsDbInstanceArn: '', DbUser: '', DbPassword: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateRdsDbInstance';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"RdsDbInstanceArn":"","DbUser":"","DbPassword":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"RdsDbInstanceArn": @"",
@"DbUser": @"",
@"DbPassword": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateRdsDbInstance"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateRdsDbInstance" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"RdsDbInstanceArn\": \"\",\n \"DbUser\": \"\",\n \"DbPassword\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateRdsDbInstance",
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([
'RdsDbInstanceArn' => '',
'DbUser' => '',
'DbPassword' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateRdsDbInstance', [
'body' => '{
"RdsDbInstanceArn": "",
"DbUser": "",
"DbPassword": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateRdsDbInstance');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'RdsDbInstanceArn' => '',
'DbUser' => '',
'DbPassword' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'RdsDbInstanceArn' => '',
'DbUser' => '',
'DbPassword' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateRdsDbInstance');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateRdsDbInstance' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"RdsDbInstanceArn": "",
"DbUser": "",
"DbPassword": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateRdsDbInstance' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"RdsDbInstanceArn": "",
"DbUser": "",
"DbPassword": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"RdsDbInstanceArn\": \"\",\n \"DbUser\": \"\",\n \"DbPassword\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateRdsDbInstance"
payload = {
"RdsDbInstanceArn": "",
"DbUser": "",
"DbPassword": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateRdsDbInstance"
payload <- "{\n \"RdsDbInstanceArn\": \"\",\n \"DbUser\": \"\",\n \"DbPassword\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateRdsDbInstance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"RdsDbInstanceArn\": \"\",\n \"DbUser\": \"\",\n \"DbPassword\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"RdsDbInstanceArn\": \"\",\n \"DbUser\": \"\",\n \"DbPassword\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateRdsDbInstance";
let payload = json!({
"RdsDbInstanceArn": "",
"DbUser": "",
"DbPassword": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateRdsDbInstance' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"RdsDbInstanceArn": "",
"DbUser": "",
"DbPassword": ""
}'
echo '{
"RdsDbInstanceArn": "",
"DbUser": "",
"DbPassword": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateRdsDbInstance' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "RdsDbInstanceArn": "",\n "DbUser": "",\n "DbPassword": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateRdsDbInstance'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"RdsDbInstanceArn": "",
"DbUser": "",
"DbPassword": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateRdsDbInstance")! 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
UpdateStack
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateStack
HEADERS
X-Amz-Target
BODY json
{
"StackId": "",
"Name": "",
"Attributes": "",
"ServiceRoleArn": "",
"DefaultInstanceProfileArn": "",
"DefaultOs": "",
"HostnameTheme": "",
"DefaultAvailabilityZone": "",
"DefaultSubnetId": "",
"CustomJson": "",
"ConfigurationManager": "",
"ChefConfiguration": "",
"UseCustomCookbooks": "",
"CustomCookbooksSource": "",
"DefaultSshKeyName": "",
"DefaultRootDeviceType": "",
"UseOpsworksSecurityGroups": "",
"AgentVersion": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateStack");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"StackId\": \"\",\n \"Name\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"AgentVersion\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateStack" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:StackId ""
:Name ""
:Attributes ""
:ServiceRoleArn ""
:DefaultInstanceProfileArn ""
:DefaultOs ""
:HostnameTheme ""
:DefaultAvailabilityZone ""
:DefaultSubnetId ""
:CustomJson ""
:ConfigurationManager ""
:ChefConfiguration ""
:UseCustomCookbooks ""
:CustomCookbooksSource ""
:DefaultSshKeyName ""
:DefaultRootDeviceType ""
:UseOpsworksSecurityGroups ""
:AgentVersion ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateStack"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"StackId\": \"\",\n \"Name\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"AgentVersion\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateStack"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"StackId\": \"\",\n \"Name\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"AgentVersion\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateStack");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"StackId\": \"\",\n \"Name\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"AgentVersion\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateStack"
payload := strings.NewReader("{\n \"StackId\": \"\",\n \"Name\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"AgentVersion\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 463
{
"StackId": "",
"Name": "",
"Attributes": "",
"ServiceRoleArn": "",
"DefaultInstanceProfileArn": "",
"DefaultOs": "",
"HostnameTheme": "",
"DefaultAvailabilityZone": "",
"DefaultSubnetId": "",
"CustomJson": "",
"ConfigurationManager": "",
"ChefConfiguration": "",
"UseCustomCookbooks": "",
"CustomCookbooksSource": "",
"DefaultSshKeyName": "",
"DefaultRootDeviceType": "",
"UseOpsworksSecurityGroups": "",
"AgentVersion": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateStack")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"StackId\": \"\",\n \"Name\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"AgentVersion\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateStack"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"StackId\": \"\",\n \"Name\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"AgentVersion\": \"\"\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 \"StackId\": \"\",\n \"Name\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"AgentVersion\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateStack")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateStack")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"StackId\": \"\",\n \"Name\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"AgentVersion\": \"\"\n}")
.asString();
const data = JSON.stringify({
StackId: '',
Name: '',
Attributes: '',
ServiceRoleArn: '',
DefaultInstanceProfileArn: '',
DefaultOs: '',
HostnameTheme: '',
DefaultAvailabilityZone: '',
DefaultSubnetId: '',
CustomJson: '',
ConfigurationManager: '',
ChefConfiguration: '',
UseCustomCookbooks: '',
CustomCookbooksSource: '',
DefaultSshKeyName: '',
DefaultRootDeviceType: '',
UseOpsworksSecurityGroups: '',
AgentVersion: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateStack');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateStack',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
StackId: '',
Name: '',
Attributes: '',
ServiceRoleArn: '',
DefaultInstanceProfileArn: '',
DefaultOs: '',
HostnameTheme: '',
DefaultAvailabilityZone: '',
DefaultSubnetId: '',
CustomJson: '',
ConfigurationManager: '',
ChefConfiguration: '',
UseCustomCookbooks: '',
CustomCookbooksSource: '',
DefaultSshKeyName: '',
DefaultRootDeviceType: '',
UseOpsworksSecurityGroups: '',
AgentVersion: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateStack';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":"","Name":"","Attributes":"","ServiceRoleArn":"","DefaultInstanceProfileArn":"","DefaultOs":"","HostnameTheme":"","DefaultAvailabilityZone":"","DefaultSubnetId":"","CustomJson":"","ConfigurationManager":"","ChefConfiguration":"","UseCustomCookbooks":"","CustomCookbooksSource":"","DefaultSshKeyName":"","DefaultRootDeviceType":"","UseOpsworksSecurityGroups":"","AgentVersion":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateStack',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "StackId": "",\n "Name": "",\n "Attributes": "",\n "ServiceRoleArn": "",\n "DefaultInstanceProfileArn": "",\n "DefaultOs": "",\n "HostnameTheme": "",\n "DefaultAvailabilityZone": "",\n "DefaultSubnetId": "",\n "CustomJson": "",\n "ConfigurationManager": "",\n "ChefConfiguration": "",\n "UseCustomCookbooks": "",\n "CustomCookbooksSource": "",\n "DefaultSshKeyName": "",\n "DefaultRootDeviceType": "",\n "UseOpsworksSecurityGroups": "",\n "AgentVersion": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"StackId\": \"\",\n \"Name\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"AgentVersion\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateStack")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
StackId: '',
Name: '',
Attributes: '',
ServiceRoleArn: '',
DefaultInstanceProfileArn: '',
DefaultOs: '',
HostnameTheme: '',
DefaultAvailabilityZone: '',
DefaultSubnetId: '',
CustomJson: '',
ConfigurationManager: '',
ChefConfiguration: '',
UseCustomCookbooks: '',
CustomCookbooksSource: '',
DefaultSshKeyName: '',
DefaultRootDeviceType: '',
UseOpsworksSecurityGroups: '',
AgentVersion: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateStack',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
StackId: '',
Name: '',
Attributes: '',
ServiceRoleArn: '',
DefaultInstanceProfileArn: '',
DefaultOs: '',
HostnameTheme: '',
DefaultAvailabilityZone: '',
DefaultSubnetId: '',
CustomJson: '',
ConfigurationManager: '',
ChefConfiguration: '',
UseCustomCookbooks: '',
CustomCookbooksSource: '',
DefaultSshKeyName: '',
DefaultRootDeviceType: '',
UseOpsworksSecurityGroups: '',
AgentVersion: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateStack');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
StackId: '',
Name: '',
Attributes: '',
ServiceRoleArn: '',
DefaultInstanceProfileArn: '',
DefaultOs: '',
HostnameTheme: '',
DefaultAvailabilityZone: '',
DefaultSubnetId: '',
CustomJson: '',
ConfigurationManager: '',
ChefConfiguration: '',
UseCustomCookbooks: '',
CustomCookbooksSource: '',
DefaultSshKeyName: '',
DefaultRootDeviceType: '',
UseOpsworksSecurityGroups: '',
AgentVersion: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateStack',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
StackId: '',
Name: '',
Attributes: '',
ServiceRoleArn: '',
DefaultInstanceProfileArn: '',
DefaultOs: '',
HostnameTheme: '',
DefaultAvailabilityZone: '',
DefaultSubnetId: '',
CustomJson: '',
ConfigurationManager: '',
ChefConfiguration: '',
UseCustomCookbooks: '',
CustomCookbooksSource: '',
DefaultSshKeyName: '',
DefaultRootDeviceType: '',
UseOpsworksSecurityGroups: '',
AgentVersion: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateStack';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StackId":"","Name":"","Attributes":"","ServiceRoleArn":"","DefaultInstanceProfileArn":"","DefaultOs":"","HostnameTheme":"","DefaultAvailabilityZone":"","DefaultSubnetId":"","CustomJson":"","ConfigurationManager":"","ChefConfiguration":"","UseCustomCookbooks":"","CustomCookbooksSource":"","DefaultSshKeyName":"","DefaultRootDeviceType":"","UseOpsworksSecurityGroups":"","AgentVersion":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"StackId": @"",
@"Name": @"",
@"Attributes": @"",
@"ServiceRoleArn": @"",
@"DefaultInstanceProfileArn": @"",
@"DefaultOs": @"",
@"HostnameTheme": @"",
@"DefaultAvailabilityZone": @"",
@"DefaultSubnetId": @"",
@"CustomJson": @"",
@"ConfigurationManager": @"",
@"ChefConfiguration": @"",
@"UseCustomCookbooks": @"",
@"CustomCookbooksSource": @"",
@"DefaultSshKeyName": @"",
@"DefaultRootDeviceType": @"",
@"UseOpsworksSecurityGroups": @"",
@"AgentVersion": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateStack"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateStack" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"StackId\": \"\",\n \"Name\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"AgentVersion\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateStack",
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([
'StackId' => '',
'Name' => '',
'Attributes' => '',
'ServiceRoleArn' => '',
'DefaultInstanceProfileArn' => '',
'DefaultOs' => '',
'HostnameTheme' => '',
'DefaultAvailabilityZone' => '',
'DefaultSubnetId' => '',
'CustomJson' => '',
'ConfigurationManager' => '',
'ChefConfiguration' => '',
'UseCustomCookbooks' => '',
'CustomCookbooksSource' => '',
'DefaultSshKeyName' => '',
'DefaultRootDeviceType' => '',
'UseOpsworksSecurityGroups' => '',
'AgentVersion' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateStack', [
'body' => '{
"StackId": "",
"Name": "",
"Attributes": "",
"ServiceRoleArn": "",
"DefaultInstanceProfileArn": "",
"DefaultOs": "",
"HostnameTheme": "",
"DefaultAvailabilityZone": "",
"DefaultSubnetId": "",
"CustomJson": "",
"ConfigurationManager": "",
"ChefConfiguration": "",
"UseCustomCookbooks": "",
"CustomCookbooksSource": "",
"DefaultSshKeyName": "",
"DefaultRootDeviceType": "",
"UseOpsworksSecurityGroups": "",
"AgentVersion": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateStack');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'StackId' => '',
'Name' => '',
'Attributes' => '',
'ServiceRoleArn' => '',
'DefaultInstanceProfileArn' => '',
'DefaultOs' => '',
'HostnameTheme' => '',
'DefaultAvailabilityZone' => '',
'DefaultSubnetId' => '',
'CustomJson' => '',
'ConfigurationManager' => '',
'ChefConfiguration' => '',
'UseCustomCookbooks' => '',
'CustomCookbooksSource' => '',
'DefaultSshKeyName' => '',
'DefaultRootDeviceType' => '',
'UseOpsworksSecurityGroups' => '',
'AgentVersion' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'StackId' => '',
'Name' => '',
'Attributes' => '',
'ServiceRoleArn' => '',
'DefaultInstanceProfileArn' => '',
'DefaultOs' => '',
'HostnameTheme' => '',
'DefaultAvailabilityZone' => '',
'DefaultSubnetId' => '',
'CustomJson' => '',
'ConfigurationManager' => '',
'ChefConfiguration' => '',
'UseCustomCookbooks' => '',
'CustomCookbooksSource' => '',
'DefaultSshKeyName' => '',
'DefaultRootDeviceType' => '',
'UseOpsworksSecurityGroups' => '',
'AgentVersion' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateStack');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateStack' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": "",
"Name": "",
"Attributes": "",
"ServiceRoleArn": "",
"DefaultInstanceProfileArn": "",
"DefaultOs": "",
"HostnameTheme": "",
"DefaultAvailabilityZone": "",
"DefaultSubnetId": "",
"CustomJson": "",
"ConfigurationManager": "",
"ChefConfiguration": "",
"UseCustomCookbooks": "",
"CustomCookbooksSource": "",
"DefaultSshKeyName": "",
"DefaultRootDeviceType": "",
"UseOpsworksSecurityGroups": "",
"AgentVersion": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateStack' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StackId": "",
"Name": "",
"Attributes": "",
"ServiceRoleArn": "",
"DefaultInstanceProfileArn": "",
"DefaultOs": "",
"HostnameTheme": "",
"DefaultAvailabilityZone": "",
"DefaultSubnetId": "",
"CustomJson": "",
"ConfigurationManager": "",
"ChefConfiguration": "",
"UseCustomCookbooks": "",
"CustomCookbooksSource": "",
"DefaultSshKeyName": "",
"DefaultRootDeviceType": "",
"UseOpsworksSecurityGroups": "",
"AgentVersion": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"StackId\": \"\",\n \"Name\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"AgentVersion\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateStack"
payload = {
"StackId": "",
"Name": "",
"Attributes": "",
"ServiceRoleArn": "",
"DefaultInstanceProfileArn": "",
"DefaultOs": "",
"HostnameTheme": "",
"DefaultAvailabilityZone": "",
"DefaultSubnetId": "",
"CustomJson": "",
"ConfigurationManager": "",
"ChefConfiguration": "",
"UseCustomCookbooks": "",
"CustomCookbooksSource": "",
"DefaultSshKeyName": "",
"DefaultRootDeviceType": "",
"UseOpsworksSecurityGroups": "",
"AgentVersion": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateStack"
payload <- "{\n \"StackId\": \"\",\n \"Name\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"AgentVersion\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateStack")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"StackId\": \"\",\n \"Name\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"AgentVersion\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"StackId\": \"\",\n \"Name\": \"\",\n \"Attributes\": \"\",\n \"ServiceRoleArn\": \"\",\n \"DefaultInstanceProfileArn\": \"\",\n \"DefaultOs\": \"\",\n \"HostnameTheme\": \"\",\n \"DefaultAvailabilityZone\": \"\",\n \"DefaultSubnetId\": \"\",\n \"CustomJson\": \"\",\n \"ConfigurationManager\": \"\",\n \"ChefConfiguration\": \"\",\n \"UseCustomCookbooks\": \"\",\n \"CustomCookbooksSource\": \"\",\n \"DefaultSshKeyName\": \"\",\n \"DefaultRootDeviceType\": \"\",\n \"UseOpsworksSecurityGroups\": \"\",\n \"AgentVersion\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateStack";
let payload = json!({
"StackId": "",
"Name": "",
"Attributes": "",
"ServiceRoleArn": "",
"DefaultInstanceProfileArn": "",
"DefaultOs": "",
"HostnameTheme": "",
"DefaultAvailabilityZone": "",
"DefaultSubnetId": "",
"CustomJson": "",
"ConfigurationManager": "",
"ChefConfiguration": "",
"UseCustomCookbooks": "",
"CustomCookbooksSource": "",
"DefaultSshKeyName": "",
"DefaultRootDeviceType": "",
"UseOpsworksSecurityGroups": "",
"AgentVersion": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateStack' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"StackId": "",
"Name": "",
"Attributes": "",
"ServiceRoleArn": "",
"DefaultInstanceProfileArn": "",
"DefaultOs": "",
"HostnameTheme": "",
"DefaultAvailabilityZone": "",
"DefaultSubnetId": "",
"CustomJson": "",
"ConfigurationManager": "",
"ChefConfiguration": "",
"UseCustomCookbooks": "",
"CustomCookbooksSource": "",
"DefaultSshKeyName": "",
"DefaultRootDeviceType": "",
"UseOpsworksSecurityGroups": "",
"AgentVersion": ""
}'
echo '{
"StackId": "",
"Name": "",
"Attributes": "",
"ServiceRoleArn": "",
"DefaultInstanceProfileArn": "",
"DefaultOs": "",
"HostnameTheme": "",
"DefaultAvailabilityZone": "",
"DefaultSubnetId": "",
"CustomJson": "",
"ConfigurationManager": "",
"ChefConfiguration": "",
"UseCustomCookbooks": "",
"CustomCookbooksSource": "",
"DefaultSshKeyName": "",
"DefaultRootDeviceType": "",
"UseOpsworksSecurityGroups": "",
"AgentVersion": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateStack' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "StackId": "",\n "Name": "",\n "Attributes": "",\n "ServiceRoleArn": "",\n "DefaultInstanceProfileArn": "",\n "DefaultOs": "",\n "HostnameTheme": "",\n "DefaultAvailabilityZone": "",\n "DefaultSubnetId": "",\n "CustomJson": "",\n "ConfigurationManager": "",\n "ChefConfiguration": "",\n "UseCustomCookbooks": "",\n "CustomCookbooksSource": "",\n "DefaultSshKeyName": "",\n "DefaultRootDeviceType": "",\n "UseOpsworksSecurityGroups": "",\n "AgentVersion": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateStack'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"StackId": "",
"Name": "",
"Attributes": "",
"ServiceRoleArn": "",
"DefaultInstanceProfileArn": "",
"DefaultOs": "",
"HostnameTheme": "",
"DefaultAvailabilityZone": "",
"DefaultSubnetId": "",
"CustomJson": "",
"ConfigurationManager": "",
"ChefConfiguration": "",
"UseCustomCookbooks": "",
"CustomCookbooksSource": "",
"DefaultSshKeyName": "",
"DefaultRootDeviceType": "",
"UseOpsworksSecurityGroups": "",
"AgentVersion": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateStack")! 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
UpdateUserProfile
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateUserProfile
HEADERS
X-Amz-Target
BODY json
{
"IamUserArn": "",
"SshUsername": "",
"SshPublicKey": "",
"AllowSelfManagement": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateUserProfile");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"IamUserArn\": \"\",\n \"SshUsername\": \"\",\n \"SshPublicKey\": \"\",\n \"AllowSelfManagement\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateUserProfile" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IamUserArn ""
:SshUsername ""
:SshPublicKey ""
:AllowSelfManagement ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateUserProfile"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IamUserArn\": \"\",\n \"SshUsername\": \"\",\n \"SshPublicKey\": \"\",\n \"AllowSelfManagement\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateUserProfile"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IamUserArn\": \"\",\n \"SshUsername\": \"\",\n \"SshPublicKey\": \"\",\n \"AllowSelfManagement\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateUserProfile");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IamUserArn\": \"\",\n \"SshUsername\": \"\",\n \"SshPublicKey\": \"\",\n \"AllowSelfManagement\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateUserProfile"
payload := strings.NewReader("{\n \"IamUserArn\": \"\",\n \"SshUsername\": \"\",\n \"SshPublicKey\": \"\",\n \"AllowSelfManagement\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 94
{
"IamUserArn": "",
"SshUsername": "",
"SshPublicKey": "",
"AllowSelfManagement": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateUserProfile")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IamUserArn\": \"\",\n \"SshUsername\": \"\",\n \"SshPublicKey\": \"\",\n \"AllowSelfManagement\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateUserProfile"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IamUserArn\": \"\",\n \"SshUsername\": \"\",\n \"SshPublicKey\": \"\",\n \"AllowSelfManagement\": \"\"\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 \"IamUserArn\": \"\",\n \"SshUsername\": \"\",\n \"SshPublicKey\": \"\",\n \"AllowSelfManagement\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateUserProfile")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateUserProfile")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IamUserArn\": \"\",\n \"SshUsername\": \"\",\n \"SshPublicKey\": \"\",\n \"AllowSelfManagement\": \"\"\n}")
.asString();
const data = JSON.stringify({
IamUserArn: '',
SshUsername: '',
SshPublicKey: '',
AllowSelfManagement: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateUserProfile');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateUserProfile',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IamUserArn: '', SshUsername: '', SshPublicKey: '', AllowSelfManagement: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateUserProfile';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IamUserArn":"","SshUsername":"","SshPublicKey":"","AllowSelfManagement":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateUserProfile',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IamUserArn": "",\n "SshUsername": "",\n "SshPublicKey": "",\n "AllowSelfManagement": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"IamUserArn\": \"\",\n \"SshUsername\": \"\",\n \"SshPublicKey\": \"\",\n \"AllowSelfManagement\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateUserProfile")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({IamUserArn: '', SshUsername: '', SshPublicKey: '', AllowSelfManagement: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateUserProfile',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {IamUserArn: '', SshUsername: '', SshPublicKey: '', AllowSelfManagement: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateUserProfile');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IamUserArn: '',
SshUsername: '',
SshPublicKey: '',
AllowSelfManagement: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateUserProfile',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IamUserArn: '', SshUsername: '', SshPublicKey: '', AllowSelfManagement: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateUserProfile';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IamUserArn":"","SshUsername":"","SshPublicKey":"","AllowSelfManagement":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"IamUserArn": @"",
@"SshUsername": @"",
@"SshPublicKey": @"",
@"AllowSelfManagement": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateUserProfile"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateUserProfile" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IamUserArn\": \"\",\n \"SshUsername\": \"\",\n \"SshPublicKey\": \"\",\n \"AllowSelfManagement\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateUserProfile",
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([
'IamUserArn' => '',
'SshUsername' => '',
'SshPublicKey' => '',
'AllowSelfManagement' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateUserProfile', [
'body' => '{
"IamUserArn": "",
"SshUsername": "",
"SshPublicKey": "",
"AllowSelfManagement": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateUserProfile');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IamUserArn' => '',
'SshUsername' => '',
'SshPublicKey' => '',
'AllowSelfManagement' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IamUserArn' => '',
'SshUsername' => '',
'SshPublicKey' => '',
'AllowSelfManagement' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateUserProfile');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateUserProfile' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IamUserArn": "",
"SshUsername": "",
"SshPublicKey": "",
"AllowSelfManagement": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateUserProfile' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IamUserArn": "",
"SshUsername": "",
"SshPublicKey": "",
"AllowSelfManagement": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IamUserArn\": \"\",\n \"SshUsername\": \"\",\n \"SshPublicKey\": \"\",\n \"AllowSelfManagement\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateUserProfile"
payload = {
"IamUserArn": "",
"SshUsername": "",
"SshPublicKey": "",
"AllowSelfManagement": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateUserProfile"
payload <- "{\n \"IamUserArn\": \"\",\n \"SshUsername\": \"\",\n \"SshPublicKey\": \"\",\n \"AllowSelfManagement\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateUserProfile")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"IamUserArn\": \"\",\n \"SshUsername\": \"\",\n \"SshPublicKey\": \"\",\n \"AllowSelfManagement\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"IamUserArn\": \"\",\n \"SshUsername\": \"\",\n \"SshPublicKey\": \"\",\n \"AllowSelfManagement\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateUserProfile";
let payload = json!({
"IamUserArn": "",
"SshUsername": "",
"SshPublicKey": "",
"AllowSelfManagement": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateUserProfile' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IamUserArn": "",
"SshUsername": "",
"SshPublicKey": "",
"AllowSelfManagement": ""
}'
echo '{
"IamUserArn": "",
"SshUsername": "",
"SshPublicKey": "",
"AllowSelfManagement": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateUserProfile' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IamUserArn": "",\n "SshUsername": "",\n "SshPublicKey": "",\n "AllowSelfManagement": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateUserProfile'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"IamUserArn": "",
"SshUsername": "",
"SshPublicKey": "",
"AllowSelfManagement": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateUserProfile")! 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
UpdateVolume
{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateVolume
HEADERS
X-Amz-Target
BODY json
{
"VolumeId": "",
"Name": "",
"MountPoint": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateVolume");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"VolumeId\": \"\",\n \"Name\": \"\",\n \"MountPoint\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateVolume" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:VolumeId ""
:Name ""
:MountPoint ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateVolume"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"VolumeId\": \"\",\n \"Name\": \"\",\n \"MountPoint\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateVolume"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"VolumeId\": \"\",\n \"Name\": \"\",\n \"MountPoint\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateVolume");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"VolumeId\": \"\",\n \"Name\": \"\",\n \"MountPoint\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateVolume"
payload := strings.NewReader("{\n \"VolumeId\": \"\",\n \"Name\": \"\",\n \"MountPoint\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 54
{
"VolumeId": "",
"Name": "",
"MountPoint": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateVolume")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"VolumeId\": \"\",\n \"Name\": \"\",\n \"MountPoint\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateVolume"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"VolumeId\": \"\",\n \"Name\": \"\",\n \"MountPoint\": \"\"\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 \"VolumeId\": \"\",\n \"Name\": \"\",\n \"MountPoint\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateVolume")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateVolume")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"VolumeId\": \"\",\n \"Name\": \"\",\n \"MountPoint\": \"\"\n}")
.asString();
const data = JSON.stringify({
VolumeId: '',
Name: '',
MountPoint: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateVolume');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateVolume',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {VolumeId: '', Name: '', MountPoint: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateVolume';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"VolumeId":"","Name":"","MountPoint":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateVolume',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "VolumeId": "",\n "Name": "",\n "MountPoint": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"VolumeId\": \"\",\n \"Name\": \"\",\n \"MountPoint\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateVolume")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({VolumeId: '', Name: '', MountPoint: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateVolume',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {VolumeId: '', Name: '', MountPoint: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateVolume');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
VolumeId: '',
Name: '',
MountPoint: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateVolume',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {VolumeId: '', Name: '', MountPoint: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateVolume';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"VolumeId":"","Name":"","MountPoint":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"VolumeId": @"",
@"Name": @"",
@"MountPoint": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateVolume"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateVolume" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"VolumeId\": \"\",\n \"Name\": \"\",\n \"MountPoint\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateVolume",
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([
'VolumeId' => '',
'Name' => '',
'MountPoint' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateVolume', [
'body' => '{
"VolumeId": "",
"Name": "",
"MountPoint": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateVolume');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'VolumeId' => '',
'Name' => '',
'MountPoint' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'VolumeId' => '',
'Name' => '',
'MountPoint' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateVolume');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateVolume' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"VolumeId": "",
"Name": "",
"MountPoint": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateVolume' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"VolumeId": "",
"Name": "",
"MountPoint": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"VolumeId\": \"\",\n \"Name\": \"\",\n \"MountPoint\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateVolume"
payload = {
"VolumeId": "",
"Name": "",
"MountPoint": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateVolume"
payload <- "{\n \"VolumeId\": \"\",\n \"Name\": \"\",\n \"MountPoint\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateVolume")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"VolumeId\": \"\",\n \"Name\": \"\",\n \"MountPoint\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"VolumeId\": \"\",\n \"Name\": \"\",\n \"MountPoint\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateVolume";
let payload = json!({
"VolumeId": "",
"Name": "",
"MountPoint": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateVolume' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"VolumeId": "",
"Name": "",
"MountPoint": ""
}'
echo '{
"VolumeId": "",
"Name": "",
"MountPoint": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateVolume' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "VolumeId": "",\n "Name": "",\n "MountPoint": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateVolume'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"VolumeId": "",
"Name": "",
"MountPoint": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=OpsWorks_20130218.UpdateVolume")! 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()