AWS Global Accelerator
POST
AddCustomRoutingEndpoints
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AddCustomRoutingEndpoints
HEADERS
X-Amz-Target
BODY json
{
"EndpointConfigurations": "",
"EndpointGroupArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AddCustomRoutingEndpoints");
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 \"EndpointConfigurations\": \"\",\n \"EndpointGroupArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AddCustomRoutingEndpoints" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:EndpointConfigurations ""
:EndpointGroupArn ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AddCustomRoutingEndpoints"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"EndpointConfigurations\": \"\",\n \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.AddCustomRoutingEndpoints"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"EndpointConfigurations\": \"\",\n \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.AddCustomRoutingEndpoints");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"EndpointConfigurations\": \"\",\n \"EndpointGroupArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AddCustomRoutingEndpoints"
payload := strings.NewReader("{\n \"EndpointConfigurations\": \"\",\n \"EndpointGroupArn\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 60
{
"EndpointConfigurations": "",
"EndpointGroupArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AddCustomRoutingEndpoints")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"EndpointConfigurations\": \"\",\n \"EndpointGroupArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AddCustomRoutingEndpoints"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"EndpointConfigurations\": \"\",\n \"EndpointGroupArn\": \"\"\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 \"EndpointConfigurations\": \"\",\n \"EndpointGroupArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AddCustomRoutingEndpoints")
.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=GlobalAccelerator_V20180706.AddCustomRoutingEndpoints")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"EndpointConfigurations\": \"\",\n \"EndpointGroupArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
EndpointConfigurations: '',
EndpointGroupArn: ''
});
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=GlobalAccelerator_V20180706.AddCustomRoutingEndpoints');
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=GlobalAccelerator_V20180706.AddCustomRoutingEndpoints',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {EndpointConfigurations: '', EndpointGroupArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AddCustomRoutingEndpoints';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"EndpointConfigurations":"","EndpointGroupArn":""}'
};
try {
const response = await 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=GlobalAccelerator_V20180706.AddCustomRoutingEndpoints',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "EndpointConfigurations": "",\n "EndpointGroupArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"EndpointConfigurations\": \"\",\n \"EndpointGroupArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AddCustomRoutingEndpoints")
.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({EndpointConfigurations: '', EndpointGroupArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AddCustomRoutingEndpoints',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {EndpointConfigurations: '', EndpointGroupArn: ''},
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=GlobalAccelerator_V20180706.AddCustomRoutingEndpoints');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
EndpointConfigurations: '',
EndpointGroupArn: ''
});
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=GlobalAccelerator_V20180706.AddCustomRoutingEndpoints',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {EndpointConfigurations: '', EndpointGroupArn: ''}
};
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=GlobalAccelerator_V20180706.AddCustomRoutingEndpoints';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"EndpointConfigurations":"","EndpointGroupArn":""}'
};
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 = @{ @"EndpointConfigurations": @"",
@"EndpointGroupArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AddCustomRoutingEndpoints"]
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=GlobalAccelerator_V20180706.AddCustomRoutingEndpoints" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"EndpointConfigurations\": \"\",\n \"EndpointGroupArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AddCustomRoutingEndpoints",
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([
'EndpointConfigurations' => '',
'EndpointGroupArn' => ''
]),
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=GlobalAccelerator_V20180706.AddCustomRoutingEndpoints', [
'body' => '{
"EndpointConfigurations": "",
"EndpointGroupArn": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AddCustomRoutingEndpoints');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'EndpointConfigurations' => '',
'EndpointGroupArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'EndpointConfigurations' => '',
'EndpointGroupArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AddCustomRoutingEndpoints');
$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=GlobalAccelerator_V20180706.AddCustomRoutingEndpoints' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EndpointConfigurations": "",
"EndpointGroupArn": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AddCustomRoutingEndpoints' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EndpointConfigurations": "",
"EndpointGroupArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"EndpointConfigurations\": \"\",\n \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.AddCustomRoutingEndpoints"
payload = {
"EndpointConfigurations": "",
"EndpointGroupArn": ""
}
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=GlobalAccelerator_V20180706.AddCustomRoutingEndpoints"
payload <- "{\n \"EndpointConfigurations\": \"\",\n \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.AddCustomRoutingEndpoints")
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 \"EndpointConfigurations\": \"\",\n \"EndpointGroupArn\": \"\"\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 \"EndpointConfigurations\": \"\",\n \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.AddCustomRoutingEndpoints";
let payload = json!({
"EndpointConfigurations": "",
"EndpointGroupArn": ""
});
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=GlobalAccelerator_V20180706.AddCustomRoutingEndpoints' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"EndpointConfigurations": "",
"EndpointGroupArn": ""
}'
echo '{
"EndpointConfigurations": "",
"EndpointGroupArn": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AddCustomRoutingEndpoints' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "EndpointConfigurations": "",\n "EndpointGroupArn": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AddCustomRoutingEndpoints'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"EndpointConfigurations": "",
"EndpointGroupArn": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AddCustomRoutingEndpoints")! 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
AddEndpoints
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AddEndpoints
HEADERS
X-Amz-Target
BODY json
{
"EndpointConfigurations": "",
"EndpointGroupArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AddEndpoints");
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 \"EndpointConfigurations\": \"\",\n \"EndpointGroupArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AddEndpoints" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:EndpointConfigurations ""
:EndpointGroupArn ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AddEndpoints"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"EndpointConfigurations\": \"\",\n \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.AddEndpoints"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"EndpointConfigurations\": \"\",\n \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.AddEndpoints");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"EndpointConfigurations\": \"\",\n \"EndpointGroupArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AddEndpoints"
payload := strings.NewReader("{\n \"EndpointConfigurations\": \"\",\n \"EndpointGroupArn\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 60
{
"EndpointConfigurations": "",
"EndpointGroupArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AddEndpoints")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"EndpointConfigurations\": \"\",\n \"EndpointGroupArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AddEndpoints"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"EndpointConfigurations\": \"\",\n \"EndpointGroupArn\": \"\"\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 \"EndpointConfigurations\": \"\",\n \"EndpointGroupArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AddEndpoints")
.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=GlobalAccelerator_V20180706.AddEndpoints")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"EndpointConfigurations\": \"\",\n \"EndpointGroupArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
EndpointConfigurations: '',
EndpointGroupArn: ''
});
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=GlobalAccelerator_V20180706.AddEndpoints');
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=GlobalAccelerator_V20180706.AddEndpoints',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {EndpointConfigurations: '', EndpointGroupArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AddEndpoints';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"EndpointConfigurations":"","EndpointGroupArn":""}'
};
try {
const response = await 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=GlobalAccelerator_V20180706.AddEndpoints',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "EndpointConfigurations": "",\n "EndpointGroupArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"EndpointConfigurations\": \"\",\n \"EndpointGroupArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AddEndpoints")
.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({EndpointConfigurations: '', EndpointGroupArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AddEndpoints',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {EndpointConfigurations: '', EndpointGroupArn: ''},
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=GlobalAccelerator_V20180706.AddEndpoints');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
EndpointConfigurations: '',
EndpointGroupArn: ''
});
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=GlobalAccelerator_V20180706.AddEndpoints',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {EndpointConfigurations: '', EndpointGroupArn: ''}
};
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=GlobalAccelerator_V20180706.AddEndpoints';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"EndpointConfigurations":"","EndpointGroupArn":""}'
};
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 = @{ @"EndpointConfigurations": @"",
@"EndpointGroupArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AddEndpoints"]
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=GlobalAccelerator_V20180706.AddEndpoints" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"EndpointConfigurations\": \"\",\n \"EndpointGroupArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AddEndpoints",
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([
'EndpointConfigurations' => '',
'EndpointGroupArn' => ''
]),
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=GlobalAccelerator_V20180706.AddEndpoints', [
'body' => '{
"EndpointConfigurations": "",
"EndpointGroupArn": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AddEndpoints');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'EndpointConfigurations' => '',
'EndpointGroupArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'EndpointConfigurations' => '',
'EndpointGroupArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AddEndpoints');
$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=GlobalAccelerator_V20180706.AddEndpoints' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EndpointConfigurations": "",
"EndpointGroupArn": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AddEndpoints' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EndpointConfigurations": "",
"EndpointGroupArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"EndpointConfigurations\": \"\",\n \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.AddEndpoints"
payload = {
"EndpointConfigurations": "",
"EndpointGroupArn": ""
}
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=GlobalAccelerator_V20180706.AddEndpoints"
payload <- "{\n \"EndpointConfigurations\": \"\",\n \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.AddEndpoints")
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 \"EndpointConfigurations\": \"\",\n \"EndpointGroupArn\": \"\"\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 \"EndpointConfigurations\": \"\",\n \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.AddEndpoints";
let payload = json!({
"EndpointConfigurations": "",
"EndpointGroupArn": ""
});
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=GlobalAccelerator_V20180706.AddEndpoints' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"EndpointConfigurations": "",
"EndpointGroupArn": ""
}'
echo '{
"EndpointConfigurations": "",
"EndpointGroupArn": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AddEndpoints' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "EndpointConfigurations": "",\n "EndpointGroupArn": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AddEndpoints'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"EndpointConfigurations": "",
"EndpointGroupArn": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AddEndpoints")! 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
AdvertiseByoipCidr
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AdvertiseByoipCidr
HEADERS
X-Amz-Target
BODY json
{
"Cidr": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AdvertiseByoipCidr");
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 \"Cidr\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AdvertiseByoipCidr" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Cidr ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AdvertiseByoipCidr"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Cidr\": \"\"\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=GlobalAccelerator_V20180706.AdvertiseByoipCidr"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Cidr\": \"\"\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=GlobalAccelerator_V20180706.AdvertiseByoipCidr");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Cidr\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AdvertiseByoipCidr"
payload := strings.NewReader("{\n \"Cidr\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 16
{
"Cidr": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AdvertiseByoipCidr")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Cidr\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AdvertiseByoipCidr"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Cidr\": \"\"\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 \"Cidr\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AdvertiseByoipCidr")
.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=GlobalAccelerator_V20180706.AdvertiseByoipCidr")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Cidr\": \"\"\n}")
.asString();
const data = JSON.stringify({
Cidr: ''
});
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=GlobalAccelerator_V20180706.AdvertiseByoipCidr');
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=GlobalAccelerator_V20180706.AdvertiseByoipCidr',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Cidr: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AdvertiseByoipCidr';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Cidr":""}'
};
try {
const response = await 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=GlobalAccelerator_V20180706.AdvertiseByoipCidr',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Cidr": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Cidr\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AdvertiseByoipCidr")
.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({Cidr: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AdvertiseByoipCidr',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Cidr: ''},
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=GlobalAccelerator_V20180706.AdvertiseByoipCidr');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Cidr: ''
});
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=GlobalAccelerator_V20180706.AdvertiseByoipCidr',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Cidr: ''}
};
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=GlobalAccelerator_V20180706.AdvertiseByoipCidr';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Cidr":""}'
};
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 = @{ @"Cidr": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AdvertiseByoipCidr"]
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=GlobalAccelerator_V20180706.AdvertiseByoipCidr" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Cidr\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AdvertiseByoipCidr",
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([
'Cidr' => ''
]),
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=GlobalAccelerator_V20180706.AdvertiseByoipCidr', [
'body' => '{
"Cidr": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AdvertiseByoipCidr');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Cidr' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Cidr' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AdvertiseByoipCidr');
$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=GlobalAccelerator_V20180706.AdvertiseByoipCidr' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Cidr": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AdvertiseByoipCidr' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Cidr": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Cidr\": \"\"\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=GlobalAccelerator_V20180706.AdvertiseByoipCidr"
payload = { "Cidr": "" }
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=GlobalAccelerator_V20180706.AdvertiseByoipCidr"
payload <- "{\n \"Cidr\": \"\"\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=GlobalAccelerator_V20180706.AdvertiseByoipCidr")
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 \"Cidr\": \"\"\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 \"Cidr\": \"\"\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=GlobalAccelerator_V20180706.AdvertiseByoipCidr";
let payload = json!({"Cidr": ""});
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=GlobalAccelerator_V20180706.AdvertiseByoipCidr' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Cidr": ""
}'
echo '{
"Cidr": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AdvertiseByoipCidr' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Cidr": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AdvertiseByoipCidr'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["Cidr": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AdvertiseByoipCidr")! 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
AllowCustomRoutingTraffic
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AllowCustomRoutingTraffic
HEADERS
X-Amz-Target
BODY json
{
"EndpointGroupArn": "",
"EndpointId": "",
"DestinationAddresses": "",
"DestinationPorts": "",
"AllowAllTrafficToEndpoint": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AllowCustomRoutingTraffic");
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 \"EndpointGroupArn\": \"\",\n \"EndpointId\": \"\",\n \"DestinationAddresses\": \"\",\n \"DestinationPorts\": \"\",\n \"AllowAllTrafficToEndpoint\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AllowCustomRoutingTraffic" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:EndpointGroupArn ""
:EndpointId ""
:DestinationAddresses ""
:DestinationPorts ""
:AllowAllTrafficToEndpoint ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AllowCustomRoutingTraffic"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"EndpointGroupArn\": \"\",\n \"EndpointId\": \"\",\n \"DestinationAddresses\": \"\",\n \"DestinationPorts\": \"\",\n \"AllowAllTrafficToEndpoint\": \"\"\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=GlobalAccelerator_V20180706.AllowCustomRoutingTraffic"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"EndpointGroupArn\": \"\",\n \"EndpointId\": \"\",\n \"DestinationAddresses\": \"\",\n \"DestinationPorts\": \"\",\n \"AllowAllTrafficToEndpoint\": \"\"\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=GlobalAccelerator_V20180706.AllowCustomRoutingTraffic");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"EndpointGroupArn\": \"\",\n \"EndpointId\": \"\",\n \"DestinationAddresses\": \"\",\n \"DestinationPorts\": \"\",\n \"AllowAllTrafficToEndpoint\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AllowCustomRoutingTraffic"
payload := strings.NewReader("{\n \"EndpointGroupArn\": \"\",\n \"EndpointId\": \"\",\n \"DestinationAddresses\": \"\",\n \"DestinationPorts\": \"\",\n \"AllowAllTrafficToEndpoint\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 139
{
"EndpointGroupArn": "",
"EndpointId": "",
"DestinationAddresses": "",
"DestinationPorts": "",
"AllowAllTrafficToEndpoint": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AllowCustomRoutingTraffic")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"EndpointGroupArn\": \"\",\n \"EndpointId\": \"\",\n \"DestinationAddresses\": \"\",\n \"DestinationPorts\": \"\",\n \"AllowAllTrafficToEndpoint\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AllowCustomRoutingTraffic"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"EndpointGroupArn\": \"\",\n \"EndpointId\": \"\",\n \"DestinationAddresses\": \"\",\n \"DestinationPorts\": \"\",\n \"AllowAllTrafficToEndpoint\": \"\"\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 \"EndpointGroupArn\": \"\",\n \"EndpointId\": \"\",\n \"DestinationAddresses\": \"\",\n \"DestinationPorts\": \"\",\n \"AllowAllTrafficToEndpoint\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AllowCustomRoutingTraffic")
.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=GlobalAccelerator_V20180706.AllowCustomRoutingTraffic")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"EndpointGroupArn\": \"\",\n \"EndpointId\": \"\",\n \"DestinationAddresses\": \"\",\n \"DestinationPorts\": \"\",\n \"AllowAllTrafficToEndpoint\": \"\"\n}")
.asString();
const data = JSON.stringify({
EndpointGroupArn: '',
EndpointId: '',
DestinationAddresses: '',
DestinationPorts: '',
AllowAllTrafficToEndpoint: ''
});
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=GlobalAccelerator_V20180706.AllowCustomRoutingTraffic');
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=GlobalAccelerator_V20180706.AllowCustomRoutingTraffic',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
EndpointGroupArn: '',
EndpointId: '',
DestinationAddresses: '',
DestinationPorts: '',
AllowAllTrafficToEndpoint: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AllowCustomRoutingTraffic';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"EndpointGroupArn":"","EndpointId":"","DestinationAddresses":"","DestinationPorts":"","AllowAllTrafficToEndpoint":""}'
};
try {
const response = await 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=GlobalAccelerator_V20180706.AllowCustomRoutingTraffic',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "EndpointGroupArn": "",\n "EndpointId": "",\n "DestinationAddresses": "",\n "DestinationPorts": "",\n "AllowAllTrafficToEndpoint": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"EndpointGroupArn\": \"\",\n \"EndpointId\": \"\",\n \"DestinationAddresses\": \"\",\n \"DestinationPorts\": \"\",\n \"AllowAllTrafficToEndpoint\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AllowCustomRoutingTraffic")
.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({
EndpointGroupArn: '',
EndpointId: '',
DestinationAddresses: '',
DestinationPorts: '',
AllowAllTrafficToEndpoint: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AllowCustomRoutingTraffic',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
EndpointGroupArn: '',
EndpointId: '',
DestinationAddresses: '',
DestinationPorts: '',
AllowAllTrafficToEndpoint: ''
},
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=GlobalAccelerator_V20180706.AllowCustomRoutingTraffic');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
EndpointGroupArn: '',
EndpointId: '',
DestinationAddresses: '',
DestinationPorts: '',
AllowAllTrafficToEndpoint: ''
});
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=GlobalAccelerator_V20180706.AllowCustomRoutingTraffic',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
EndpointGroupArn: '',
EndpointId: '',
DestinationAddresses: '',
DestinationPorts: '',
AllowAllTrafficToEndpoint: ''
}
};
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=GlobalAccelerator_V20180706.AllowCustomRoutingTraffic';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"EndpointGroupArn":"","EndpointId":"","DestinationAddresses":"","DestinationPorts":"","AllowAllTrafficToEndpoint":""}'
};
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 = @{ @"EndpointGroupArn": @"",
@"EndpointId": @"",
@"DestinationAddresses": @"",
@"DestinationPorts": @"",
@"AllowAllTrafficToEndpoint": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AllowCustomRoutingTraffic"]
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=GlobalAccelerator_V20180706.AllowCustomRoutingTraffic" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"EndpointGroupArn\": \"\",\n \"EndpointId\": \"\",\n \"DestinationAddresses\": \"\",\n \"DestinationPorts\": \"\",\n \"AllowAllTrafficToEndpoint\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AllowCustomRoutingTraffic",
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([
'EndpointGroupArn' => '',
'EndpointId' => '',
'DestinationAddresses' => '',
'DestinationPorts' => '',
'AllowAllTrafficToEndpoint' => ''
]),
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=GlobalAccelerator_V20180706.AllowCustomRoutingTraffic', [
'body' => '{
"EndpointGroupArn": "",
"EndpointId": "",
"DestinationAddresses": "",
"DestinationPorts": "",
"AllowAllTrafficToEndpoint": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AllowCustomRoutingTraffic');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'EndpointGroupArn' => '',
'EndpointId' => '',
'DestinationAddresses' => '',
'DestinationPorts' => '',
'AllowAllTrafficToEndpoint' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'EndpointGroupArn' => '',
'EndpointId' => '',
'DestinationAddresses' => '',
'DestinationPorts' => '',
'AllowAllTrafficToEndpoint' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AllowCustomRoutingTraffic');
$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=GlobalAccelerator_V20180706.AllowCustomRoutingTraffic' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EndpointGroupArn": "",
"EndpointId": "",
"DestinationAddresses": "",
"DestinationPorts": "",
"AllowAllTrafficToEndpoint": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AllowCustomRoutingTraffic' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EndpointGroupArn": "",
"EndpointId": "",
"DestinationAddresses": "",
"DestinationPorts": "",
"AllowAllTrafficToEndpoint": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"EndpointGroupArn\": \"\",\n \"EndpointId\": \"\",\n \"DestinationAddresses\": \"\",\n \"DestinationPorts\": \"\",\n \"AllowAllTrafficToEndpoint\": \"\"\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=GlobalAccelerator_V20180706.AllowCustomRoutingTraffic"
payload = {
"EndpointGroupArn": "",
"EndpointId": "",
"DestinationAddresses": "",
"DestinationPorts": "",
"AllowAllTrafficToEndpoint": ""
}
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=GlobalAccelerator_V20180706.AllowCustomRoutingTraffic"
payload <- "{\n \"EndpointGroupArn\": \"\",\n \"EndpointId\": \"\",\n \"DestinationAddresses\": \"\",\n \"DestinationPorts\": \"\",\n \"AllowAllTrafficToEndpoint\": \"\"\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=GlobalAccelerator_V20180706.AllowCustomRoutingTraffic")
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 \"EndpointGroupArn\": \"\",\n \"EndpointId\": \"\",\n \"DestinationAddresses\": \"\",\n \"DestinationPorts\": \"\",\n \"AllowAllTrafficToEndpoint\": \"\"\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 \"EndpointGroupArn\": \"\",\n \"EndpointId\": \"\",\n \"DestinationAddresses\": \"\",\n \"DestinationPorts\": \"\",\n \"AllowAllTrafficToEndpoint\": \"\"\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=GlobalAccelerator_V20180706.AllowCustomRoutingTraffic";
let payload = json!({
"EndpointGroupArn": "",
"EndpointId": "",
"DestinationAddresses": "",
"DestinationPorts": "",
"AllowAllTrafficToEndpoint": ""
});
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=GlobalAccelerator_V20180706.AllowCustomRoutingTraffic' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"EndpointGroupArn": "",
"EndpointId": "",
"DestinationAddresses": "",
"DestinationPorts": "",
"AllowAllTrafficToEndpoint": ""
}'
echo '{
"EndpointGroupArn": "",
"EndpointId": "",
"DestinationAddresses": "",
"DestinationPorts": "",
"AllowAllTrafficToEndpoint": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AllowCustomRoutingTraffic' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "EndpointGroupArn": "",\n "EndpointId": "",\n "DestinationAddresses": "",\n "DestinationPorts": "",\n "AllowAllTrafficToEndpoint": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AllowCustomRoutingTraffic'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"EndpointGroupArn": "",
"EndpointId": "",
"DestinationAddresses": "",
"DestinationPorts": "",
"AllowAllTrafficToEndpoint": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.AllowCustomRoutingTraffic")! 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
CreateAccelerator
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateAccelerator
HEADERS
X-Amz-Target
BODY json
{
"Name": "",
"IpAddressType": "",
"IpAddresses": "",
"Enabled": "",
"IdempotencyToken": "",
"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=GlobalAccelerator_V20180706.CreateAccelerator");
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 \"IpAddressType\": \"\",\n \"IpAddresses\": \"\",\n \"Enabled\": \"\",\n \"IdempotencyToken\": \"\",\n \"Tags\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateAccelerator" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Name ""
:IpAddressType ""
:IpAddresses ""
:Enabled ""
:IdempotencyToken ""
:Tags ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateAccelerator"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"IpAddresses\": \"\",\n \"Enabled\": \"\",\n \"IdempotencyToken\": \"\",\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=GlobalAccelerator_V20180706.CreateAccelerator"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"IpAddresses\": \"\",\n \"Enabled\": \"\",\n \"IdempotencyToken\": \"\",\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=GlobalAccelerator_V20180706.CreateAccelerator");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"IpAddresses\": \"\",\n \"Enabled\": \"\",\n \"IdempotencyToken\": \"\",\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=GlobalAccelerator_V20180706.CreateAccelerator"
payload := strings.NewReader("{\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"IpAddresses\": \"\",\n \"Enabled\": \"\",\n \"IdempotencyToken\": \"\",\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: 117
{
"Name": "",
"IpAddressType": "",
"IpAddresses": "",
"Enabled": "",
"IdempotencyToken": "",
"Tags": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateAccelerator")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"IpAddresses\": \"\",\n \"Enabled\": \"\",\n \"IdempotencyToken\": \"\",\n \"Tags\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateAccelerator"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"IpAddresses\": \"\",\n \"Enabled\": \"\",\n \"IdempotencyToken\": \"\",\n \"Tags\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"IpAddresses\": \"\",\n \"Enabled\": \"\",\n \"IdempotencyToken\": \"\",\n \"Tags\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateAccelerator")
.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=GlobalAccelerator_V20180706.CreateAccelerator")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"IpAddresses\": \"\",\n \"Enabled\": \"\",\n \"IdempotencyToken\": \"\",\n \"Tags\": \"\"\n}")
.asString();
const data = JSON.stringify({
Name: '',
IpAddressType: '',
IpAddresses: '',
Enabled: '',
IdempotencyToken: '',
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=GlobalAccelerator_V20180706.CreateAccelerator');
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=GlobalAccelerator_V20180706.CreateAccelerator',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Name: '',
IpAddressType: '',
IpAddresses: '',
Enabled: '',
IdempotencyToken: '',
Tags: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateAccelerator';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","IpAddressType":"","IpAddresses":"","Enabled":"","IdempotencyToken":"","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=GlobalAccelerator_V20180706.CreateAccelerator',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Name": "",\n "IpAddressType": "",\n "IpAddresses": "",\n "Enabled": "",\n "IdempotencyToken": "",\n "Tags": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"IpAddresses\": \"\",\n \"Enabled\": \"\",\n \"IdempotencyToken\": \"\",\n \"Tags\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateAccelerator")
.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: '',
IpAddressType: '',
IpAddresses: '',
Enabled: '',
IdempotencyToken: '',
Tags: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateAccelerator',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
Name: '',
IpAddressType: '',
IpAddresses: '',
Enabled: '',
IdempotencyToken: '',
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=GlobalAccelerator_V20180706.CreateAccelerator');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Name: '',
IpAddressType: '',
IpAddresses: '',
Enabled: '',
IdempotencyToken: '',
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=GlobalAccelerator_V20180706.CreateAccelerator',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Name: '',
IpAddressType: '',
IpAddresses: '',
Enabled: '',
IdempotencyToken: '',
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=GlobalAccelerator_V20180706.CreateAccelerator';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","IpAddressType":"","IpAddresses":"","Enabled":"","IdempotencyToken":"","Tags":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"Name": @"",
@"IpAddressType": @"",
@"IpAddresses": @"",
@"Enabled": @"",
@"IdempotencyToken": @"",
@"Tags": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateAccelerator"]
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=GlobalAccelerator_V20180706.CreateAccelerator" 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 \"IpAddressType\": \"\",\n \"IpAddresses\": \"\",\n \"Enabled\": \"\",\n \"IdempotencyToken\": \"\",\n \"Tags\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateAccelerator",
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' => '',
'IpAddressType' => '',
'IpAddresses' => '',
'Enabled' => '',
'IdempotencyToken' => '',
'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=GlobalAccelerator_V20180706.CreateAccelerator', [
'body' => '{
"Name": "",
"IpAddressType": "",
"IpAddresses": "",
"Enabled": "",
"IdempotencyToken": "",
"Tags": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateAccelerator');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Name' => '',
'IpAddressType' => '',
'IpAddresses' => '',
'Enabled' => '',
'IdempotencyToken' => '',
'Tags' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Name' => '',
'IpAddressType' => '',
'IpAddresses' => '',
'Enabled' => '',
'IdempotencyToken' => '',
'Tags' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateAccelerator');
$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=GlobalAccelerator_V20180706.CreateAccelerator' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"IpAddressType": "",
"IpAddresses": "",
"Enabled": "",
"IdempotencyToken": "",
"Tags": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateAccelerator' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"IpAddressType": "",
"IpAddresses": "",
"Enabled": "",
"IdempotencyToken": "",
"Tags": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"IpAddresses\": \"\",\n \"Enabled\": \"\",\n \"IdempotencyToken\": \"\",\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=GlobalAccelerator_V20180706.CreateAccelerator"
payload = {
"Name": "",
"IpAddressType": "",
"IpAddresses": "",
"Enabled": "",
"IdempotencyToken": "",
"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=GlobalAccelerator_V20180706.CreateAccelerator"
payload <- "{\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"IpAddresses\": \"\",\n \"Enabled\": \"\",\n \"IdempotencyToken\": \"\",\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=GlobalAccelerator_V20180706.CreateAccelerator")
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 \"IpAddressType\": \"\",\n \"IpAddresses\": \"\",\n \"Enabled\": \"\",\n \"IdempotencyToken\": \"\",\n \"Tags\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"IpAddresses\": \"\",\n \"Enabled\": \"\",\n \"IdempotencyToken\": \"\",\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=GlobalAccelerator_V20180706.CreateAccelerator";
let payload = json!({
"Name": "",
"IpAddressType": "",
"IpAddresses": "",
"Enabled": "",
"IdempotencyToken": "",
"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=GlobalAccelerator_V20180706.CreateAccelerator' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Name": "",
"IpAddressType": "",
"IpAddresses": "",
"Enabled": "",
"IdempotencyToken": "",
"Tags": ""
}'
echo '{
"Name": "",
"IpAddressType": "",
"IpAddresses": "",
"Enabled": "",
"IdempotencyToken": "",
"Tags": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateAccelerator' \
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 "IpAddressType": "",\n "IpAddresses": "",\n "Enabled": "",\n "IdempotencyToken": "",\n "Tags": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateAccelerator'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Name": "",
"IpAddressType": "",
"IpAddresses": "",
"Enabled": "",
"IdempotencyToken": "",
"Tags": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateAccelerator")! 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
CreateCustomRoutingAccelerator
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator
HEADERS
X-Amz-Target
BODY json
{
"Name": "",
"IpAddressType": "",
"IpAddresses": "",
"Enabled": "",
"IdempotencyToken": "",
"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=GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator");
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 \"IpAddressType\": \"\",\n \"IpAddresses\": \"\",\n \"Enabled\": \"\",\n \"IdempotencyToken\": \"\",\n \"Tags\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Name ""
:IpAddressType ""
:IpAddresses ""
:Enabled ""
:IdempotencyToken ""
:Tags ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"IpAddresses\": \"\",\n \"Enabled\": \"\",\n \"IdempotencyToken\": \"\",\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=GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"IpAddresses\": \"\",\n \"Enabled\": \"\",\n \"IdempotencyToken\": \"\",\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=GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"IpAddresses\": \"\",\n \"Enabled\": \"\",\n \"IdempotencyToken\": \"\",\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=GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator"
payload := strings.NewReader("{\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"IpAddresses\": \"\",\n \"Enabled\": \"\",\n \"IdempotencyToken\": \"\",\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: 117
{
"Name": "",
"IpAddressType": "",
"IpAddresses": "",
"Enabled": "",
"IdempotencyToken": "",
"Tags": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"IpAddresses\": \"\",\n \"Enabled\": \"\",\n \"IdempotencyToken\": \"\",\n \"Tags\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"IpAddresses\": \"\",\n \"Enabled\": \"\",\n \"IdempotencyToken\": \"\",\n \"Tags\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"IpAddresses\": \"\",\n \"Enabled\": \"\",\n \"IdempotencyToken\": \"\",\n \"Tags\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator")
.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=GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"IpAddresses\": \"\",\n \"Enabled\": \"\",\n \"IdempotencyToken\": \"\",\n \"Tags\": \"\"\n}")
.asString();
const data = JSON.stringify({
Name: '',
IpAddressType: '',
IpAddresses: '',
Enabled: '',
IdempotencyToken: '',
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=GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator');
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=GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Name: '',
IpAddressType: '',
IpAddresses: '',
Enabled: '',
IdempotencyToken: '',
Tags: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","IpAddressType":"","IpAddresses":"","Enabled":"","IdempotencyToken":"","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=GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Name": "",\n "IpAddressType": "",\n "IpAddresses": "",\n "Enabled": "",\n "IdempotencyToken": "",\n "Tags": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"IpAddresses\": \"\",\n \"Enabled\": \"\",\n \"IdempotencyToken\": \"\",\n \"Tags\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator")
.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: '',
IpAddressType: '',
IpAddresses: '',
Enabled: '',
IdempotencyToken: '',
Tags: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
Name: '',
IpAddressType: '',
IpAddresses: '',
Enabled: '',
IdempotencyToken: '',
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=GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Name: '',
IpAddressType: '',
IpAddresses: '',
Enabled: '',
IdempotencyToken: '',
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=GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Name: '',
IpAddressType: '',
IpAddresses: '',
Enabled: '',
IdempotencyToken: '',
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=GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","IpAddressType":"","IpAddresses":"","Enabled":"","IdempotencyToken":"","Tags":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"Name": @"",
@"IpAddressType": @"",
@"IpAddresses": @"",
@"Enabled": @"",
@"IdempotencyToken": @"",
@"Tags": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator"]
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=GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator" 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 \"IpAddressType\": \"\",\n \"IpAddresses\": \"\",\n \"Enabled\": \"\",\n \"IdempotencyToken\": \"\",\n \"Tags\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator",
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' => '',
'IpAddressType' => '',
'IpAddresses' => '',
'Enabled' => '',
'IdempotencyToken' => '',
'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=GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator', [
'body' => '{
"Name": "",
"IpAddressType": "",
"IpAddresses": "",
"Enabled": "",
"IdempotencyToken": "",
"Tags": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Name' => '',
'IpAddressType' => '',
'IpAddresses' => '',
'Enabled' => '',
'IdempotencyToken' => '',
'Tags' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Name' => '',
'IpAddressType' => '',
'IpAddresses' => '',
'Enabled' => '',
'IdempotencyToken' => '',
'Tags' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator');
$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=GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"IpAddressType": "",
"IpAddresses": "",
"Enabled": "",
"IdempotencyToken": "",
"Tags": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"IpAddressType": "",
"IpAddresses": "",
"Enabled": "",
"IdempotencyToken": "",
"Tags": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"IpAddresses\": \"\",\n \"Enabled\": \"\",\n \"IdempotencyToken\": \"\",\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=GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator"
payload = {
"Name": "",
"IpAddressType": "",
"IpAddresses": "",
"Enabled": "",
"IdempotencyToken": "",
"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=GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator"
payload <- "{\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"IpAddresses\": \"\",\n \"Enabled\": \"\",\n \"IdempotencyToken\": \"\",\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=GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator")
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 \"IpAddressType\": \"\",\n \"IpAddresses\": \"\",\n \"Enabled\": \"\",\n \"IdempotencyToken\": \"\",\n \"Tags\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"IpAddresses\": \"\",\n \"Enabled\": \"\",\n \"IdempotencyToken\": \"\",\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=GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator";
let payload = json!({
"Name": "",
"IpAddressType": "",
"IpAddresses": "",
"Enabled": "",
"IdempotencyToken": "",
"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=GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Name": "",
"IpAddressType": "",
"IpAddresses": "",
"Enabled": "",
"IdempotencyToken": "",
"Tags": ""
}'
echo '{
"Name": "",
"IpAddressType": "",
"IpAddresses": "",
"Enabled": "",
"IdempotencyToken": "",
"Tags": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator' \
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 "IpAddressType": "",\n "IpAddresses": "",\n "Enabled": "",\n "IdempotencyToken": "",\n "Tags": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Name": "",
"IpAddressType": "",
"IpAddresses": "",
"Enabled": "",
"IdempotencyToken": "",
"Tags": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator")! 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
CreateCustomRoutingEndpointGroup
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup
HEADERS
X-Amz-Target
BODY json
{
"ListenerArn": "",
"EndpointGroupRegion": "",
"DestinationConfigurations": "",
"IdempotencyToken": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup");
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 \"ListenerArn\": \"\",\n \"EndpointGroupRegion\": \"\",\n \"DestinationConfigurations\": \"\",\n \"IdempotencyToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ListenerArn ""
:EndpointGroupRegion ""
:DestinationConfigurations ""
:IdempotencyToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ListenerArn\": \"\",\n \"EndpointGroupRegion\": \"\",\n \"DestinationConfigurations\": \"\",\n \"IdempotencyToken\": \"\"\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=GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ListenerArn\": \"\",\n \"EndpointGroupRegion\": \"\",\n \"DestinationConfigurations\": \"\",\n \"IdempotencyToken\": \"\"\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=GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ListenerArn\": \"\",\n \"EndpointGroupRegion\": \"\",\n \"DestinationConfigurations\": \"\",\n \"IdempotencyToken\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup"
payload := strings.NewReader("{\n \"ListenerArn\": \"\",\n \"EndpointGroupRegion\": \"\",\n \"DestinationConfigurations\": \"\",\n \"IdempotencyToken\": \"\"\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: 113
{
"ListenerArn": "",
"EndpointGroupRegion": "",
"DestinationConfigurations": "",
"IdempotencyToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ListenerArn\": \"\",\n \"EndpointGroupRegion\": \"\",\n \"DestinationConfigurations\": \"\",\n \"IdempotencyToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ListenerArn\": \"\",\n \"EndpointGroupRegion\": \"\",\n \"DestinationConfigurations\": \"\",\n \"IdempotencyToken\": \"\"\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 \"ListenerArn\": \"\",\n \"EndpointGroupRegion\": \"\",\n \"DestinationConfigurations\": \"\",\n \"IdempotencyToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup")
.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=GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ListenerArn\": \"\",\n \"EndpointGroupRegion\": \"\",\n \"DestinationConfigurations\": \"\",\n \"IdempotencyToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
ListenerArn: '',
EndpointGroupRegion: '',
DestinationConfigurations: '',
IdempotencyToken: ''
});
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=GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup');
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=GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
ListenerArn: '',
EndpointGroupRegion: '',
DestinationConfigurations: '',
IdempotencyToken: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ListenerArn":"","EndpointGroupRegion":"","DestinationConfigurations":"","IdempotencyToken":""}'
};
try {
const response = await 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=GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ListenerArn": "",\n "EndpointGroupRegion": "",\n "DestinationConfigurations": "",\n "IdempotencyToken": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ListenerArn\": \"\",\n \"EndpointGroupRegion\": \"\",\n \"DestinationConfigurations\": \"\",\n \"IdempotencyToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup")
.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({
ListenerArn: '',
EndpointGroupRegion: '',
DestinationConfigurations: '',
IdempotencyToken: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
ListenerArn: '',
EndpointGroupRegion: '',
DestinationConfigurations: '',
IdempotencyToken: ''
},
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=GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ListenerArn: '',
EndpointGroupRegion: '',
DestinationConfigurations: '',
IdempotencyToken: ''
});
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=GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
ListenerArn: '',
EndpointGroupRegion: '',
DestinationConfigurations: '',
IdempotencyToken: ''
}
};
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=GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ListenerArn":"","EndpointGroupRegion":"","DestinationConfigurations":"","IdempotencyToken":""}'
};
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 = @{ @"ListenerArn": @"",
@"EndpointGroupRegion": @"",
@"DestinationConfigurations": @"",
@"IdempotencyToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup"]
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=GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"ListenerArn\": \"\",\n \"EndpointGroupRegion\": \"\",\n \"DestinationConfigurations\": \"\",\n \"IdempotencyToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup",
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([
'ListenerArn' => '',
'EndpointGroupRegion' => '',
'DestinationConfigurations' => '',
'IdempotencyToken' => ''
]),
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=GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup', [
'body' => '{
"ListenerArn": "",
"EndpointGroupRegion": "",
"DestinationConfigurations": "",
"IdempotencyToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ListenerArn' => '',
'EndpointGroupRegion' => '',
'DestinationConfigurations' => '',
'IdempotencyToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ListenerArn' => '',
'EndpointGroupRegion' => '',
'DestinationConfigurations' => '',
'IdempotencyToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup');
$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=GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ListenerArn": "",
"EndpointGroupRegion": "",
"DestinationConfigurations": "",
"IdempotencyToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ListenerArn": "",
"EndpointGroupRegion": "",
"DestinationConfigurations": "",
"IdempotencyToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ListenerArn\": \"\",\n \"EndpointGroupRegion\": \"\",\n \"DestinationConfigurations\": \"\",\n \"IdempotencyToken\": \"\"\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=GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup"
payload = {
"ListenerArn": "",
"EndpointGroupRegion": "",
"DestinationConfigurations": "",
"IdempotencyToken": ""
}
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=GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup"
payload <- "{\n \"ListenerArn\": \"\",\n \"EndpointGroupRegion\": \"\",\n \"DestinationConfigurations\": \"\",\n \"IdempotencyToken\": \"\"\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=GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup")
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 \"ListenerArn\": \"\",\n \"EndpointGroupRegion\": \"\",\n \"DestinationConfigurations\": \"\",\n \"IdempotencyToken\": \"\"\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 \"ListenerArn\": \"\",\n \"EndpointGroupRegion\": \"\",\n \"DestinationConfigurations\": \"\",\n \"IdempotencyToken\": \"\"\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=GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup";
let payload = json!({
"ListenerArn": "",
"EndpointGroupRegion": "",
"DestinationConfigurations": "",
"IdempotencyToken": ""
});
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=GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ListenerArn": "",
"EndpointGroupRegion": "",
"DestinationConfigurations": "",
"IdempotencyToken": ""
}'
echo '{
"ListenerArn": "",
"EndpointGroupRegion": "",
"DestinationConfigurations": "",
"IdempotencyToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ListenerArn": "",\n "EndpointGroupRegion": "",\n "DestinationConfigurations": "",\n "IdempotencyToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"ListenerArn": "",
"EndpointGroupRegion": "",
"DestinationConfigurations": "",
"IdempotencyToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup")! 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
CreateCustomRoutingListener
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingListener
HEADERS
X-Amz-Target
BODY json
{
"AcceleratorArn": "",
"PortRanges": "",
"IdempotencyToken": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingListener");
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 \"AcceleratorArn\": \"\",\n \"PortRanges\": \"\",\n \"IdempotencyToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingListener" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:AcceleratorArn ""
:PortRanges ""
:IdempotencyToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingListener"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"AcceleratorArn\": \"\",\n \"PortRanges\": \"\",\n \"IdempotencyToken\": \"\"\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=GlobalAccelerator_V20180706.CreateCustomRoutingListener"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"AcceleratorArn\": \"\",\n \"PortRanges\": \"\",\n \"IdempotencyToken\": \"\"\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=GlobalAccelerator_V20180706.CreateCustomRoutingListener");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AcceleratorArn\": \"\",\n \"PortRanges\": \"\",\n \"IdempotencyToken\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingListener"
payload := strings.NewReader("{\n \"AcceleratorArn\": \"\",\n \"PortRanges\": \"\",\n \"IdempotencyToken\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 72
{
"AcceleratorArn": "",
"PortRanges": "",
"IdempotencyToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingListener")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"AcceleratorArn\": \"\",\n \"PortRanges\": \"\",\n \"IdempotencyToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingListener"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AcceleratorArn\": \"\",\n \"PortRanges\": \"\",\n \"IdempotencyToken\": \"\"\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 \"AcceleratorArn\": \"\",\n \"PortRanges\": \"\",\n \"IdempotencyToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingListener")
.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=GlobalAccelerator_V20180706.CreateCustomRoutingListener")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"AcceleratorArn\": \"\",\n \"PortRanges\": \"\",\n \"IdempotencyToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
AcceleratorArn: '',
PortRanges: '',
IdempotencyToken: ''
});
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=GlobalAccelerator_V20180706.CreateCustomRoutingListener');
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=GlobalAccelerator_V20180706.CreateCustomRoutingListener',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AcceleratorArn: '', PortRanges: '', IdempotencyToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingListener';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AcceleratorArn":"","PortRanges":"","IdempotencyToken":""}'
};
try {
const response = await 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=GlobalAccelerator_V20180706.CreateCustomRoutingListener',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "AcceleratorArn": "",\n "PortRanges": "",\n "IdempotencyToken": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AcceleratorArn\": \"\",\n \"PortRanges\": \"\",\n \"IdempotencyToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingListener")
.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({AcceleratorArn: '', PortRanges: '', IdempotencyToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingListener',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {AcceleratorArn: '', PortRanges: '', IdempotencyToken: ''},
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=GlobalAccelerator_V20180706.CreateCustomRoutingListener');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
AcceleratorArn: '',
PortRanges: '',
IdempotencyToken: ''
});
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=GlobalAccelerator_V20180706.CreateCustomRoutingListener',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AcceleratorArn: '', PortRanges: '', IdempotencyToken: ''}
};
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=GlobalAccelerator_V20180706.CreateCustomRoutingListener';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AcceleratorArn":"","PortRanges":"","IdempotencyToken":""}'
};
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 = @{ @"AcceleratorArn": @"",
@"PortRanges": @"",
@"IdempotencyToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingListener"]
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=GlobalAccelerator_V20180706.CreateCustomRoutingListener" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"AcceleratorArn\": \"\",\n \"PortRanges\": \"\",\n \"IdempotencyToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingListener",
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([
'AcceleratorArn' => '',
'PortRanges' => '',
'IdempotencyToken' => ''
]),
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=GlobalAccelerator_V20180706.CreateCustomRoutingListener', [
'body' => '{
"AcceleratorArn": "",
"PortRanges": "",
"IdempotencyToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingListener');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AcceleratorArn' => '',
'PortRanges' => '',
'IdempotencyToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AcceleratorArn' => '',
'PortRanges' => '',
'IdempotencyToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingListener');
$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=GlobalAccelerator_V20180706.CreateCustomRoutingListener' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AcceleratorArn": "",
"PortRanges": "",
"IdempotencyToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingListener' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AcceleratorArn": "",
"PortRanges": "",
"IdempotencyToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AcceleratorArn\": \"\",\n \"PortRanges\": \"\",\n \"IdempotencyToken\": \"\"\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=GlobalAccelerator_V20180706.CreateCustomRoutingListener"
payload = {
"AcceleratorArn": "",
"PortRanges": "",
"IdempotencyToken": ""
}
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=GlobalAccelerator_V20180706.CreateCustomRoutingListener"
payload <- "{\n \"AcceleratorArn\": \"\",\n \"PortRanges\": \"\",\n \"IdempotencyToken\": \"\"\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=GlobalAccelerator_V20180706.CreateCustomRoutingListener")
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 \"AcceleratorArn\": \"\",\n \"PortRanges\": \"\",\n \"IdempotencyToken\": \"\"\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 \"AcceleratorArn\": \"\",\n \"PortRanges\": \"\",\n \"IdempotencyToken\": \"\"\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=GlobalAccelerator_V20180706.CreateCustomRoutingListener";
let payload = json!({
"AcceleratorArn": "",
"PortRanges": "",
"IdempotencyToken": ""
});
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=GlobalAccelerator_V20180706.CreateCustomRoutingListener' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"AcceleratorArn": "",
"PortRanges": "",
"IdempotencyToken": ""
}'
echo '{
"AcceleratorArn": "",
"PortRanges": "",
"IdempotencyToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingListener' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "AcceleratorArn": "",\n "PortRanges": "",\n "IdempotencyToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingListener'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"AcceleratorArn": "",
"PortRanges": "",
"IdempotencyToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateCustomRoutingListener")! 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
CreateEndpointGroup
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateEndpointGroup
HEADERS
X-Amz-Target
BODY json
{
"ListenerArn": "",
"EndpointGroupRegion": "",
"EndpointConfigurations": "",
"TrafficDialPercentage": "",
"HealthCheckPort": "",
"HealthCheckProtocol": "",
"HealthCheckPath": "",
"HealthCheckIntervalSeconds": "",
"ThresholdCount": "",
"IdempotencyToken": "",
"PortOverrides": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateEndpointGroup");
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 \"ListenerArn\": \"\",\n \"EndpointGroupRegion\": \"\",\n \"EndpointConfigurations\": \"\",\n \"TrafficDialPercentage\": \"\",\n \"HealthCheckPort\": \"\",\n \"HealthCheckProtocol\": \"\",\n \"HealthCheckPath\": \"\",\n \"HealthCheckIntervalSeconds\": \"\",\n \"ThresholdCount\": \"\",\n \"IdempotencyToken\": \"\",\n \"PortOverrides\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateEndpointGroup" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ListenerArn ""
:EndpointGroupRegion ""
:EndpointConfigurations ""
:TrafficDialPercentage ""
:HealthCheckPort ""
:HealthCheckProtocol ""
:HealthCheckPath ""
:HealthCheckIntervalSeconds ""
:ThresholdCount ""
:IdempotencyToken ""
:PortOverrides ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateEndpointGroup"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ListenerArn\": \"\",\n \"EndpointGroupRegion\": \"\",\n \"EndpointConfigurations\": \"\",\n \"TrafficDialPercentage\": \"\",\n \"HealthCheckPort\": \"\",\n \"HealthCheckProtocol\": \"\",\n \"HealthCheckPath\": \"\",\n \"HealthCheckIntervalSeconds\": \"\",\n \"ThresholdCount\": \"\",\n \"IdempotencyToken\": \"\",\n \"PortOverrides\": \"\"\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=GlobalAccelerator_V20180706.CreateEndpointGroup"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ListenerArn\": \"\",\n \"EndpointGroupRegion\": \"\",\n \"EndpointConfigurations\": \"\",\n \"TrafficDialPercentage\": \"\",\n \"HealthCheckPort\": \"\",\n \"HealthCheckProtocol\": \"\",\n \"HealthCheckPath\": \"\",\n \"HealthCheckIntervalSeconds\": \"\",\n \"ThresholdCount\": \"\",\n \"IdempotencyToken\": \"\",\n \"PortOverrides\": \"\"\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=GlobalAccelerator_V20180706.CreateEndpointGroup");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ListenerArn\": \"\",\n \"EndpointGroupRegion\": \"\",\n \"EndpointConfigurations\": \"\",\n \"TrafficDialPercentage\": \"\",\n \"HealthCheckPort\": \"\",\n \"HealthCheckProtocol\": \"\",\n \"HealthCheckPath\": \"\",\n \"HealthCheckIntervalSeconds\": \"\",\n \"ThresholdCount\": \"\",\n \"IdempotencyToken\": \"\",\n \"PortOverrides\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateEndpointGroup"
payload := strings.NewReader("{\n \"ListenerArn\": \"\",\n \"EndpointGroupRegion\": \"\",\n \"EndpointConfigurations\": \"\",\n \"TrafficDialPercentage\": \"\",\n \"HealthCheckPort\": \"\",\n \"HealthCheckProtocol\": \"\",\n \"HealthCheckPath\": \"\",\n \"HealthCheckIntervalSeconds\": \"\",\n \"ThresholdCount\": \"\",\n \"IdempotencyToken\": \"\",\n \"PortOverrides\": \"\"\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: 303
{
"ListenerArn": "",
"EndpointGroupRegion": "",
"EndpointConfigurations": "",
"TrafficDialPercentage": "",
"HealthCheckPort": "",
"HealthCheckProtocol": "",
"HealthCheckPath": "",
"HealthCheckIntervalSeconds": "",
"ThresholdCount": "",
"IdempotencyToken": "",
"PortOverrides": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateEndpointGroup")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ListenerArn\": \"\",\n \"EndpointGroupRegion\": \"\",\n \"EndpointConfigurations\": \"\",\n \"TrafficDialPercentage\": \"\",\n \"HealthCheckPort\": \"\",\n \"HealthCheckProtocol\": \"\",\n \"HealthCheckPath\": \"\",\n \"HealthCheckIntervalSeconds\": \"\",\n \"ThresholdCount\": \"\",\n \"IdempotencyToken\": \"\",\n \"PortOverrides\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateEndpointGroup"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ListenerArn\": \"\",\n \"EndpointGroupRegion\": \"\",\n \"EndpointConfigurations\": \"\",\n \"TrafficDialPercentage\": \"\",\n \"HealthCheckPort\": \"\",\n \"HealthCheckProtocol\": \"\",\n \"HealthCheckPath\": \"\",\n \"HealthCheckIntervalSeconds\": \"\",\n \"ThresholdCount\": \"\",\n \"IdempotencyToken\": \"\",\n \"PortOverrides\": \"\"\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 \"ListenerArn\": \"\",\n \"EndpointGroupRegion\": \"\",\n \"EndpointConfigurations\": \"\",\n \"TrafficDialPercentage\": \"\",\n \"HealthCheckPort\": \"\",\n \"HealthCheckProtocol\": \"\",\n \"HealthCheckPath\": \"\",\n \"HealthCheckIntervalSeconds\": \"\",\n \"ThresholdCount\": \"\",\n \"IdempotencyToken\": \"\",\n \"PortOverrides\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateEndpointGroup")
.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=GlobalAccelerator_V20180706.CreateEndpointGroup")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ListenerArn\": \"\",\n \"EndpointGroupRegion\": \"\",\n \"EndpointConfigurations\": \"\",\n \"TrafficDialPercentage\": \"\",\n \"HealthCheckPort\": \"\",\n \"HealthCheckProtocol\": \"\",\n \"HealthCheckPath\": \"\",\n \"HealthCheckIntervalSeconds\": \"\",\n \"ThresholdCount\": \"\",\n \"IdempotencyToken\": \"\",\n \"PortOverrides\": \"\"\n}")
.asString();
const data = JSON.stringify({
ListenerArn: '',
EndpointGroupRegion: '',
EndpointConfigurations: '',
TrafficDialPercentage: '',
HealthCheckPort: '',
HealthCheckProtocol: '',
HealthCheckPath: '',
HealthCheckIntervalSeconds: '',
ThresholdCount: '',
IdempotencyToken: '',
PortOverrides: ''
});
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=GlobalAccelerator_V20180706.CreateEndpointGroup');
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=GlobalAccelerator_V20180706.CreateEndpointGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
ListenerArn: '',
EndpointGroupRegion: '',
EndpointConfigurations: '',
TrafficDialPercentage: '',
HealthCheckPort: '',
HealthCheckProtocol: '',
HealthCheckPath: '',
HealthCheckIntervalSeconds: '',
ThresholdCount: '',
IdempotencyToken: '',
PortOverrides: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateEndpointGroup';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ListenerArn":"","EndpointGroupRegion":"","EndpointConfigurations":"","TrafficDialPercentage":"","HealthCheckPort":"","HealthCheckProtocol":"","HealthCheckPath":"","HealthCheckIntervalSeconds":"","ThresholdCount":"","IdempotencyToken":"","PortOverrides":""}'
};
try {
const response = await 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=GlobalAccelerator_V20180706.CreateEndpointGroup',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ListenerArn": "",\n "EndpointGroupRegion": "",\n "EndpointConfigurations": "",\n "TrafficDialPercentage": "",\n "HealthCheckPort": "",\n "HealthCheckProtocol": "",\n "HealthCheckPath": "",\n "HealthCheckIntervalSeconds": "",\n "ThresholdCount": "",\n "IdempotencyToken": "",\n "PortOverrides": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ListenerArn\": \"\",\n \"EndpointGroupRegion\": \"\",\n \"EndpointConfigurations\": \"\",\n \"TrafficDialPercentage\": \"\",\n \"HealthCheckPort\": \"\",\n \"HealthCheckProtocol\": \"\",\n \"HealthCheckPath\": \"\",\n \"HealthCheckIntervalSeconds\": \"\",\n \"ThresholdCount\": \"\",\n \"IdempotencyToken\": \"\",\n \"PortOverrides\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateEndpointGroup")
.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({
ListenerArn: '',
EndpointGroupRegion: '',
EndpointConfigurations: '',
TrafficDialPercentage: '',
HealthCheckPort: '',
HealthCheckProtocol: '',
HealthCheckPath: '',
HealthCheckIntervalSeconds: '',
ThresholdCount: '',
IdempotencyToken: '',
PortOverrides: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateEndpointGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
ListenerArn: '',
EndpointGroupRegion: '',
EndpointConfigurations: '',
TrafficDialPercentage: '',
HealthCheckPort: '',
HealthCheckProtocol: '',
HealthCheckPath: '',
HealthCheckIntervalSeconds: '',
ThresholdCount: '',
IdempotencyToken: '',
PortOverrides: ''
},
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=GlobalAccelerator_V20180706.CreateEndpointGroup');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ListenerArn: '',
EndpointGroupRegion: '',
EndpointConfigurations: '',
TrafficDialPercentage: '',
HealthCheckPort: '',
HealthCheckProtocol: '',
HealthCheckPath: '',
HealthCheckIntervalSeconds: '',
ThresholdCount: '',
IdempotencyToken: '',
PortOverrides: ''
});
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=GlobalAccelerator_V20180706.CreateEndpointGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
ListenerArn: '',
EndpointGroupRegion: '',
EndpointConfigurations: '',
TrafficDialPercentage: '',
HealthCheckPort: '',
HealthCheckProtocol: '',
HealthCheckPath: '',
HealthCheckIntervalSeconds: '',
ThresholdCount: '',
IdempotencyToken: '',
PortOverrides: ''
}
};
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=GlobalAccelerator_V20180706.CreateEndpointGroup';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ListenerArn":"","EndpointGroupRegion":"","EndpointConfigurations":"","TrafficDialPercentage":"","HealthCheckPort":"","HealthCheckProtocol":"","HealthCheckPath":"","HealthCheckIntervalSeconds":"","ThresholdCount":"","IdempotencyToken":"","PortOverrides":""}'
};
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 = @{ @"ListenerArn": @"",
@"EndpointGroupRegion": @"",
@"EndpointConfigurations": @"",
@"TrafficDialPercentage": @"",
@"HealthCheckPort": @"",
@"HealthCheckProtocol": @"",
@"HealthCheckPath": @"",
@"HealthCheckIntervalSeconds": @"",
@"ThresholdCount": @"",
@"IdempotencyToken": @"",
@"PortOverrides": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateEndpointGroup"]
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=GlobalAccelerator_V20180706.CreateEndpointGroup" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"ListenerArn\": \"\",\n \"EndpointGroupRegion\": \"\",\n \"EndpointConfigurations\": \"\",\n \"TrafficDialPercentage\": \"\",\n \"HealthCheckPort\": \"\",\n \"HealthCheckProtocol\": \"\",\n \"HealthCheckPath\": \"\",\n \"HealthCheckIntervalSeconds\": \"\",\n \"ThresholdCount\": \"\",\n \"IdempotencyToken\": \"\",\n \"PortOverrides\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateEndpointGroup",
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([
'ListenerArn' => '',
'EndpointGroupRegion' => '',
'EndpointConfigurations' => '',
'TrafficDialPercentage' => '',
'HealthCheckPort' => '',
'HealthCheckProtocol' => '',
'HealthCheckPath' => '',
'HealthCheckIntervalSeconds' => '',
'ThresholdCount' => '',
'IdempotencyToken' => '',
'PortOverrides' => ''
]),
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=GlobalAccelerator_V20180706.CreateEndpointGroup', [
'body' => '{
"ListenerArn": "",
"EndpointGroupRegion": "",
"EndpointConfigurations": "",
"TrafficDialPercentage": "",
"HealthCheckPort": "",
"HealthCheckProtocol": "",
"HealthCheckPath": "",
"HealthCheckIntervalSeconds": "",
"ThresholdCount": "",
"IdempotencyToken": "",
"PortOverrides": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateEndpointGroup');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ListenerArn' => '',
'EndpointGroupRegion' => '',
'EndpointConfigurations' => '',
'TrafficDialPercentage' => '',
'HealthCheckPort' => '',
'HealthCheckProtocol' => '',
'HealthCheckPath' => '',
'HealthCheckIntervalSeconds' => '',
'ThresholdCount' => '',
'IdempotencyToken' => '',
'PortOverrides' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ListenerArn' => '',
'EndpointGroupRegion' => '',
'EndpointConfigurations' => '',
'TrafficDialPercentage' => '',
'HealthCheckPort' => '',
'HealthCheckProtocol' => '',
'HealthCheckPath' => '',
'HealthCheckIntervalSeconds' => '',
'ThresholdCount' => '',
'IdempotencyToken' => '',
'PortOverrides' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateEndpointGroup');
$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=GlobalAccelerator_V20180706.CreateEndpointGroup' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ListenerArn": "",
"EndpointGroupRegion": "",
"EndpointConfigurations": "",
"TrafficDialPercentage": "",
"HealthCheckPort": "",
"HealthCheckProtocol": "",
"HealthCheckPath": "",
"HealthCheckIntervalSeconds": "",
"ThresholdCount": "",
"IdempotencyToken": "",
"PortOverrides": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateEndpointGroup' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ListenerArn": "",
"EndpointGroupRegion": "",
"EndpointConfigurations": "",
"TrafficDialPercentage": "",
"HealthCheckPort": "",
"HealthCheckProtocol": "",
"HealthCheckPath": "",
"HealthCheckIntervalSeconds": "",
"ThresholdCount": "",
"IdempotencyToken": "",
"PortOverrides": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ListenerArn\": \"\",\n \"EndpointGroupRegion\": \"\",\n \"EndpointConfigurations\": \"\",\n \"TrafficDialPercentage\": \"\",\n \"HealthCheckPort\": \"\",\n \"HealthCheckProtocol\": \"\",\n \"HealthCheckPath\": \"\",\n \"HealthCheckIntervalSeconds\": \"\",\n \"ThresholdCount\": \"\",\n \"IdempotencyToken\": \"\",\n \"PortOverrides\": \"\"\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=GlobalAccelerator_V20180706.CreateEndpointGroup"
payload = {
"ListenerArn": "",
"EndpointGroupRegion": "",
"EndpointConfigurations": "",
"TrafficDialPercentage": "",
"HealthCheckPort": "",
"HealthCheckProtocol": "",
"HealthCheckPath": "",
"HealthCheckIntervalSeconds": "",
"ThresholdCount": "",
"IdempotencyToken": "",
"PortOverrides": ""
}
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=GlobalAccelerator_V20180706.CreateEndpointGroup"
payload <- "{\n \"ListenerArn\": \"\",\n \"EndpointGroupRegion\": \"\",\n \"EndpointConfigurations\": \"\",\n \"TrafficDialPercentage\": \"\",\n \"HealthCheckPort\": \"\",\n \"HealthCheckProtocol\": \"\",\n \"HealthCheckPath\": \"\",\n \"HealthCheckIntervalSeconds\": \"\",\n \"ThresholdCount\": \"\",\n \"IdempotencyToken\": \"\",\n \"PortOverrides\": \"\"\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=GlobalAccelerator_V20180706.CreateEndpointGroup")
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 \"ListenerArn\": \"\",\n \"EndpointGroupRegion\": \"\",\n \"EndpointConfigurations\": \"\",\n \"TrafficDialPercentage\": \"\",\n \"HealthCheckPort\": \"\",\n \"HealthCheckProtocol\": \"\",\n \"HealthCheckPath\": \"\",\n \"HealthCheckIntervalSeconds\": \"\",\n \"ThresholdCount\": \"\",\n \"IdempotencyToken\": \"\",\n \"PortOverrides\": \"\"\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 \"ListenerArn\": \"\",\n \"EndpointGroupRegion\": \"\",\n \"EndpointConfigurations\": \"\",\n \"TrafficDialPercentage\": \"\",\n \"HealthCheckPort\": \"\",\n \"HealthCheckProtocol\": \"\",\n \"HealthCheckPath\": \"\",\n \"HealthCheckIntervalSeconds\": \"\",\n \"ThresholdCount\": \"\",\n \"IdempotencyToken\": \"\",\n \"PortOverrides\": \"\"\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=GlobalAccelerator_V20180706.CreateEndpointGroup";
let payload = json!({
"ListenerArn": "",
"EndpointGroupRegion": "",
"EndpointConfigurations": "",
"TrafficDialPercentage": "",
"HealthCheckPort": "",
"HealthCheckProtocol": "",
"HealthCheckPath": "",
"HealthCheckIntervalSeconds": "",
"ThresholdCount": "",
"IdempotencyToken": "",
"PortOverrides": ""
});
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=GlobalAccelerator_V20180706.CreateEndpointGroup' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ListenerArn": "",
"EndpointGroupRegion": "",
"EndpointConfigurations": "",
"TrafficDialPercentage": "",
"HealthCheckPort": "",
"HealthCheckProtocol": "",
"HealthCheckPath": "",
"HealthCheckIntervalSeconds": "",
"ThresholdCount": "",
"IdempotencyToken": "",
"PortOverrides": ""
}'
echo '{
"ListenerArn": "",
"EndpointGroupRegion": "",
"EndpointConfigurations": "",
"TrafficDialPercentage": "",
"HealthCheckPort": "",
"HealthCheckProtocol": "",
"HealthCheckPath": "",
"HealthCheckIntervalSeconds": "",
"ThresholdCount": "",
"IdempotencyToken": "",
"PortOverrides": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateEndpointGroup' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ListenerArn": "",\n "EndpointGroupRegion": "",\n "EndpointConfigurations": "",\n "TrafficDialPercentage": "",\n "HealthCheckPort": "",\n "HealthCheckProtocol": "",\n "HealthCheckPath": "",\n "HealthCheckIntervalSeconds": "",\n "ThresholdCount": "",\n "IdempotencyToken": "",\n "PortOverrides": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateEndpointGroup'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"ListenerArn": "",
"EndpointGroupRegion": "",
"EndpointConfigurations": "",
"TrafficDialPercentage": "",
"HealthCheckPort": "",
"HealthCheckProtocol": "",
"HealthCheckPath": "",
"HealthCheckIntervalSeconds": "",
"ThresholdCount": "",
"IdempotencyToken": "",
"PortOverrides": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateEndpointGroup")! 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
CreateListener
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateListener
HEADERS
X-Amz-Target
BODY json
{
"AcceleratorArn": "",
"PortRanges": "",
"Protocol": "",
"ClientAffinity": "",
"IdempotencyToken": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateListener");
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 \"AcceleratorArn\": \"\",\n \"PortRanges\": \"\",\n \"Protocol\": \"\",\n \"ClientAffinity\": \"\",\n \"IdempotencyToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateListener" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:AcceleratorArn ""
:PortRanges ""
:Protocol ""
:ClientAffinity ""
:IdempotencyToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateListener"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"AcceleratorArn\": \"\",\n \"PortRanges\": \"\",\n \"Protocol\": \"\",\n \"ClientAffinity\": \"\",\n \"IdempotencyToken\": \"\"\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=GlobalAccelerator_V20180706.CreateListener"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"AcceleratorArn\": \"\",\n \"PortRanges\": \"\",\n \"Protocol\": \"\",\n \"ClientAffinity\": \"\",\n \"IdempotencyToken\": \"\"\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=GlobalAccelerator_V20180706.CreateListener");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AcceleratorArn\": \"\",\n \"PortRanges\": \"\",\n \"Protocol\": \"\",\n \"ClientAffinity\": \"\",\n \"IdempotencyToken\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateListener"
payload := strings.NewReader("{\n \"AcceleratorArn\": \"\",\n \"PortRanges\": \"\",\n \"Protocol\": \"\",\n \"ClientAffinity\": \"\",\n \"IdempotencyToken\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 114
{
"AcceleratorArn": "",
"PortRanges": "",
"Protocol": "",
"ClientAffinity": "",
"IdempotencyToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateListener")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"AcceleratorArn\": \"\",\n \"PortRanges\": \"\",\n \"Protocol\": \"\",\n \"ClientAffinity\": \"\",\n \"IdempotencyToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateListener"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AcceleratorArn\": \"\",\n \"PortRanges\": \"\",\n \"Protocol\": \"\",\n \"ClientAffinity\": \"\",\n \"IdempotencyToken\": \"\"\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 \"AcceleratorArn\": \"\",\n \"PortRanges\": \"\",\n \"Protocol\": \"\",\n \"ClientAffinity\": \"\",\n \"IdempotencyToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateListener")
.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=GlobalAccelerator_V20180706.CreateListener")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"AcceleratorArn\": \"\",\n \"PortRanges\": \"\",\n \"Protocol\": \"\",\n \"ClientAffinity\": \"\",\n \"IdempotencyToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
AcceleratorArn: '',
PortRanges: '',
Protocol: '',
ClientAffinity: '',
IdempotencyToken: ''
});
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=GlobalAccelerator_V20180706.CreateListener');
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=GlobalAccelerator_V20180706.CreateListener',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
AcceleratorArn: '',
PortRanges: '',
Protocol: '',
ClientAffinity: '',
IdempotencyToken: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateListener';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AcceleratorArn":"","PortRanges":"","Protocol":"","ClientAffinity":"","IdempotencyToken":""}'
};
try {
const response = await 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=GlobalAccelerator_V20180706.CreateListener',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "AcceleratorArn": "",\n "PortRanges": "",\n "Protocol": "",\n "ClientAffinity": "",\n "IdempotencyToken": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AcceleratorArn\": \"\",\n \"PortRanges\": \"\",\n \"Protocol\": \"\",\n \"ClientAffinity\": \"\",\n \"IdempotencyToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateListener")
.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({
AcceleratorArn: '',
PortRanges: '',
Protocol: '',
ClientAffinity: '',
IdempotencyToken: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateListener',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
AcceleratorArn: '',
PortRanges: '',
Protocol: '',
ClientAffinity: '',
IdempotencyToken: ''
},
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=GlobalAccelerator_V20180706.CreateListener');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
AcceleratorArn: '',
PortRanges: '',
Protocol: '',
ClientAffinity: '',
IdempotencyToken: ''
});
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=GlobalAccelerator_V20180706.CreateListener',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
AcceleratorArn: '',
PortRanges: '',
Protocol: '',
ClientAffinity: '',
IdempotencyToken: ''
}
};
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=GlobalAccelerator_V20180706.CreateListener';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AcceleratorArn":"","PortRanges":"","Protocol":"","ClientAffinity":"","IdempotencyToken":""}'
};
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 = @{ @"AcceleratorArn": @"",
@"PortRanges": @"",
@"Protocol": @"",
@"ClientAffinity": @"",
@"IdempotencyToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateListener"]
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=GlobalAccelerator_V20180706.CreateListener" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"AcceleratorArn\": \"\",\n \"PortRanges\": \"\",\n \"Protocol\": \"\",\n \"ClientAffinity\": \"\",\n \"IdempotencyToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateListener",
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([
'AcceleratorArn' => '',
'PortRanges' => '',
'Protocol' => '',
'ClientAffinity' => '',
'IdempotencyToken' => ''
]),
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=GlobalAccelerator_V20180706.CreateListener', [
'body' => '{
"AcceleratorArn": "",
"PortRanges": "",
"Protocol": "",
"ClientAffinity": "",
"IdempotencyToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateListener');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AcceleratorArn' => '',
'PortRanges' => '',
'Protocol' => '',
'ClientAffinity' => '',
'IdempotencyToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AcceleratorArn' => '',
'PortRanges' => '',
'Protocol' => '',
'ClientAffinity' => '',
'IdempotencyToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateListener');
$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=GlobalAccelerator_V20180706.CreateListener' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AcceleratorArn": "",
"PortRanges": "",
"Protocol": "",
"ClientAffinity": "",
"IdempotencyToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateListener' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AcceleratorArn": "",
"PortRanges": "",
"Protocol": "",
"ClientAffinity": "",
"IdempotencyToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AcceleratorArn\": \"\",\n \"PortRanges\": \"\",\n \"Protocol\": \"\",\n \"ClientAffinity\": \"\",\n \"IdempotencyToken\": \"\"\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=GlobalAccelerator_V20180706.CreateListener"
payload = {
"AcceleratorArn": "",
"PortRanges": "",
"Protocol": "",
"ClientAffinity": "",
"IdempotencyToken": ""
}
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=GlobalAccelerator_V20180706.CreateListener"
payload <- "{\n \"AcceleratorArn\": \"\",\n \"PortRanges\": \"\",\n \"Protocol\": \"\",\n \"ClientAffinity\": \"\",\n \"IdempotencyToken\": \"\"\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=GlobalAccelerator_V20180706.CreateListener")
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 \"AcceleratorArn\": \"\",\n \"PortRanges\": \"\",\n \"Protocol\": \"\",\n \"ClientAffinity\": \"\",\n \"IdempotencyToken\": \"\"\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 \"AcceleratorArn\": \"\",\n \"PortRanges\": \"\",\n \"Protocol\": \"\",\n \"ClientAffinity\": \"\",\n \"IdempotencyToken\": \"\"\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=GlobalAccelerator_V20180706.CreateListener";
let payload = json!({
"AcceleratorArn": "",
"PortRanges": "",
"Protocol": "",
"ClientAffinity": "",
"IdempotencyToken": ""
});
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=GlobalAccelerator_V20180706.CreateListener' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"AcceleratorArn": "",
"PortRanges": "",
"Protocol": "",
"ClientAffinity": "",
"IdempotencyToken": ""
}'
echo '{
"AcceleratorArn": "",
"PortRanges": "",
"Protocol": "",
"ClientAffinity": "",
"IdempotencyToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateListener' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "AcceleratorArn": "",\n "PortRanges": "",\n "Protocol": "",\n "ClientAffinity": "",\n "IdempotencyToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateListener'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"AcceleratorArn": "",
"PortRanges": "",
"Protocol": "",
"ClientAffinity": "",
"IdempotencyToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.CreateListener")! 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
DeleteAccelerator
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteAccelerator
HEADERS
X-Amz-Target
BODY json
{
"AcceleratorArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteAccelerator");
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 \"AcceleratorArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteAccelerator" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:AcceleratorArn ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteAccelerator"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"AcceleratorArn\": \"\"\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=GlobalAccelerator_V20180706.DeleteAccelerator"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"AcceleratorArn\": \"\"\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=GlobalAccelerator_V20180706.DeleteAccelerator");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AcceleratorArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteAccelerator"
payload := strings.NewReader("{\n \"AcceleratorArn\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 26
{
"AcceleratorArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteAccelerator")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"AcceleratorArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteAccelerator"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AcceleratorArn\": \"\"\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 \"AcceleratorArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteAccelerator")
.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=GlobalAccelerator_V20180706.DeleteAccelerator")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"AcceleratorArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
AcceleratorArn: ''
});
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=GlobalAccelerator_V20180706.DeleteAccelerator');
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=GlobalAccelerator_V20180706.DeleteAccelerator',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AcceleratorArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteAccelerator';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AcceleratorArn":""}'
};
try {
const response = await 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=GlobalAccelerator_V20180706.DeleteAccelerator',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "AcceleratorArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AcceleratorArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteAccelerator")
.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({AcceleratorArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteAccelerator',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {AcceleratorArn: ''},
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=GlobalAccelerator_V20180706.DeleteAccelerator');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
AcceleratorArn: ''
});
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=GlobalAccelerator_V20180706.DeleteAccelerator',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AcceleratorArn: ''}
};
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=GlobalAccelerator_V20180706.DeleteAccelerator';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AcceleratorArn":""}'
};
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 = @{ @"AcceleratorArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteAccelerator"]
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=GlobalAccelerator_V20180706.DeleteAccelerator" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"AcceleratorArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteAccelerator",
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([
'AcceleratorArn' => ''
]),
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=GlobalAccelerator_V20180706.DeleteAccelerator', [
'body' => '{
"AcceleratorArn": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteAccelerator');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AcceleratorArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AcceleratorArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteAccelerator');
$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=GlobalAccelerator_V20180706.DeleteAccelerator' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AcceleratorArn": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteAccelerator' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AcceleratorArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AcceleratorArn\": \"\"\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=GlobalAccelerator_V20180706.DeleteAccelerator"
payload = { "AcceleratorArn": "" }
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=GlobalAccelerator_V20180706.DeleteAccelerator"
payload <- "{\n \"AcceleratorArn\": \"\"\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=GlobalAccelerator_V20180706.DeleteAccelerator")
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 \"AcceleratorArn\": \"\"\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 \"AcceleratorArn\": \"\"\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=GlobalAccelerator_V20180706.DeleteAccelerator";
let payload = json!({"AcceleratorArn": ""});
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=GlobalAccelerator_V20180706.DeleteAccelerator' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"AcceleratorArn": ""
}'
echo '{
"AcceleratorArn": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteAccelerator' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "AcceleratorArn": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteAccelerator'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["AcceleratorArn": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteAccelerator")! 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
DeleteCustomRoutingAccelerator
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingAccelerator
HEADERS
X-Amz-Target
BODY json
{
"AcceleratorArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingAccelerator");
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 \"AcceleratorArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingAccelerator" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:AcceleratorArn ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingAccelerator"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"AcceleratorArn\": \"\"\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=GlobalAccelerator_V20180706.DeleteCustomRoutingAccelerator"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"AcceleratorArn\": \"\"\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=GlobalAccelerator_V20180706.DeleteCustomRoutingAccelerator");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AcceleratorArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingAccelerator"
payload := strings.NewReader("{\n \"AcceleratorArn\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 26
{
"AcceleratorArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingAccelerator")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"AcceleratorArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingAccelerator"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AcceleratorArn\": \"\"\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 \"AcceleratorArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingAccelerator")
.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=GlobalAccelerator_V20180706.DeleteCustomRoutingAccelerator")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"AcceleratorArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
AcceleratorArn: ''
});
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=GlobalAccelerator_V20180706.DeleteCustomRoutingAccelerator');
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=GlobalAccelerator_V20180706.DeleteCustomRoutingAccelerator',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AcceleratorArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingAccelerator';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AcceleratorArn":""}'
};
try {
const response = await 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=GlobalAccelerator_V20180706.DeleteCustomRoutingAccelerator',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "AcceleratorArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AcceleratorArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingAccelerator")
.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({AcceleratorArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingAccelerator',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {AcceleratorArn: ''},
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=GlobalAccelerator_V20180706.DeleteCustomRoutingAccelerator');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
AcceleratorArn: ''
});
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=GlobalAccelerator_V20180706.DeleteCustomRoutingAccelerator',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AcceleratorArn: ''}
};
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=GlobalAccelerator_V20180706.DeleteCustomRoutingAccelerator';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AcceleratorArn":""}'
};
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 = @{ @"AcceleratorArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingAccelerator"]
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=GlobalAccelerator_V20180706.DeleteCustomRoutingAccelerator" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"AcceleratorArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingAccelerator",
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([
'AcceleratorArn' => ''
]),
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=GlobalAccelerator_V20180706.DeleteCustomRoutingAccelerator', [
'body' => '{
"AcceleratorArn": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingAccelerator');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AcceleratorArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AcceleratorArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingAccelerator');
$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=GlobalAccelerator_V20180706.DeleteCustomRoutingAccelerator' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AcceleratorArn": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingAccelerator' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AcceleratorArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AcceleratorArn\": \"\"\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=GlobalAccelerator_V20180706.DeleteCustomRoutingAccelerator"
payload = { "AcceleratorArn": "" }
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=GlobalAccelerator_V20180706.DeleteCustomRoutingAccelerator"
payload <- "{\n \"AcceleratorArn\": \"\"\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=GlobalAccelerator_V20180706.DeleteCustomRoutingAccelerator")
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 \"AcceleratorArn\": \"\"\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 \"AcceleratorArn\": \"\"\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=GlobalAccelerator_V20180706.DeleteCustomRoutingAccelerator";
let payload = json!({"AcceleratorArn": ""});
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=GlobalAccelerator_V20180706.DeleteCustomRoutingAccelerator' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"AcceleratorArn": ""
}'
echo '{
"AcceleratorArn": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingAccelerator' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "AcceleratorArn": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingAccelerator'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["AcceleratorArn": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingAccelerator")! 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
DeleteCustomRoutingEndpointGroup
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingEndpointGroup
HEADERS
X-Amz-Target
BODY json
{
"EndpointGroupArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingEndpointGroup");
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 \"EndpointGroupArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingEndpointGroup" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:EndpointGroupArn ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingEndpointGroup"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.DeleteCustomRoutingEndpointGroup"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.DeleteCustomRoutingEndpointGroup");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"EndpointGroupArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingEndpointGroup"
payload := strings.NewReader("{\n \"EndpointGroupArn\": \"\"\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
{
"EndpointGroupArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingEndpointGroup")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"EndpointGroupArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingEndpointGroup"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"EndpointGroupArn\": \"\"\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 \"EndpointGroupArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingEndpointGroup")
.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=GlobalAccelerator_V20180706.DeleteCustomRoutingEndpointGroup")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"EndpointGroupArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
EndpointGroupArn: ''
});
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=GlobalAccelerator_V20180706.DeleteCustomRoutingEndpointGroup');
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=GlobalAccelerator_V20180706.DeleteCustomRoutingEndpointGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {EndpointGroupArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingEndpointGroup';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"EndpointGroupArn":""}'
};
try {
const response = await 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=GlobalAccelerator_V20180706.DeleteCustomRoutingEndpointGroup',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "EndpointGroupArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"EndpointGroupArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingEndpointGroup")
.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({EndpointGroupArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingEndpointGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {EndpointGroupArn: ''},
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=GlobalAccelerator_V20180706.DeleteCustomRoutingEndpointGroup');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
EndpointGroupArn: ''
});
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=GlobalAccelerator_V20180706.DeleteCustomRoutingEndpointGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {EndpointGroupArn: ''}
};
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=GlobalAccelerator_V20180706.DeleteCustomRoutingEndpointGroup';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"EndpointGroupArn":""}'
};
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 = @{ @"EndpointGroupArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingEndpointGroup"]
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=GlobalAccelerator_V20180706.DeleteCustomRoutingEndpointGroup" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"EndpointGroupArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingEndpointGroup",
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([
'EndpointGroupArn' => ''
]),
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=GlobalAccelerator_V20180706.DeleteCustomRoutingEndpointGroup', [
'body' => '{
"EndpointGroupArn": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingEndpointGroup');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'EndpointGroupArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'EndpointGroupArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingEndpointGroup');
$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=GlobalAccelerator_V20180706.DeleteCustomRoutingEndpointGroup' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EndpointGroupArn": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingEndpointGroup' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EndpointGroupArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.DeleteCustomRoutingEndpointGroup"
payload = { "EndpointGroupArn": "" }
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=GlobalAccelerator_V20180706.DeleteCustomRoutingEndpointGroup"
payload <- "{\n \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.DeleteCustomRoutingEndpointGroup")
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 \"EndpointGroupArn\": \"\"\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 \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.DeleteCustomRoutingEndpointGroup";
let payload = json!({"EndpointGroupArn": ""});
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=GlobalAccelerator_V20180706.DeleteCustomRoutingEndpointGroup' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"EndpointGroupArn": ""
}'
echo '{
"EndpointGroupArn": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingEndpointGroup' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "EndpointGroupArn": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingEndpointGroup'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["EndpointGroupArn": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingEndpointGroup")! 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
DeleteCustomRoutingListener
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingListener
HEADERS
X-Amz-Target
BODY json
{
"ListenerArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingListener");
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 \"ListenerArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingListener" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ListenerArn ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingListener"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ListenerArn\": \"\"\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=GlobalAccelerator_V20180706.DeleteCustomRoutingListener"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ListenerArn\": \"\"\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=GlobalAccelerator_V20180706.DeleteCustomRoutingListener");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ListenerArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingListener"
payload := strings.NewReader("{\n \"ListenerArn\": \"\"\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
{
"ListenerArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingListener")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ListenerArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingListener"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ListenerArn\": \"\"\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 \"ListenerArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingListener")
.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=GlobalAccelerator_V20180706.DeleteCustomRoutingListener")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ListenerArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
ListenerArn: ''
});
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=GlobalAccelerator_V20180706.DeleteCustomRoutingListener');
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=GlobalAccelerator_V20180706.DeleteCustomRoutingListener',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ListenerArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingListener';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ListenerArn":""}'
};
try {
const response = await 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=GlobalAccelerator_V20180706.DeleteCustomRoutingListener',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ListenerArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ListenerArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingListener")
.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({ListenerArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingListener',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {ListenerArn: ''},
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=GlobalAccelerator_V20180706.DeleteCustomRoutingListener');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ListenerArn: ''
});
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=GlobalAccelerator_V20180706.DeleteCustomRoutingListener',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ListenerArn: ''}
};
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=GlobalAccelerator_V20180706.DeleteCustomRoutingListener';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ListenerArn":""}'
};
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 = @{ @"ListenerArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingListener"]
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=GlobalAccelerator_V20180706.DeleteCustomRoutingListener" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"ListenerArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingListener",
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([
'ListenerArn' => ''
]),
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=GlobalAccelerator_V20180706.DeleteCustomRoutingListener', [
'body' => '{
"ListenerArn": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingListener');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ListenerArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ListenerArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingListener');
$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=GlobalAccelerator_V20180706.DeleteCustomRoutingListener' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ListenerArn": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingListener' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ListenerArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ListenerArn\": \"\"\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=GlobalAccelerator_V20180706.DeleteCustomRoutingListener"
payload = { "ListenerArn": "" }
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=GlobalAccelerator_V20180706.DeleteCustomRoutingListener"
payload <- "{\n \"ListenerArn\": \"\"\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=GlobalAccelerator_V20180706.DeleteCustomRoutingListener")
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 \"ListenerArn\": \"\"\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 \"ListenerArn\": \"\"\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=GlobalAccelerator_V20180706.DeleteCustomRoutingListener";
let payload = json!({"ListenerArn": ""});
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=GlobalAccelerator_V20180706.DeleteCustomRoutingListener' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ListenerArn": ""
}'
echo '{
"ListenerArn": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingListener' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ListenerArn": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingListener'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["ListenerArn": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteCustomRoutingListener")! 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
DeleteEndpointGroup
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteEndpointGroup
HEADERS
X-Amz-Target
BODY json
{
"EndpointGroupArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteEndpointGroup");
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 \"EndpointGroupArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteEndpointGroup" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:EndpointGroupArn ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteEndpointGroup"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.DeleteEndpointGroup"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.DeleteEndpointGroup");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"EndpointGroupArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteEndpointGroup"
payload := strings.NewReader("{\n \"EndpointGroupArn\": \"\"\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
{
"EndpointGroupArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteEndpointGroup")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"EndpointGroupArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteEndpointGroup"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"EndpointGroupArn\": \"\"\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 \"EndpointGroupArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteEndpointGroup")
.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=GlobalAccelerator_V20180706.DeleteEndpointGroup")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"EndpointGroupArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
EndpointGroupArn: ''
});
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=GlobalAccelerator_V20180706.DeleteEndpointGroup');
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=GlobalAccelerator_V20180706.DeleteEndpointGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {EndpointGroupArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteEndpointGroup';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"EndpointGroupArn":""}'
};
try {
const response = await 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=GlobalAccelerator_V20180706.DeleteEndpointGroup',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "EndpointGroupArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"EndpointGroupArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteEndpointGroup")
.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({EndpointGroupArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteEndpointGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {EndpointGroupArn: ''},
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=GlobalAccelerator_V20180706.DeleteEndpointGroup');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
EndpointGroupArn: ''
});
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=GlobalAccelerator_V20180706.DeleteEndpointGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {EndpointGroupArn: ''}
};
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=GlobalAccelerator_V20180706.DeleteEndpointGroup';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"EndpointGroupArn":""}'
};
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 = @{ @"EndpointGroupArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteEndpointGroup"]
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=GlobalAccelerator_V20180706.DeleteEndpointGroup" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"EndpointGroupArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteEndpointGroup",
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([
'EndpointGroupArn' => ''
]),
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=GlobalAccelerator_V20180706.DeleteEndpointGroup', [
'body' => '{
"EndpointGroupArn": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteEndpointGroup');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'EndpointGroupArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'EndpointGroupArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteEndpointGroup');
$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=GlobalAccelerator_V20180706.DeleteEndpointGroup' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EndpointGroupArn": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteEndpointGroup' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EndpointGroupArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.DeleteEndpointGroup"
payload = { "EndpointGroupArn": "" }
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=GlobalAccelerator_V20180706.DeleteEndpointGroup"
payload <- "{\n \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.DeleteEndpointGroup")
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 \"EndpointGroupArn\": \"\"\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 \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.DeleteEndpointGroup";
let payload = json!({"EndpointGroupArn": ""});
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=GlobalAccelerator_V20180706.DeleteEndpointGroup' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"EndpointGroupArn": ""
}'
echo '{
"EndpointGroupArn": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteEndpointGroup' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "EndpointGroupArn": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteEndpointGroup'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["EndpointGroupArn": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteEndpointGroup")! 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
DeleteListener
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteListener
HEADERS
X-Amz-Target
BODY json
{
"ListenerArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteListener");
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 \"ListenerArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteListener" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ListenerArn ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteListener"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ListenerArn\": \"\"\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=GlobalAccelerator_V20180706.DeleteListener"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ListenerArn\": \"\"\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=GlobalAccelerator_V20180706.DeleteListener");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ListenerArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteListener"
payload := strings.NewReader("{\n \"ListenerArn\": \"\"\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
{
"ListenerArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteListener")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ListenerArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteListener"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ListenerArn\": \"\"\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 \"ListenerArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteListener")
.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=GlobalAccelerator_V20180706.DeleteListener")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ListenerArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
ListenerArn: ''
});
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=GlobalAccelerator_V20180706.DeleteListener');
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=GlobalAccelerator_V20180706.DeleteListener',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ListenerArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteListener';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ListenerArn":""}'
};
try {
const response = await 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=GlobalAccelerator_V20180706.DeleteListener',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ListenerArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ListenerArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteListener")
.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({ListenerArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteListener',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {ListenerArn: ''},
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=GlobalAccelerator_V20180706.DeleteListener');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ListenerArn: ''
});
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=GlobalAccelerator_V20180706.DeleteListener',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ListenerArn: ''}
};
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=GlobalAccelerator_V20180706.DeleteListener';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ListenerArn":""}'
};
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 = @{ @"ListenerArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteListener"]
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=GlobalAccelerator_V20180706.DeleteListener" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"ListenerArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteListener",
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([
'ListenerArn' => ''
]),
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=GlobalAccelerator_V20180706.DeleteListener', [
'body' => '{
"ListenerArn": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteListener');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ListenerArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ListenerArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteListener');
$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=GlobalAccelerator_V20180706.DeleteListener' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ListenerArn": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteListener' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ListenerArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ListenerArn\": \"\"\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=GlobalAccelerator_V20180706.DeleteListener"
payload = { "ListenerArn": "" }
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=GlobalAccelerator_V20180706.DeleteListener"
payload <- "{\n \"ListenerArn\": \"\"\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=GlobalAccelerator_V20180706.DeleteListener")
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 \"ListenerArn\": \"\"\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 \"ListenerArn\": \"\"\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=GlobalAccelerator_V20180706.DeleteListener";
let payload = json!({"ListenerArn": ""});
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=GlobalAccelerator_V20180706.DeleteListener' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ListenerArn": ""
}'
echo '{
"ListenerArn": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteListener' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ListenerArn": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteListener'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["ListenerArn": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeleteListener")! 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
DenyCustomRoutingTraffic
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DenyCustomRoutingTraffic
HEADERS
X-Amz-Target
BODY json
{
"EndpointGroupArn": "",
"EndpointId": "",
"DestinationAddresses": "",
"DestinationPorts": "",
"DenyAllTrafficToEndpoint": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DenyCustomRoutingTraffic");
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 \"EndpointGroupArn\": \"\",\n \"EndpointId\": \"\",\n \"DestinationAddresses\": \"\",\n \"DestinationPorts\": \"\",\n \"DenyAllTrafficToEndpoint\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DenyCustomRoutingTraffic" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:EndpointGroupArn ""
:EndpointId ""
:DestinationAddresses ""
:DestinationPorts ""
:DenyAllTrafficToEndpoint ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DenyCustomRoutingTraffic"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"EndpointGroupArn\": \"\",\n \"EndpointId\": \"\",\n \"DestinationAddresses\": \"\",\n \"DestinationPorts\": \"\",\n \"DenyAllTrafficToEndpoint\": \"\"\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=GlobalAccelerator_V20180706.DenyCustomRoutingTraffic"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"EndpointGroupArn\": \"\",\n \"EndpointId\": \"\",\n \"DestinationAddresses\": \"\",\n \"DestinationPorts\": \"\",\n \"DenyAllTrafficToEndpoint\": \"\"\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=GlobalAccelerator_V20180706.DenyCustomRoutingTraffic");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"EndpointGroupArn\": \"\",\n \"EndpointId\": \"\",\n \"DestinationAddresses\": \"\",\n \"DestinationPorts\": \"\",\n \"DenyAllTrafficToEndpoint\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DenyCustomRoutingTraffic"
payload := strings.NewReader("{\n \"EndpointGroupArn\": \"\",\n \"EndpointId\": \"\",\n \"DestinationAddresses\": \"\",\n \"DestinationPorts\": \"\",\n \"DenyAllTrafficToEndpoint\": \"\"\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: 138
{
"EndpointGroupArn": "",
"EndpointId": "",
"DestinationAddresses": "",
"DestinationPorts": "",
"DenyAllTrafficToEndpoint": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DenyCustomRoutingTraffic")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"EndpointGroupArn\": \"\",\n \"EndpointId\": \"\",\n \"DestinationAddresses\": \"\",\n \"DestinationPorts\": \"\",\n \"DenyAllTrafficToEndpoint\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DenyCustomRoutingTraffic"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"EndpointGroupArn\": \"\",\n \"EndpointId\": \"\",\n \"DestinationAddresses\": \"\",\n \"DestinationPorts\": \"\",\n \"DenyAllTrafficToEndpoint\": \"\"\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 \"EndpointGroupArn\": \"\",\n \"EndpointId\": \"\",\n \"DestinationAddresses\": \"\",\n \"DestinationPorts\": \"\",\n \"DenyAllTrafficToEndpoint\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DenyCustomRoutingTraffic")
.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=GlobalAccelerator_V20180706.DenyCustomRoutingTraffic")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"EndpointGroupArn\": \"\",\n \"EndpointId\": \"\",\n \"DestinationAddresses\": \"\",\n \"DestinationPorts\": \"\",\n \"DenyAllTrafficToEndpoint\": \"\"\n}")
.asString();
const data = JSON.stringify({
EndpointGroupArn: '',
EndpointId: '',
DestinationAddresses: '',
DestinationPorts: '',
DenyAllTrafficToEndpoint: ''
});
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=GlobalAccelerator_V20180706.DenyCustomRoutingTraffic');
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=GlobalAccelerator_V20180706.DenyCustomRoutingTraffic',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
EndpointGroupArn: '',
EndpointId: '',
DestinationAddresses: '',
DestinationPorts: '',
DenyAllTrafficToEndpoint: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DenyCustomRoutingTraffic';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"EndpointGroupArn":"","EndpointId":"","DestinationAddresses":"","DestinationPorts":"","DenyAllTrafficToEndpoint":""}'
};
try {
const response = await 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=GlobalAccelerator_V20180706.DenyCustomRoutingTraffic',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "EndpointGroupArn": "",\n "EndpointId": "",\n "DestinationAddresses": "",\n "DestinationPorts": "",\n "DenyAllTrafficToEndpoint": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"EndpointGroupArn\": \"\",\n \"EndpointId\": \"\",\n \"DestinationAddresses\": \"\",\n \"DestinationPorts\": \"\",\n \"DenyAllTrafficToEndpoint\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DenyCustomRoutingTraffic")
.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({
EndpointGroupArn: '',
EndpointId: '',
DestinationAddresses: '',
DestinationPorts: '',
DenyAllTrafficToEndpoint: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DenyCustomRoutingTraffic',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
EndpointGroupArn: '',
EndpointId: '',
DestinationAddresses: '',
DestinationPorts: '',
DenyAllTrafficToEndpoint: ''
},
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=GlobalAccelerator_V20180706.DenyCustomRoutingTraffic');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
EndpointGroupArn: '',
EndpointId: '',
DestinationAddresses: '',
DestinationPorts: '',
DenyAllTrafficToEndpoint: ''
});
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=GlobalAccelerator_V20180706.DenyCustomRoutingTraffic',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
EndpointGroupArn: '',
EndpointId: '',
DestinationAddresses: '',
DestinationPorts: '',
DenyAllTrafficToEndpoint: ''
}
};
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=GlobalAccelerator_V20180706.DenyCustomRoutingTraffic';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"EndpointGroupArn":"","EndpointId":"","DestinationAddresses":"","DestinationPorts":"","DenyAllTrafficToEndpoint":""}'
};
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 = @{ @"EndpointGroupArn": @"",
@"EndpointId": @"",
@"DestinationAddresses": @"",
@"DestinationPorts": @"",
@"DenyAllTrafficToEndpoint": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DenyCustomRoutingTraffic"]
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=GlobalAccelerator_V20180706.DenyCustomRoutingTraffic" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"EndpointGroupArn\": \"\",\n \"EndpointId\": \"\",\n \"DestinationAddresses\": \"\",\n \"DestinationPorts\": \"\",\n \"DenyAllTrafficToEndpoint\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DenyCustomRoutingTraffic",
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([
'EndpointGroupArn' => '',
'EndpointId' => '',
'DestinationAddresses' => '',
'DestinationPorts' => '',
'DenyAllTrafficToEndpoint' => ''
]),
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=GlobalAccelerator_V20180706.DenyCustomRoutingTraffic', [
'body' => '{
"EndpointGroupArn": "",
"EndpointId": "",
"DestinationAddresses": "",
"DestinationPorts": "",
"DenyAllTrafficToEndpoint": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DenyCustomRoutingTraffic');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'EndpointGroupArn' => '',
'EndpointId' => '',
'DestinationAddresses' => '',
'DestinationPorts' => '',
'DenyAllTrafficToEndpoint' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'EndpointGroupArn' => '',
'EndpointId' => '',
'DestinationAddresses' => '',
'DestinationPorts' => '',
'DenyAllTrafficToEndpoint' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DenyCustomRoutingTraffic');
$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=GlobalAccelerator_V20180706.DenyCustomRoutingTraffic' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EndpointGroupArn": "",
"EndpointId": "",
"DestinationAddresses": "",
"DestinationPorts": "",
"DenyAllTrafficToEndpoint": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DenyCustomRoutingTraffic' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EndpointGroupArn": "",
"EndpointId": "",
"DestinationAddresses": "",
"DestinationPorts": "",
"DenyAllTrafficToEndpoint": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"EndpointGroupArn\": \"\",\n \"EndpointId\": \"\",\n \"DestinationAddresses\": \"\",\n \"DestinationPorts\": \"\",\n \"DenyAllTrafficToEndpoint\": \"\"\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=GlobalAccelerator_V20180706.DenyCustomRoutingTraffic"
payload = {
"EndpointGroupArn": "",
"EndpointId": "",
"DestinationAddresses": "",
"DestinationPorts": "",
"DenyAllTrafficToEndpoint": ""
}
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=GlobalAccelerator_V20180706.DenyCustomRoutingTraffic"
payload <- "{\n \"EndpointGroupArn\": \"\",\n \"EndpointId\": \"\",\n \"DestinationAddresses\": \"\",\n \"DestinationPorts\": \"\",\n \"DenyAllTrafficToEndpoint\": \"\"\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=GlobalAccelerator_V20180706.DenyCustomRoutingTraffic")
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 \"EndpointGroupArn\": \"\",\n \"EndpointId\": \"\",\n \"DestinationAddresses\": \"\",\n \"DestinationPorts\": \"\",\n \"DenyAllTrafficToEndpoint\": \"\"\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 \"EndpointGroupArn\": \"\",\n \"EndpointId\": \"\",\n \"DestinationAddresses\": \"\",\n \"DestinationPorts\": \"\",\n \"DenyAllTrafficToEndpoint\": \"\"\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=GlobalAccelerator_V20180706.DenyCustomRoutingTraffic";
let payload = json!({
"EndpointGroupArn": "",
"EndpointId": "",
"DestinationAddresses": "",
"DestinationPorts": "",
"DenyAllTrafficToEndpoint": ""
});
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=GlobalAccelerator_V20180706.DenyCustomRoutingTraffic' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"EndpointGroupArn": "",
"EndpointId": "",
"DestinationAddresses": "",
"DestinationPorts": "",
"DenyAllTrafficToEndpoint": ""
}'
echo '{
"EndpointGroupArn": "",
"EndpointId": "",
"DestinationAddresses": "",
"DestinationPorts": "",
"DenyAllTrafficToEndpoint": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DenyCustomRoutingTraffic' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "EndpointGroupArn": "",\n "EndpointId": "",\n "DestinationAddresses": "",\n "DestinationPorts": "",\n "DenyAllTrafficToEndpoint": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DenyCustomRoutingTraffic'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"EndpointGroupArn": "",
"EndpointId": "",
"DestinationAddresses": "",
"DestinationPorts": "",
"DenyAllTrafficToEndpoint": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DenyCustomRoutingTraffic")! 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
DeprovisionByoipCidr
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeprovisionByoipCidr
HEADERS
X-Amz-Target
BODY json
{
"Cidr": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeprovisionByoipCidr");
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 \"Cidr\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeprovisionByoipCidr" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Cidr ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeprovisionByoipCidr"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Cidr\": \"\"\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=GlobalAccelerator_V20180706.DeprovisionByoipCidr"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Cidr\": \"\"\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=GlobalAccelerator_V20180706.DeprovisionByoipCidr");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Cidr\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeprovisionByoipCidr"
payload := strings.NewReader("{\n \"Cidr\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 16
{
"Cidr": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeprovisionByoipCidr")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Cidr\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeprovisionByoipCidr"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Cidr\": \"\"\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 \"Cidr\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeprovisionByoipCidr")
.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=GlobalAccelerator_V20180706.DeprovisionByoipCidr")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Cidr\": \"\"\n}")
.asString();
const data = JSON.stringify({
Cidr: ''
});
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=GlobalAccelerator_V20180706.DeprovisionByoipCidr');
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=GlobalAccelerator_V20180706.DeprovisionByoipCidr',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Cidr: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeprovisionByoipCidr';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Cidr":""}'
};
try {
const response = await 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=GlobalAccelerator_V20180706.DeprovisionByoipCidr',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Cidr": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Cidr\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeprovisionByoipCidr")
.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({Cidr: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeprovisionByoipCidr',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Cidr: ''},
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=GlobalAccelerator_V20180706.DeprovisionByoipCidr');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Cidr: ''
});
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=GlobalAccelerator_V20180706.DeprovisionByoipCidr',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Cidr: ''}
};
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=GlobalAccelerator_V20180706.DeprovisionByoipCidr';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Cidr":""}'
};
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 = @{ @"Cidr": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeprovisionByoipCidr"]
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=GlobalAccelerator_V20180706.DeprovisionByoipCidr" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Cidr\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeprovisionByoipCidr",
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([
'Cidr' => ''
]),
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=GlobalAccelerator_V20180706.DeprovisionByoipCidr', [
'body' => '{
"Cidr": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeprovisionByoipCidr');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Cidr' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Cidr' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeprovisionByoipCidr');
$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=GlobalAccelerator_V20180706.DeprovisionByoipCidr' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Cidr": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeprovisionByoipCidr' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Cidr": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Cidr\": \"\"\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=GlobalAccelerator_V20180706.DeprovisionByoipCidr"
payload = { "Cidr": "" }
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=GlobalAccelerator_V20180706.DeprovisionByoipCidr"
payload <- "{\n \"Cidr\": \"\"\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=GlobalAccelerator_V20180706.DeprovisionByoipCidr")
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 \"Cidr\": \"\"\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 \"Cidr\": \"\"\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=GlobalAccelerator_V20180706.DeprovisionByoipCidr";
let payload = json!({"Cidr": ""});
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=GlobalAccelerator_V20180706.DeprovisionByoipCidr' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Cidr": ""
}'
echo '{
"Cidr": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeprovisionByoipCidr' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Cidr": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeprovisionByoipCidr'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["Cidr": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DeprovisionByoipCidr")! 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
DescribeAccelerator
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeAccelerator
HEADERS
X-Amz-Target
BODY json
{
"AcceleratorArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeAccelerator");
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 \"AcceleratorArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeAccelerator" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:AcceleratorArn ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeAccelerator"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"AcceleratorArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeAccelerator"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"AcceleratorArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeAccelerator");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AcceleratorArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeAccelerator"
payload := strings.NewReader("{\n \"AcceleratorArn\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 26
{
"AcceleratorArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeAccelerator")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"AcceleratorArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeAccelerator"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AcceleratorArn\": \"\"\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 \"AcceleratorArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeAccelerator")
.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=GlobalAccelerator_V20180706.DescribeAccelerator")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"AcceleratorArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
AcceleratorArn: ''
});
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=GlobalAccelerator_V20180706.DescribeAccelerator');
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=GlobalAccelerator_V20180706.DescribeAccelerator',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AcceleratorArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeAccelerator';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AcceleratorArn":""}'
};
try {
const response = await 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=GlobalAccelerator_V20180706.DescribeAccelerator',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "AcceleratorArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AcceleratorArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeAccelerator")
.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({AcceleratorArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeAccelerator',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {AcceleratorArn: ''},
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=GlobalAccelerator_V20180706.DescribeAccelerator');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
AcceleratorArn: ''
});
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=GlobalAccelerator_V20180706.DescribeAccelerator',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AcceleratorArn: ''}
};
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=GlobalAccelerator_V20180706.DescribeAccelerator';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AcceleratorArn":""}'
};
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 = @{ @"AcceleratorArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeAccelerator"]
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=GlobalAccelerator_V20180706.DescribeAccelerator" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"AcceleratorArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeAccelerator",
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([
'AcceleratorArn' => ''
]),
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=GlobalAccelerator_V20180706.DescribeAccelerator', [
'body' => '{
"AcceleratorArn": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeAccelerator');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AcceleratorArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AcceleratorArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeAccelerator');
$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=GlobalAccelerator_V20180706.DescribeAccelerator' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AcceleratorArn": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeAccelerator' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AcceleratorArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AcceleratorArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeAccelerator"
payload = { "AcceleratorArn": "" }
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=GlobalAccelerator_V20180706.DescribeAccelerator"
payload <- "{\n \"AcceleratorArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeAccelerator")
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 \"AcceleratorArn\": \"\"\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 \"AcceleratorArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeAccelerator";
let payload = json!({"AcceleratorArn": ""});
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=GlobalAccelerator_V20180706.DescribeAccelerator' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"AcceleratorArn": ""
}'
echo '{
"AcceleratorArn": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeAccelerator' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "AcceleratorArn": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeAccelerator'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["AcceleratorArn": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeAccelerator")! 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
DescribeAcceleratorAttributes
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeAcceleratorAttributes
HEADERS
X-Amz-Target
BODY json
{
"AcceleratorArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeAcceleratorAttributes");
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 \"AcceleratorArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeAcceleratorAttributes" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:AcceleratorArn ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeAcceleratorAttributes"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"AcceleratorArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeAcceleratorAttributes"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"AcceleratorArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeAcceleratorAttributes");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AcceleratorArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeAcceleratorAttributes"
payload := strings.NewReader("{\n \"AcceleratorArn\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 26
{
"AcceleratorArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeAcceleratorAttributes")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"AcceleratorArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeAcceleratorAttributes"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AcceleratorArn\": \"\"\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 \"AcceleratorArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeAcceleratorAttributes")
.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=GlobalAccelerator_V20180706.DescribeAcceleratorAttributes")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"AcceleratorArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
AcceleratorArn: ''
});
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=GlobalAccelerator_V20180706.DescribeAcceleratorAttributes');
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=GlobalAccelerator_V20180706.DescribeAcceleratorAttributes',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AcceleratorArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeAcceleratorAttributes';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AcceleratorArn":""}'
};
try {
const response = await 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=GlobalAccelerator_V20180706.DescribeAcceleratorAttributes',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "AcceleratorArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AcceleratorArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeAcceleratorAttributes")
.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({AcceleratorArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeAcceleratorAttributes',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {AcceleratorArn: ''},
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=GlobalAccelerator_V20180706.DescribeAcceleratorAttributes');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
AcceleratorArn: ''
});
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=GlobalAccelerator_V20180706.DescribeAcceleratorAttributes',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AcceleratorArn: ''}
};
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=GlobalAccelerator_V20180706.DescribeAcceleratorAttributes';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AcceleratorArn":""}'
};
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 = @{ @"AcceleratorArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeAcceleratorAttributes"]
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=GlobalAccelerator_V20180706.DescribeAcceleratorAttributes" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"AcceleratorArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeAcceleratorAttributes",
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([
'AcceleratorArn' => ''
]),
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=GlobalAccelerator_V20180706.DescribeAcceleratorAttributes', [
'body' => '{
"AcceleratorArn": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeAcceleratorAttributes');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AcceleratorArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AcceleratorArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeAcceleratorAttributes');
$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=GlobalAccelerator_V20180706.DescribeAcceleratorAttributes' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AcceleratorArn": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeAcceleratorAttributes' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AcceleratorArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AcceleratorArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeAcceleratorAttributes"
payload = { "AcceleratorArn": "" }
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=GlobalAccelerator_V20180706.DescribeAcceleratorAttributes"
payload <- "{\n \"AcceleratorArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeAcceleratorAttributes")
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 \"AcceleratorArn\": \"\"\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 \"AcceleratorArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeAcceleratorAttributes";
let payload = json!({"AcceleratorArn": ""});
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=GlobalAccelerator_V20180706.DescribeAcceleratorAttributes' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"AcceleratorArn": ""
}'
echo '{
"AcceleratorArn": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeAcceleratorAttributes' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "AcceleratorArn": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeAcceleratorAttributes'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["AcceleratorArn": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeAcceleratorAttributes")! 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
DescribeCustomRoutingAccelerator
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingAccelerator
HEADERS
X-Amz-Target
BODY json
{
"AcceleratorArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingAccelerator");
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 \"AcceleratorArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingAccelerator" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:AcceleratorArn ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingAccelerator"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"AcceleratorArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeCustomRoutingAccelerator"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"AcceleratorArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeCustomRoutingAccelerator");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AcceleratorArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingAccelerator"
payload := strings.NewReader("{\n \"AcceleratorArn\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 26
{
"AcceleratorArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingAccelerator")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"AcceleratorArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingAccelerator"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AcceleratorArn\": \"\"\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 \"AcceleratorArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingAccelerator")
.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=GlobalAccelerator_V20180706.DescribeCustomRoutingAccelerator")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"AcceleratorArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
AcceleratorArn: ''
});
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=GlobalAccelerator_V20180706.DescribeCustomRoutingAccelerator');
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=GlobalAccelerator_V20180706.DescribeCustomRoutingAccelerator',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AcceleratorArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingAccelerator';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AcceleratorArn":""}'
};
try {
const response = await 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=GlobalAccelerator_V20180706.DescribeCustomRoutingAccelerator',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "AcceleratorArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AcceleratorArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingAccelerator")
.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({AcceleratorArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingAccelerator',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {AcceleratorArn: ''},
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=GlobalAccelerator_V20180706.DescribeCustomRoutingAccelerator');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
AcceleratorArn: ''
});
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=GlobalAccelerator_V20180706.DescribeCustomRoutingAccelerator',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AcceleratorArn: ''}
};
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=GlobalAccelerator_V20180706.DescribeCustomRoutingAccelerator';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AcceleratorArn":""}'
};
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 = @{ @"AcceleratorArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingAccelerator"]
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=GlobalAccelerator_V20180706.DescribeCustomRoutingAccelerator" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"AcceleratorArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingAccelerator",
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([
'AcceleratorArn' => ''
]),
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=GlobalAccelerator_V20180706.DescribeCustomRoutingAccelerator', [
'body' => '{
"AcceleratorArn": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingAccelerator');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AcceleratorArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AcceleratorArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingAccelerator');
$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=GlobalAccelerator_V20180706.DescribeCustomRoutingAccelerator' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AcceleratorArn": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingAccelerator' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AcceleratorArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AcceleratorArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeCustomRoutingAccelerator"
payload = { "AcceleratorArn": "" }
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=GlobalAccelerator_V20180706.DescribeCustomRoutingAccelerator"
payload <- "{\n \"AcceleratorArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeCustomRoutingAccelerator")
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 \"AcceleratorArn\": \"\"\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 \"AcceleratorArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeCustomRoutingAccelerator";
let payload = json!({"AcceleratorArn": ""});
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=GlobalAccelerator_V20180706.DescribeCustomRoutingAccelerator' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"AcceleratorArn": ""
}'
echo '{
"AcceleratorArn": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingAccelerator' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "AcceleratorArn": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingAccelerator'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["AcceleratorArn": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingAccelerator")! 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
DescribeCustomRoutingAcceleratorAttributes
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingAcceleratorAttributes
HEADERS
X-Amz-Target
BODY json
{
"AcceleratorArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingAcceleratorAttributes");
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 \"AcceleratorArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingAcceleratorAttributes" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:AcceleratorArn ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingAcceleratorAttributes"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"AcceleratorArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeCustomRoutingAcceleratorAttributes"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"AcceleratorArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeCustomRoutingAcceleratorAttributes");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AcceleratorArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingAcceleratorAttributes"
payload := strings.NewReader("{\n \"AcceleratorArn\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 26
{
"AcceleratorArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingAcceleratorAttributes")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"AcceleratorArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingAcceleratorAttributes"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AcceleratorArn\": \"\"\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 \"AcceleratorArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingAcceleratorAttributes")
.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=GlobalAccelerator_V20180706.DescribeCustomRoutingAcceleratorAttributes")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"AcceleratorArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
AcceleratorArn: ''
});
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=GlobalAccelerator_V20180706.DescribeCustomRoutingAcceleratorAttributes');
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=GlobalAccelerator_V20180706.DescribeCustomRoutingAcceleratorAttributes',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AcceleratorArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingAcceleratorAttributes';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AcceleratorArn":""}'
};
try {
const response = await 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=GlobalAccelerator_V20180706.DescribeCustomRoutingAcceleratorAttributes',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "AcceleratorArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AcceleratorArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingAcceleratorAttributes")
.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({AcceleratorArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingAcceleratorAttributes',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {AcceleratorArn: ''},
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=GlobalAccelerator_V20180706.DescribeCustomRoutingAcceleratorAttributes');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
AcceleratorArn: ''
});
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=GlobalAccelerator_V20180706.DescribeCustomRoutingAcceleratorAttributes',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AcceleratorArn: ''}
};
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=GlobalAccelerator_V20180706.DescribeCustomRoutingAcceleratorAttributes';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AcceleratorArn":""}'
};
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 = @{ @"AcceleratorArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingAcceleratorAttributes"]
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=GlobalAccelerator_V20180706.DescribeCustomRoutingAcceleratorAttributes" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"AcceleratorArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingAcceleratorAttributes",
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([
'AcceleratorArn' => ''
]),
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=GlobalAccelerator_V20180706.DescribeCustomRoutingAcceleratorAttributes', [
'body' => '{
"AcceleratorArn": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingAcceleratorAttributes');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AcceleratorArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AcceleratorArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingAcceleratorAttributes');
$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=GlobalAccelerator_V20180706.DescribeCustomRoutingAcceleratorAttributes' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AcceleratorArn": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingAcceleratorAttributes' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AcceleratorArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AcceleratorArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeCustomRoutingAcceleratorAttributes"
payload = { "AcceleratorArn": "" }
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=GlobalAccelerator_V20180706.DescribeCustomRoutingAcceleratorAttributes"
payload <- "{\n \"AcceleratorArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeCustomRoutingAcceleratorAttributes")
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 \"AcceleratorArn\": \"\"\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 \"AcceleratorArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeCustomRoutingAcceleratorAttributes";
let payload = json!({"AcceleratorArn": ""});
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=GlobalAccelerator_V20180706.DescribeCustomRoutingAcceleratorAttributes' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"AcceleratorArn": ""
}'
echo '{
"AcceleratorArn": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingAcceleratorAttributes' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "AcceleratorArn": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingAcceleratorAttributes'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["AcceleratorArn": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingAcceleratorAttributes")! 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
DescribeCustomRoutingEndpointGroup
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingEndpointGroup
HEADERS
X-Amz-Target
BODY json
{
"EndpointGroupArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingEndpointGroup");
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 \"EndpointGroupArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingEndpointGroup" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:EndpointGroupArn ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingEndpointGroup"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeCustomRoutingEndpointGroup"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeCustomRoutingEndpointGroup");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"EndpointGroupArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingEndpointGroup"
payload := strings.NewReader("{\n \"EndpointGroupArn\": \"\"\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
{
"EndpointGroupArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingEndpointGroup")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"EndpointGroupArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingEndpointGroup"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"EndpointGroupArn\": \"\"\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 \"EndpointGroupArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingEndpointGroup")
.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=GlobalAccelerator_V20180706.DescribeCustomRoutingEndpointGroup")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"EndpointGroupArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
EndpointGroupArn: ''
});
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=GlobalAccelerator_V20180706.DescribeCustomRoutingEndpointGroup');
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=GlobalAccelerator_V20180706.DescribeCustomRoutingEndpointGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {EndpointGroupArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingEndpointGroup';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"EndpointGroupArn":""}'
};
try {
const response = await 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=GlobalAccelerator_V20180706.DescribeCustomRoutingEndpointGroup',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "EndpointGroupArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"EndpointGroupArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingEndpointGroup")
.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({EndpointGroupArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingEndpointGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {EndpointGroupArn: ''},
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=GlobalAccelerator_V20180706.DescribeCustomRoutingEndpointGroup');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
EndpointGroupArn: ''
});
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=GlobalAccelerator_V20180706.DescribeCustomRoutingEndpointGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {EndpointGroupArn: ''}
};
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=GlobalAccelerator_V20180706.DescribeCustomRoutingEndpointGroup';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"EndpointGroupArn":""}'
};
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 = @{ @"EndpointGroupArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingEndpointGroup"]
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=GlobalAccelerator_V20180706.DescribeCustomRoutingEndpointGroup" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"EndpointGroupArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingEndpointGroup",
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([
'EndpointGroupArn' => ''
]),
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=GlobalAccelerator_V20180706.DescribeCustomRoutingEndpointGroup', [
'body' => '{
"EndpointGroupArn": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingEndpointGroup');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'EndpointGroupArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'EndpointGroupArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingEndpointGroup');
$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=GlobalAccelerator_V20180706.DescribeCustomRoutingEndpointGroup' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EndpointGroupArn": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingEndpointGroup' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EndpointGroupArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeCustomRoutingEndpointGroup"
payload = { "EndpointGroupArn": "" }
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=GlobalAccelerator_V20180706.DescribeCustomRoutingEndpointGroup"
payload <- "{\n \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeCustomRoutingEndpointGroup")
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 \"EndpointGroupArn\": \"\"\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 \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeCustomRoutingEndpointGroup";
let payload = json!({"EndpointGroupArn": ""});
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=GlobalAccelerator_V20180706.DescribeCustomRoutingEndpointGroup' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"EndpointGroupArn": ""
}'
echo '{
"EndpointGroupArn": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingEndpointGroup' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "EndpointGroupArn": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingEndpointGroup'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["EndpointGroupArn": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingEndpointGroup")! 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
DescribeCustomRoutingListener
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingListener
HEADERS
X-Amz-Target
BODY json
{
"ListenerArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingListener");
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 \"ListenerArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingListener" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ListenerArn ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingListener"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ListenerArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeCustomRoutingListener"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ListenerArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeCustomRoutingListener");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ListenerArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingListener"
payload := strings.NewReader("{\n \"ListenerArn\": \"\"\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
{
"ListenerArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingListener")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ListenerArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingListener"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ListenerArn\": \"\"\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 \"ListenerArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingListener")
.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=GlobalAccelerator_V20180706.DescribeCustomRoutingListener")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ListenerArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
ListenerArn: ''
});
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=GlobalAccelerator_V20180706.DescribeCustomRoutingListener');
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=GlobalAccelerator_V20180706.DescribeCustomRoutingListener',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ListenerArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingListener';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ListenerArn":""}'
};
try {
const response = await 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=GlobalAccelerator_V20180706.DescribeCustomRoutingListener',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ListenerArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ListenerArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingListener")
.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({ListenerArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingListener',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {ListenerArn: ''},
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=GlobalAccelerator_V20180706.DescribeCustomRoutingListener');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ListenerArn: ''
});
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=GlobalAccelerator_V20180706.DescribeCustomRoutingListener',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ListenerArn: ''}
};
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=GlobalAccelerator_V20180706.DescribeCustomRoutingListener';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ListenerArn":""}'
};
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 = @{ @"ListenerArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingListener"]
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=GlobalAccelerator_V20180706.DescribeCustomRoutingListener" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"ListenerArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingListener",
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([
'ListenerArn' => ''
]),
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=GlobalAccelerator_V20180706.DescribeCustomRoutingListener', [
'body' => '{
"ListenerArn": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingListener');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ListenerArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ListenerArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingListener');
$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=GlobalAccelerator_V20180706.DescribeCustomRoutingListener' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ListenerArn": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingListener' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ListenerArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ListenerArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeCustomRoutingListener"
payload = { "ListenerArn": "" }
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=GlobalAccelerator_V20180706.DescribeCustomRoutingListener"
payload <- "{\n \"ListenerArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeCustomRoutingListener")
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 \"ListenerArn\": \"\"\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 \"ListenerArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeCustomRoutingListener";
let payload = json!({"ListenerArn": ""});
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=GlobalAccelerator_V20180706.DescribeCustomRoutingListener' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ListenerArn": ""
}'
echo '{
"ListenerArn": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingListener' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ListenerArn": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingListener'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["ListenerArn": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeCustomRoutingListener")! 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
DescribeEndpointGroup
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeEndpointGroup
HEADERS
X-Amz-Target
BODY json
{
"EndpointGroupArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeEndpointGroup");
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 \"EndpointGroupArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeEndpointGroup" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:EndpointGroupArn ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeEndpointGroup"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeEndpointGroup"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeEndpointGroup");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"EndpointGroupArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeEndpointGroup"
payload := strings.NewReader("{\n \"EndpointGroupArn\": \"\"\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
{
"EndpointGroupArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeEndpointGroup")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"EndpointGroupArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeEndpointGroup"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"EndpointGroupArn\": \"\"\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 \"EndpointGroupArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeEndpointGroup")
.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=GlobalAccelerator_V20180706.DescribeEndpointGroup")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"EndpointGroupArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
EndpointGroupArn: ''
});
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=GlobalAccelerator_V20180706.DescribeEndpointGroup');
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=GlobalAccelerator_V20180706.DescribeEndpointGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {EndpointGroupArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeEndpointGroup';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"EndpointGroupArn":""}'
};
try {
const response = await 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=GlobalAccelerator_V20180706.DescribeEndpointGroup',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "EndpointGroupArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"EndpointGroupArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeEndpointGroup")
.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({EndpointGroupArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeEndpointGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {EndpointGroupArn: ''},
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=GlobalAccelerator_V20180706.DescribeEndpointGroup');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
EndpointGroupArn: ''
});
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=GlobalAccelerator_V20180706.DescribeEndpointGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {EndpointGroupArn: ''}
};
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=GlobalAccelerator_V20180706.DescribeEndpointGroup';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"EndpointGroupArn":""}'
};
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 = @{ @"EndpointGroupArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeEndpointGroup"]
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=GlobalAccelerator_V20180706.DescribeEndpointGroup" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"EndpointGroupArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeEndpointGroup",
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([
'EndpointGroupArn' => ''
]),
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=GlobalAccelerator_V20180706.DescribeEndpointGroup', [
'body' => '{
"EndpointGroupArn": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeEndpointGroup');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'EndpointGroupArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'EndpointGroupArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeEndpointGroup');
$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=GlobalAccelerator_V20180706.DescribeEndpointGroup' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EndpointGroupArn": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeEndpointGroup' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EndpointGroupArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeEndpointGroup"
payload = { "EndpointGroupArn": "" }
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=GlobalAccelerator_V20180706.DescribeEndpointGroup"
payload <- "{\n \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeEndpointGroup")
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 \"EndpointGroupArn\": \"\"\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 \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeEndpointGroup";
let payload = json!({"EndpointGroupArn": ""});
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=GlobalAccelerator_V20180706.DescribeEndpointGroup' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"EndpointGroupArn": ""
}'
echo '{
"EndpointGroupArn": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeEndpointGroup' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "EndpointGroupArn": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeEndpointGroup'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["EndpointGroupArn": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeEndpointGroup")! 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
DescribeListener
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeListener
HEADERS
X-Amz-Target
BODY json
{
"ListenerArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeListener");
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 \"ListenerArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeListener" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ListenerArn ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeListener"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ListenerArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeListener"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ListenerArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeListener");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ListenerArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeListener"
payload := strings.NewReader("{\n \"ListenerArn\": \"\"\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
{
"ListenerArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeListener")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ListenerArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeListener"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ListenerArn\": \"\"\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 \"ListenerArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeListener")
.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=GlobalAccelerator_V20180706.DescribeListener")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ListenerArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
ListenerArn: ''
});
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=GlobalAccelerator_V20180706.DescribeListener');
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=GlobalAccelerator_V20180706.DescribeListener',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ListenerArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeListener';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ListenerArn":""}'
};
try {
const response = await 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=GlobalAccelerator_V20180706.DescribeListener',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ListenerArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ListenerArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeListener")
.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({ListenerArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeListener',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {ListenerArn: ''},
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=GlobalAccelerator_V20180706.DescribeListener');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ListenerArn: ''
});
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=GlobalAccelerator_V20180706.DescribeListener',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ListenerArn: ''}
};
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=GlobalAccelerator_V20180706.DescribeListener';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ListenerArn":""}'
};
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 = @{ @"ListenerArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeListener"]
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=GlobalAccelerator_V20180706.DescribeListener" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"ListenerArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeListener",
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([
'ListenerArn' => ''
]),
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=GlobalAccelerator_V20180706.DescribeListener', [
'body' => '{
"ListenerArn": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeListener');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ListenerArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ListenerArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeListener');
$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=GlobalAccelerator_V20180706.DescribeListener' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ListenerArn": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeListener' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ListenerArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ListenerArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeListener"
payload = { "ListenerArn": "" }
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=GlobalAccelerator_V20180706.DescribeListener"
payload <- "{\n \"ListenerArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeListener")
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 \"ListenerArn\": \"\"\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 \"ListenerArn\": \"\"\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=GlobalAccelerator_V20180706.DescribeListener";
let payload = json!({"ListenerArn": ""});
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=GlobalAccelerator_V20180706.DescribeListener' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ListenerArn": ""
}'
echo '{
"ListenerArn": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeListener' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ListenerArn": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeListener'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["ListenerArn": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.DescribeListener")! 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
ListAccelerators
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListAccelerators
HEADERS
X-Amz-Target
BODY json
{
"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=GlobalAccelerator_V20180706.ListAccelerators");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListAccelerators" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListAccelerators"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\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=GlobalAccelerator_V20180706.ListAccelerators"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\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=GlobalAccelerator_V20180706.ListAccelerators");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\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=GlobalAccelerator_V20180706.ListAccelerators"
payload := strings.NewReader("{\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: 41
{
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListAccelerators")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\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=GlobalAccelerator_V20180706.ListAccelerators"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\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 \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListAccelerators")
.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=GlobalAccelerator_V20180706.ListAccelerators")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
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=GlobalAccelerator_V20180706.ListAccelerators');
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=GlobalAccelerator_V20180706.ListAccelerators',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListAccelerators';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"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=GlobalAccelerator_V20180706.ListAccelerators',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\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 \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListAccelerators")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListAccelerators',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {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=GlobalAccelerator_V20180706.ListAccelerators');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
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=GlobalAccelerator_V20180706.ListAccelerators',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {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=GlobalAccelerator_V20180706.ListAccelerators';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"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 = @{ @"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListAccelerators"]
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=GlobalAccelerator_V20180706.ListAccelerators" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListAccelerators",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'MaxResults' => '',
'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=GlobalAccelerator_V20180706.ListAccelerators', [
'body' => '{
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListAccelerators');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListAccelerators');
$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=GlobalAccelerator_V20180706.ListAccelerators' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListAccelerators' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\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=GlobalAccelerator_V20180706.ListAccelerators"
payload = {
"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=GlobalAccelerator_V20180706.ListAccelerators"
payload <- "{\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=GlobalAccelerator_V20180706.ListAccelerators")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"MaxResults\": \"\",\n \"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=GlobalAccelerator_V20180706.ListAccelerators";
let payload = json!({
"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=GlobalAccelerator_V20180706.ListAccelerators' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"MaxResults": "",
"NextToken": ""
}'
echo '{
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListAccelerators' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListAccelerators'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListAccelerators")! 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
ListByoipCidrs
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListByoipCidrs
HEADERS
X-Amz-Target
BODY json
{
"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=GlobalAccelerator_V20180706.ListByoipCidrs");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListByoipCidrs" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListByoipCidrs"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\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=GlobalAccelerator_V20180706.ListByoipCidrs"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\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=GlobalAccelerator_V20180706.ListByoipCidrs");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\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=GlobalAccelerator_V20180706.ListByoipCidrs"
payload := strings.NewReader("{\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: 41
{
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListByoipCidrs")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\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=GlobalAccelerator_V20180706.ListByoipCidrs"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\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 \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListByoipCidrs")
.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=GlobalAccelerator_V20180706.ListByoipCidrs")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
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=GlobalAccelerator_V20180706.ListByoipCidrs');
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=GlobalAccelerator_V20180706.ListByoipCidrs',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListByoipCidrs';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"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=GlobalAccelerator_V20180706.ListByoipCidrs',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\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 \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListByoipCidrs")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListByoipCidrs',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {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=GlobalAccelerator_V20180706.ListByoipCidrs');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
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=GlobalAccelerator_V20180706.ListByoipCidrs',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {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=GlobalAccelerator_V20180706.ListByoipCidrs';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"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 = @{ @"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListByoipCidrs"]
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=GlobalAccelerator_V20180706.ListByoipCidrs" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListByoipCidrs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'MaxResults' => '',
'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=GlobalAccelerator_V20180706.ListByoipCidrs', [
'body' => '{
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListByoipCidrs');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListByoipCidrs');
$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=GlobalAccelerator_V20180706.ListByoipCidrs' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListByoipCidrs' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\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=GlobalAccelerator_V20180706.ListByoipCidrs"
payload = {
"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=GlobalAccelerator_V20180706.ListByoipCidrs"
payload <- "{\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=GlobalAccelerator_V20180706.ListByoipCidrs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"MaxResults\": \"\",\n \"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=GlobalAccelerator_V20180706.ListByoipCidrs";
let payload = json!({
"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=GlobalAccelerator_V20180706.ListByoipCidrs' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"MaxResults": "",
"NextToken": ""
}'
echo '{
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListByoipCidrs' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListByoipCidrs'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListByoipCidrs")! 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
ListCustomRoutingAccelerators
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingAccelerators
HEADERS
X-Amz-Target
BODY json
{
"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=GlobalAccelerator_V20180706.ListCustomRoutingAccelerators");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingAccelerators" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingAccelerators"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\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=GlobalAccelerator_V20180706.ListCustomRoutingAccelerators"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\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=GlobalAccelerator_V20180706.ListCustomRoutingAccelerators");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\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=GlobalAccelerator_V20180706.ListCustomRoutingAccelerators"
payload := strings.NewReader("{\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: 41
{
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingAccelerators")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\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=GlobalAccelerator_V20180706.ListCustomRoutingAccelerators"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\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 \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingAccelerators")
.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=GlobalAccelerator_V20180706.ListCustomRoutingAccelerators")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
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=GlobalAccelerator_V20180706.ListCustomRoutingAccelerators');
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=GlobalAccelerator_V20180706.ListCustomRoutingAccelerators',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingAccelerators';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"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=GlobalAccelerator_V20180706.ListCustomRoutingAccelerators',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\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 \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingAccelerators")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingAccelerators',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {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=GlobalAccelerator_V20180706.ListCustomRoutingAccelerators');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
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=GlobalAccelerator_V20180706.ListCustomRoutingAccelerators',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {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=GlobalAccelerator_V20180706.ListCustomRoutingAccelerators';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"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 = @{ @"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingAccelerators"]
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=GlobalAccelerator_V20180706.ListCustomRoutingAccelerators" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingAccelerators",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'MaxResults' => '',
'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=GlobalAccelerator_V20180706.ListCustomRoutingAccelerators', [
'body' => '{
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingAccelerators');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingAccelerators');
$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=GlobalAccelerator_V20180706.ListCustomRoutingAccelerators' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingAccelerators' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\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=GlobalAccelerator_V20180706.ListCustomRoutingAccelerators"
payload = {
"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=GlobalAccelerator_V20180706.ListCustomRoutingAccelerators"
payload <- "{\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=GlobalAccelerator_V20180706.ListCustomRoutingAccelerators")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"MaxResults\": \"\",\n \"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=GlobalAccelerator_V20180706.ListCustomRoutingAccelerators";
let payload = json!({
"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=GlobalAccelerator_V20180706.ListCustomRoutingAccelerators' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"MaxResults": "",
"NextToken": ""
}'
echo '{
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingAccelerators' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingAccelerators'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingAccelerators")! 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
ListCustomRoutingEndpointGroups
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups
HEADERS
X-Amz-Target
BODY json
{
"ListenerArn": "",
"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=GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups");
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 \"ListenerArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ListenerArn ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ListenerArn\": \"\",\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=GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ListenerArn\": \"\",\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=GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ListenerArn\": \"\",\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=GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups"
payload := strings.NewReader("{\n \"ListenerArn\": \"\",\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
{
"ListenerArn": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ListenerArn\": \"\",\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=GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ListenerArn\": \"\",\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 \"ListenerArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups")
.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=GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ListenerArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
ListenerArn: '',
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=GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups');
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=GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ListenerArn: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ListenerArn":"","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=GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ListenerArn": "",\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 \"ListenerArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups")
.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({ListenerArn: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {ListenerArn: '', 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=GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ListenerArn: '',
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=GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ListenerArn: '', 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=GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ListenerArn":"","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 = @{ @"ListenerArn": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups"]
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=GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"ListenerArn\": \"\",\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=GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups",
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([
'ListenerArn' => '',
'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=GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups', [
'body' => '{
"ListenerArn": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ListenerArn' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ListenerArn' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups');
$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=GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ListenerArn": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ListenerArn": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ListenerArn\": \"\",\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=GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups"
payload = {
"ListenerArn": "",
"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=GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups"
payload <- "{\n \"ListenerArn\": \"\",\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=GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups")
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 \"ListenerArn\": \"\",\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 \"ListenerArn\": \"\",\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=GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups";
let payload = json!({
"ListenerArn": "",
"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=GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ListenerArn": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"ListenerArn": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ListenerArn": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"ListenerArn": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingEndpointGroups")! 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
ListCustomRoutingListeners
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingListeners
HEADERS
X-Amz-Target
BODY json
{
"AcceleratorArn": "",
"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=GlobalAccelerator_V20180706.ListCustomRoutingListeners");
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 \"AcceleratorArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingListeners" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:AcceleratorArn ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingListeners"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"AcceleratorArn\": \"\",\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=GlobalAccelerator_V20180706.ListCustomRoutingListeners"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"AcceleratorArn\": \"\",\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=GlobalAccelerator_V20180706.ListCustomRoutingListeners");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AcceleratorArn\": \"\",\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=GlobalAccelerator_V20180706.ListCustomRoutingListeners"
payload := strings.NewReader("{\n \"AcceleratorArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 65
{
"AcceleratorArn": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingListeners")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"AcceleratorArn\": \"\",\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=GlobalAccelerator_V20180706.ListCustomRoutingListeners"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AcceleratorArn\": \"\",\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 \"AcceleratorArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingListeners")
.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=GlobalAccelerator_V20180706.ListCustomRoutingListeners")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"AcceleratorArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
AcceleratorArn: '',
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=GlobalAccelerator_V20180706.ListCustomRoutingListeners');
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=GlobalAccelerator_V20180706.ListCustomRoutingListeners',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AcceleratorArn: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingListeners';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AcceleratorArn":"","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=GlobalAccelerator_V20180706.ListCustomRoutingListeners',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "AcceleratorArn": "",\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 \"AcceleratorArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingListeners")
.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({AcceleratorArn: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingListeners',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {AcceleratorArn: '', 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=GlobalAccelerator_V20180706.ListCustomRoutingListeners');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
AcceleratorArn: '',
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=GlobalAccelerator_V20180706.ListCustomRoutingListeners',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AcceleratorArn: '', 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=GlobalAccelerator_V20180706.ListCustomRoutingListeners';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AcceleratorArn":"","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 = @{ @"AcceleratorArn": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingListeners"]
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=GlobalAccelerator_V20180706.ListCustomRoutingListeners" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"AcceleratorArn\": \"\",\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=GlobalAccelerator_V20180706.ListCustomRoutingListeners",
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([
'AcceleratorArn' => '',
'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=GlobalAccelerator_V20180706.ListCustomRoutingListeners', [
'body' => '{
"AcceleratorArn": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingListeners');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AcceleratorArn' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AcceleratorArn' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingListeners');
$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=GlobalAccelerator_V20180706.ListCustomRoutingListeners' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AcceleratorArn": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingListeners' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AcceleratorArn": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AcceleratorArn\": \"\",\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=GlobalAccelerator_V20180706.ListCustomRoutingListeners"
payload = {
"AcceleratorArn": "",
"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=GlobalAccelerator_V20180706.ListCustomRoutingListeners"
payload <- "{\n \"AcceleratorArn\": \"\",\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=GlobalAccelerator_V20180706.ListCustomRoutingListeners")
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 \"AcceleratorArn\": \"\",\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 \"AcceleratorArn\": \"\",\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=GlobalAccelerator_V20180706.ListCustomRoutingListeners";
let payload = json!({
"AcceleratorArn": "",
"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=GlobalAccelerator_V20180706.ListCustomRoutingListeners' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"AcceleratorArn": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"AcceleratorArn": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingListeners' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "AcceleratorArn": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingListeners'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"AcceleratorArn": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingListeners")! 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
ListCustomRoutingPortMappings
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingPortMappings
HEADERS
X-Amz-Target
BODY json
{
"AcceleratorArn": "",
"EndpointGroupArn": "",
"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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappings");
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 \"AcceleratorArn\": \"\",\n \"EndpointGroupArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingPortMappings" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:AcceleratorArn ""
:EndpointGroupArn ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingPortMappings"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"AcceleratorArn\": \"\",\n \"EndpointGroupArn\": \"\",\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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappings"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"AcceleratorArn\": \"\",\n \"EndpointGroupArn\": \"\",\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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappings");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AcceleratorArn\": \"\",\n \"EndpointGroupArn\": \"\",\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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappings"
payload := strings.NewReader("{\n \"AcceleratorArn\": \"\",\n \"EndpointGroupArn\": \"\",\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: 91
{
"AcceleratorArn": "",
"EndpointGroupArn": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingPortMappings")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"AcceleratorArn\": \"\",\n \"EndpointGroupArn\": \"\",\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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappings"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AcceleratorArn\": \"\",\n \"EndpointGroupArn\": \"\",\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 \"AcceleratorArn\": \"\",\n \"EndpointGroupArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingPortMappings")
.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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappings")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"AcceleratorArn\": \"\",\n \"EndpointGroupArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
AcceleratorArn: '',
EndpointGroupArn: '',
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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappings');
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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappings',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AcceleratorArn: '', EndpointGroupArn: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingPortMappings';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AcceleratorArn":"","EndpointGroupArn":"","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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappings',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "AcceleratorArn": "",\n "EndpointGroupArn": "",\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 \"AcceleratorArn\": \"\",\n \"EndpointGroupArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingPortMappings")
.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({AcceleratorArn: '', EndpointGroupArn: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingPortMappings',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {AcceleratorArn: '', EndpointGroupArn: '', 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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappings');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
AcceleratorArn: '',
EndpointGroupArn: '',
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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappings',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AcceleratorArn: '', EndpointGroupArn: '', 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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappings';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AcceleratorArn":"","EndpointGroupArn":"","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 = @{ @"AcceleratorArn": @"",
@"EndpointGroupArn": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingPortMappings"]
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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappings" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"AcceleratorArn\": \"\",\n \"EndpointGroupArn\": \"\",\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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappings",
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([
'AcceleratorArn' => '',
'EndpointGroupArn' => '',
'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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappings', [
'body' => '{
"AcceleratorArn": "",
"EndpointGroupArn": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingPortMappings');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AcceleratorArn' => '',
'EndpointGroupArn' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AcceleratorArn' => '',
'EndpointGroupArn' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingPortMappings');
$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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappings' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AcceleratorArn": "",
"EndpointGroupArn": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingPortMappings' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AcceleratorArn": "",
"EndpointGroupArn": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AcceleratorArn\": \"\",\n \"EndpointGroupArn\": \"\",\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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappings"
payload = {
"AcceleratorArn": "",
"EndpointGroupArn": "",
"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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappings"
payload <- "{\n \"AcceleratorArn\": \"\",\n \"EndpointGroupArn\": \"\",\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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappings")
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 \"AcceleratorArn\": \"\",\n \"EndpointGroupArn\": \"\",\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 \"AcceleratorArn\": \"\",\n \"EndpointGroupArn\": \"\",\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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappings";
let payload = json!({
"AcceleratorArn": "",
"EndpointGroupArn": "",
"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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappings' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"AcceleratorArn": "",
"EndpointGroupArn": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"AcceleratorArn": "",
"EndpointGroupArn": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingPortMappings' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "AcceleratorArn": "",\n "EndpointGroupArn": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingPortMappings'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"AcceleratorArn": "",
"EndpointGroupArn": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingPortMappings")! 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
ListCustomRoutingPortMappingsByDestination
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination
HEADERS
X-Amz-Target
BODY json
{
"EndpointId": "",
"DestinationAddress": "",
"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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination");
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 \"EndpointId\": \"\",\n \"DestinationAddress\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:EndpointId ""
:DestinationAddress ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"EndpointId\": \"\",\n \"DestinationAddress\": \"\",\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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"EndpointId\": \"\",\n \"DestinationAddress\": \"\",\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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"EndpointId\": \"\",\n \"DestinationAddress\": \"\",\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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination"
payload := strings.NewReader("{\n \"EndpointId\": \"\",\n \"DestinationAddress\": \"\",\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: 89
{
"EndpointId": "",
"DestinationAddress": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"EndpointId\": \"\",\n \"DestinationAddress\": \"\",\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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"EndpointId\": \"\",\n \"DestinationAddress\": \"\",\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 \"EndpointId\": \"\",\n \"DestinationAddress\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination")
.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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"EndpointId\": \"\",\n \"DestinationAddress\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
EndpointId: '',
DestinationAddress: '',
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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination');
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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {EndpointId: '', DestinationAddress: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"EndpointId":"","DestinationAddress":"","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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "EndpointId": "",\n "DestinationAddress": "",\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 \"EndpointId\": \"\",\n \"DestinationAddress\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination")
.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({EndpointId: '', DestinationAddress: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {EndpointId: '', DestinationAddress: '', 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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
EndpointId: '',
DestinationAddress: '',
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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {EndpointId: '', DestinationAddress: '', 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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"EndpointId":"","DestinationAddress":"","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 = @{ @"EndpointId": @"",
@"DestinationAddress": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination"]
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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"EndpointId\": \"\",\n \"DestinationAddress\": \"\",\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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination",
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([
'EndpointId' => '',
'DestinationAddress' => '',
'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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination', [
'body' => '{
"EndpointId": "",
"DestinationAddress": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'EndpointId' => '',
'DestinationAddress' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'EndpointId' => '',
'DestinationAddress' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination');
$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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EndpointId": "",
"DestinationAddress": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EndpointId": "",
"DestinationAddress": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"EndpointId\": \"\",\n \"DestinationAddress\": \"\",\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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination"
payload = {
"EndpointId": "",
"DestinationAddress": "",
"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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination"
payload <- "{\n \"EndpointId\": \"\",\n \"DestinationAddress\": \"\",\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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination")
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 \"EndpointId\": \"\",\n \"DestinationAddress\": \"\",\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 \"EndpointId\": \"\",\n \"DestinationAddress\": \"\",\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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination";
let payload = json!({
"EndpointId": "",
"DestinationAddress": "",
"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=GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"EndpointId": "",
"DestinationAddress": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"EndpointId": "",
"DestinationAddress": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "EndpointId": "",\n "DestinationAddress": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"EndpointId": "",
"DestinationAddress": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListCustomRoutingPortMappingsByDestination")! 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
ListEndpointGroups
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListEndpointGroups
HEADERS
X-Amz-Target
BODY json
{
"ListenerArn": "",
"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=GlobalAccelerator_V20180706.ListEndpointGroups");
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 \"ListenerArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListEndpointGroups" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ListenerArn ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListEndpointGroups"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ListenerArn\": \"\",\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=GlobalAccelerator_V20180706.ListEndpointGroups"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ListenerArn\": \"\",\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=GlobalAccelerator_V20180706.ListEndpointGroups");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ListenerArn\": \"\",\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=GlobalAccelerator_V20180706.ListEndpointGroups"
payload := strings.NewReader("{\n \"ListenerArn\": \"\",\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
{
"ListenerArn": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListEndpointGroups")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ListenerArn\": \"\",\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=GlobalAccelerator_V20180706.ListEndpointGroups"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ListenerArn\": \"\",\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 \"ListenerArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListEndpointGroups")
.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=GlobalAccelerator_V20180706.ListEndpointGroups")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ListenerArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
ListenerArn: '',
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=GlobalAccelerator_V20180706.ListEndpointGroups');
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=GlobalAccelerator_V20180706.ListEndpointGroups',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ListenerArn: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListEndpointGroups';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ListenerArn":"","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=GlobalAccelerator_V20180706.ListEndpointGroups',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ListenerArn": "",\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 \"ListenerArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListEndpointGroups")
.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({ListenerArn: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListEndpointGroups',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {ListenerArn: '', 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=GlobalAccelerator_V20180706.ListEndpointGroups');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ListenerArn: '',
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=GlobalAccelerator_V20180706.ListEndpointGroups',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ListenerArn: '', 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=GlobalAccelerator_V20180706.ListEndpointGroups';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ListenerArn":"","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 = @{ @"ListenerArn": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListEndpointGroups"]
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=GlobalAccelerator_V20180706.ListEndpointGroups" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"ListenerArn\": \"\",\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=GlobalAccelerator_V20180706.ListEndpointGroups",
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([
'ListenerArn' => '',
'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=GlobalAccelerator_V20180706.ListEndpointGroups', [
'body' => '{
"ListenerArn": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListEndpointGroups');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ListenerArn' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ListenerArn' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListEndpointGroups');
$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=GlobalAccelerator_V20180706.ListEndpointGroups' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ListenerArn": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListEndpointGroups' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ListenerArn": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ListenerArn\": \"\",\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=GlobalAccelerator_V20180706.ListEndpointGroups"
payload = {
"ListenerArn": "",
"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=GlobalAccelerator_V20180706.ListEndpointGroups"
payload <- "{\n \"ListenerArn\": \"\",\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=GlobalAccelerator_V20180706.ListEndpointGroups")
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 \"ListenerArn\": \"\",\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 \"ListenerArn\": \"\",\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=GlobalAccelerator_V20180706.ListEndpointGroups";
let payload = json!({
"ListenerArn": "",
"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=GlobalAccelerator_V20180706.ListEndpointGroups' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ListenerArn": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"ListenerArn": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListEndpointGroups' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ListenerArn": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListEndpointGroups'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"ListenerArn": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListEndpointGroups")! 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
ListListeners
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListListeners
HEADERS
X-Amz-Target
BODY json
{
"AcceleratorArn": "",
"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=GlobalAccelerator_V20180706.ListListeners");
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 \"AcceleratorArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListListeners" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:AcceleratorArn ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListListeners"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"AcceleratorArn\": \"\",\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=GlobalAccelerator_V20180706.ListListeners"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"AcceleratorArn\": \"\",\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=GlobalAccelerator_V20180706.ListListeners");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AcceleratorArn\": \"\",\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=GlobalAccelerator_V20180706.ListListeners"
payload := strings.NewReader("{\n \"AcceleratorArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 65
{
"AcceleratorArn": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListListeners")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"AcceleratorArn\": \"\",\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=GlobalAccelerator_V20180706.ListListeners"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AcceleratorArn\": \"\",\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 \"AcceleratorArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListListeners")
.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=GlobalAccelerator_V20180706.ListListeners")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"AcceleratorArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
AcceleratorArn: '',
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=GlobalAccelerator_V20180706.ListListeners');
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=GlobalAccelerator_V20180706.ListListeners',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AcceleratorArn: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListListeners';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AcceleratorArn":"","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=GlobalAccelerator_V20180706.ListListeners',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "AcceleratorArn": "",\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 \"AcceleratorArn\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListListeners")
.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({AcceleratorArn: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListListeners',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {AcceleratorArn: '', 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=GlobalAccelerator_V20180706.ListListeners');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
AcceleratorArn: '',
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=GlobalAccelerator_V20180706.ListListeners',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AcceleratorArn: '', 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=GlobalAccelerator_V20180706.ListListeners';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AcceleratorArn":"","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 = @{ @"AcceleratorArn": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListListeners"]
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=GlobalAccelerator_V20180706.ListListeners" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"AcceleratorArn\": \"\",\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=GlobalAccelerator_V20180706.ListListeners",
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([
'AcceleratorArn' => '',
'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=GlobalAccelerator_V20180706.ListListeners', [
'body' => '{
"AcceleratorArn": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListListeners');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AcceleratorArn' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AcceleratorArn' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListListeners');
$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=GlobalAccelerator_V20180706.ListListeners' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AcceleratorArn": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListListeners' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AcceleratorArn": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AcceleratorArn\": \"\",\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=GlobalAccelerator_V20180706.ListListeners"
payload = {
"AcceleratorArn": "",
"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=GlobalAccelerator_V20180706.ListListeners"
payload <- "{\n \"AcceleratorArn\": \"\",\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=GlobalAccelerator_V20180706.ListListeners")
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 \"AcceleratorArn\": \"\",\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 \"AcceleratorArn\": \"\",\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=GlobalAccelerator_V20180706.ListListeners";
let payload = json!({
"AcceleratorArn": "",
"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=GlobalAccelerator_V20180706.ListListeners' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"AcceleratorArn": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"AcceleratorArn": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListListeners' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "AcceleratorArn": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListListeners'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"AcceleratorArn": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListListeners")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
ListTagsForResource
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListTagsForResource
HEADERS
X-Amz-Target
BODY json
{
"ResourceArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListTagsForResource");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"ResourceArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListTagsForResource" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ResourceArn ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListTagsForResource"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ResourceArn\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListTagsForResource"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ResourceArn\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListTagsForResource");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ResourceArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListTagsForResource"
payload := strings.NewReader("{\n \"ResourceArn\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 23
{
"ResourceArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListTagsForResource")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ResourceArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListTagsForResource"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ResourceArn\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"ResourceArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListTagsForResource")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListTagsForResource")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ResourceArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
ResourceArn: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListTagsForResource');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListTagsForResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ResourceArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListTagsForResource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ResourceArn":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListTagsForResource',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ResourceArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ResourceArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListTagsForResource")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({ResourceArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListTagsForResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {ResourceArn: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListTagsForResource');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ResourceArn: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListTagsForResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ResourceArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListTagsForResource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ResourceArn":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"ResourceArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListTagsForResource"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListTagsForResource" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"ResourceArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListTagsForResource",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ResourceArn' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListTagsForResource', [
'body' => '{
"ResourceArn": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListTagsForResource');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ResourceArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ResourceArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListTagsForResource');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListTagsForResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ResourceArn": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListTagsForResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ResourceArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ResourceArn\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListTagsForResource"
payload = { "ResourceArn": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListTagsForResource"
payload <- "{\n \"ResourceArn\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListTagsForResource")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"ResourceArn\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"ResourceArn\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListTagsForResource";
let payload = json!({"ResourceArn": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListTagsForResource' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ResourceArn": ""
}'
echo '{
"ResourceArn": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListTagsForResource' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ResourceArn": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListTagsForResource'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["ResourceArn": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ListTagsForResource")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
ProvisionByoipCidr
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ProvisionByoipCidr
HEADERS
X-Amz-Target
BODY json
{
"Cidr": "",
"CidrAuthorizationContext": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ProvisionByoipCidr");
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 \"Cidr\": \"\",\n \"CidrAuthorizationContext\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ProvisionByoipCidr" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Cidr ""
:CidrAuthorizationContext ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ProvisionByoipCidr"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Cidr\": \"\",\n \"CidrAuthorizationContext\": \"\"\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=GlobalAccelerator_V20180706.ProvisionByoipCidr"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Cidr\": \"\",\n \"CidrAuthorizationContext\": \"\"\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=GlobalAccelerator_V20180706.ProvisionByoipCidr");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Cidr\": \"\",\n \"CidrAuthorizationContext\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ProvisionByoipCidr"
payload := strings.NewReader("{\n \"Cidr\": \"\",\n \"CidrAuthorizationContext\": \"\"\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: 50
{
"Cidr": "",
"CidrAuthorizationContext": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ProvisionByoipCidr")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Cidr\": \"\",\n \"CidrAuthorizationContext\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ProvisionByoipCidr"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Cidr\": \"\",\n \"CidrAuthorizationContext\": \"\"\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 \"Cidr\": \"\",\n \"CidrAuthorizationContext\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ProvisionByoipCidr")
.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=GlobalAccelerator_V20180706.ProvisionByoipCidr")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Cidr\": \"\",\n \"CidrAuthorizationContext\": \"\"\n}")
.asString();
const data = JSON.stringify({
Cidr: '',
CidrAuthorizationContext: ''
});
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=GlobalAccelerator_V20180706.ProvisionByoipCidr');
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=GlobalAccelerator_V20180706.ProvisionByoipCidr',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Cidr: '', CidrAuthorizationContext: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ProvisionByoipCidr';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Cidr":"","CidrAuthorizationContext":""}'
};
try {
const response = await 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=GlobalAccelerator_V20180706.ProvisionByoipCidr',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Cidr": "",\n "CidrAuthorizationContext": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Cidr\": \"\",\n \"CidrAuthorizationContext\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ProvisionByoipCidr")
.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({Cidr: '', CidrAuthorizationContext: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ProvisionByoipCidr',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Cidr: '', CidrAuthorizationContext: ''},
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=GlobalAccelerator_V20180706.ProvisionByoipCidr');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Cidr: '',
CidrAuthorizationContext: ''
});
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=GlobalAccelerator_V20180706.ProvisionByoipCidr',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Cidr: '', CidrAuthorizationContext: ''}
};
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=GlobalAccelerator_V20180706.ProvisionByoipCidr';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Cidr":"","CidrAuthorizationContext":""}'
};
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 = @{ @"Cidr": @"",
@"CidrAuthorizationContext": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ProvisionByoipCidr"]
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=GlobalAccelerator_V20180706.ProvisionByoipCidr" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Cidr\": \"\",\n \"CidrAuthorizationContext\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ProvisionByoipCidr",
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([
'Cidr' => '',
'CidrAuthorizationContext' => ''
]),
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=GlobalAccelerator_V20180706.ProvisionByoipCidr', [
'body' => '{
"Cidr": "",
"CidrAuthorizationContext": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ProvisionByoipCidr');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Cidr' => '',
'CidrAuthorizationContext' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Cidr' => '',
'CidrAuthorizationContext' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ProvisionByoipCidr');
$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=GlobalAccelerator_V20180706.ProvisionByoipCidr' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Cidr": "",
"CidrAuthorizationContext": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ProvisionByoipCidr' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Cidr": "",
"CidrAuthorizationContext": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Cidr\": \"\",\n \"CidrAuthorizationContext\": \"\"\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=GlobalAccelerator_V20180706.ProvisionByoipCidr"
payload = {
"Cidr": "",
"CidrAuthorizationContext": ""
}
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=GlobalAccelerator_V20180706.ProvisionByoipCidr"
payload <- "{\n \"Cidr\": \"\",\n \"CidrAuthorizationContext\": \"\"\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=GlobalAccelerator_V20180706.ProvisionByoipCidr")
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 \"Cidr\": \"\",\n \"CidrAuthorizationContext\": \"\"\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 \"Cidr\": \"\",\n \"CidrAuthorizationContext\": \"\"\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=GlobalAccelerator_V20180706.ProvisionByoipCidr";
let payload = json!({
"Cidr": "",
"CidrAuthorizationContext": ""
});
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=GlobalAccelerator_V20180706.ProvisionByoipCidr' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Cidr": "",
"CidrAuthorizationContext": ""
}'
echo '{
"Cidr": "",
"CidrAuthorizationContext": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ProvisionByoipCidr' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Cidr": "",\n "CidrAuthorizationContext": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ProvisionByoipCidr'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Cidr": "",
"CidrAuthorizationContext": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.ProvisionByoipCidr")! 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
RemoveCustomRoutingEndpoints
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.RemoveCustomRoutingEndpoints
HEADERS
X-Amz-Target
BODY json
{
"EndpointIds": "",
"EndpointGroupArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.RemoveCustomRoutingEndpoints");
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 \"EndpointIds\": \"\",\n \"EndpointGroupArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.RemoveCustomRoutingEndpoints" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:EndpointIds ""
:EndpointGroupArn ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.RemoveCustomRoutingEndpoints"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"EndpointIds\": \"\",\n \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.RemoveCustomRoutingEndpoints"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"EndpointIds\": \"\",\n \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.RemoveCustomRoutingEndpoints");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"EndpointIds\": \"\",\n \"EndpointGroupArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.RemoveCustomRoutingEndpoints"
payload := strings.NewReader("{\n \"EndpointIds\": \"\",\n \"EndpointGroupArn\": \"\"\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
{
"EndpointIds": "",
"EndpointGroupArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.RemoveCustomRoutingEndpoints")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"EndpointIds\": \"\",\n \"EndpointGroupArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.RemoveCustomRoutingEndpoints"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"EndpointIds\": \"\",\n \"EndpointGroupArn\": \"\"\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 \"EndpointIds\": \"\",\n \"EndpointGroupArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.RemoveCustomRoutingEndpoints")
.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=GlobalAccelerator_V20180706.RemoveCustomRoutingEndpoints")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"EndpointIds\": \"\",\n \"EndpointGroupArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
EndpointIds: '',
EndpointGroupArn: ''
});
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=GlobalAccelerator_V20180706.RemoveCustomRoutingEndpoints');
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=GlobalAccelerator_V20180706.RemoveCustomRoutingEndpoints',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {EndpointIds: '', EndpointGroupArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.RemoveCustomRoutingEndpoints';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"EndpointIds":"","EndpointGroupArn":""}'
};
try {
const response = await 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=GlobalAccelerator_V20180706.RemoveCustomRoutingEndpoints',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "EndpointIds": "",\n "EndpointGroupArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"EndpointIds\": \"\",\n \"EndpointGroupArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.RemoveCustomRoutingEndpoints")
.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({EndpointIds: '', EndpointGroupArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.RemoveCustomRoutingEndpoints',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {EndpointIds: '', EndpointGroupArn: ''},
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=GlobalAccelerator_V20180706.RemoveCustomRoutingEndpoints');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
EndpointIds: '',
EndpointGroupArn: ''
});
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=GlobalAccelerator_V20180706.RemoveCustomRoutingEndpoints',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {EndpointIds: '', EndpointGroupArn: ''}
};
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=GlobalAccelerator_V20180706.RemoveCustomRoutingEndpoints';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"EndpointIds":"","EndpointGroupArn":""}'
};
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 = @{ @"EndpointIds": @"",
@"EndpointGroupArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.RemoveCustomRoutingEndpoints"]
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=GlobalAccelerator_V20180706.RemoveCustomRoutingEndpoints" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"EndpointIds\": \"\",\n \"EndpointGroupArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.RemoveCustomRoutingEndpoints",
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([
'EndpointIds' => '',
'EndpointGroupArn' => ''
]),
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=GlobalAccelerator_V20180706.RemoveCustomRoutingEndpoints', [
'body' => '{
"EndpointIds": "",
"EndpointGroupArn": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.RemoveCustomRoutingEndpoints');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'EndpointIds' => '',
'EndpointGroupArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'EndpointIds' => '',
'EndpointGroupArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.RemoveCustomRoutingEndpoints');
$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=GlobalAccelerator_V20180706.RemoveCustomRoutingEndpoints' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EndpointIds": "",
"EndpointGroupArn": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.RemoveCustomRoutingEndpoints' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EndpointIds": "",
"EndpointGroupArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"EndpointIds\": \"\",\n \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.RemoveCustomRoutingEndpoints"
payload = {
"EndpointIds": "",
"EndpointGroupArn": ""
}
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=GlobalAccelerator_V20180706.RemoveCustomRoutingEndpoints"
payload <- "{\n \"EndpointIds\": \"\",\n \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.RemoveCustomRoutingEndpoints")
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 \"EndpointIds\": \"\",\n \"EndpointGroupArn\": \"\"\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 \"EndpointIds\": \"\",\n \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.RemoveCustomRoutingEndpoints";
let payload = json!({
"EndpointIds": "",
"EndpointGroupArn": ""
});
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=GlobalAccelerator_V20180706.RemoveCustomRoutingEndpoints' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"EndpointIds": "",
"EndpointGroupArn": ""
}'
echo '{
"EndpointIds": "",
"EndpointGroupArn": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.RemoveCustomRoutingEndpoints' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "EndpointIds": "",\n "EndpointGroupArn": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.RemoveCustomRoutingEndpoints'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"EndpointIds": "",
"EndpointGroupArn": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.RemoveCustomRoutingEndpoints")! 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
RemoveEndpoints
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.RemoveEndpoints
HEADERS
X-Amz-Target
BODY json
{
"EndpointIdentifiers": "",
"EndpointGroupArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.RemoveEndpoints");
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 \"EndpointIdentifiers\": \"\",\n \"EndpointGroupArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.RemoveEndpoints" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:EndpointIdentifiers ""
:EndpointGroupArn ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.RemoveEndpoints"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"EndpointIdentifiers\": \"\",\n \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.RemoveEndpoints"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"EndpointIdentifiers\": \"\",\n \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.RemoveEndpoints");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"EndpointIdentifiers\": \"\",\n \"EndpointGroupArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.RemoveEndpoints"
payload := strings.NewReader("{\n \"EndpointIdentifiers\": \"\",\n \"EndpointGroupArn\": \"\"\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
{
"EndpointIdentifiers": "",
"EndpointGroupArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.RemoveEndpoints")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"EndpointIdentifiers\": \"\",\n \"EndpointGroupArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.RemoveEndpoints"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"EndpointIdentifiers\": \"\",\n \"EndpointGroupArn\": \"\"\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 \"EndpointIdentifiers\": \"\",\n \"EndpointGroupArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.RemoveEndpoints")
.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=GlobalAccelerator_V20180706.RemoveEndpoints")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"EndpointIdentifiers\": \"\",\n \"EndpointGroupArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
EndpointIdentifiers: '',
EndpointGroupArn: ''
});
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=GlobalAccelerator_V20180706.RemoveEndpoints');
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=GlobalAccelerator_V20180706.RemoveEndpoints',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {EndpointIdentifiers: '', EndpointGroupArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.RemoveEndpoints';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"EndpointIdentifiers":"","EndpointGroupArn":""}'
};
try {
const response = await 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=GlobalAccelerator_V20180706.RemoveEndpoints',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "EndpointIdentifiers": "",\n "EndpointGroupArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"EndpointIdentifiers\": \"\",\n \"EndpointGroupArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.RemoveEndpoints")
.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({EndpointIdentifiers: '', EndpointGroupArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.RemoveEndpoints',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {EndpointIdentifiers: '', EndpointGroupArn: ''},
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=GlobalAccelerator_V20180706.RemoveEndpoints');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
EndpointIdentifiers: '',
EndpointGroupArn: ''
});
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=GlobalAccelerator_V20180706.RemoveEndpoints',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {EndpointIdentifiers: '', EndpointGroupArn: ''}
};
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=GlobalAccelerator_V20180706.RemoveEndpoints';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"EndpointIdentifiers":"","EndpointGroupArn":""}'
};
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 = @{ @"EndpointIdentifiers": @"",
@"EndpointGroupArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.RemoveEndpoints"]
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=GlobalAccelerator_V20180706.RemoveEndpoints" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"EndpointIdentifiers\": \"\",\n \"EndpointGroupArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.RemoveEndpoints",
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([
'EndpointIdentifiers' => '',
'EndpointGroupArn' => ''
]),
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=GlobalAccelerator_V20180706.RemoveEndpoints', [
'body' => '{
"EndpointIdentifiers": "",
"EndpointGroupArn": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.RemoveEndpoints');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'EndpointIdentifiers' => '',
'EndpointGroupArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'EndpointIdentifiers' => '',
'EndpointGroupArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.RemoveEndpoints');
$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=GlobalAccelerator_V20180706.RemoveEndpoints' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EndpointIdentifiers": "",
"EndpointGroupArn": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.RemoveEndpoints' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EndpointIdentifiers": "",
"EndpointGroupArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"EndpointIdentifiers\": \"\",\n \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.RemoveEndpoints"
payload = {
"EndpointIdentifiers": "",
"EndpointGroupArn": ""
}
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=GlobalAccelerator_V20180706.RemoveEndpoints"
payload <- "{\n \"EndpointIdentifiers\": \"\",\n \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.RemoveEndpoints")
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 \"EndpointIdentifiers\": \"\",\n \"EndpointGroupArn\": \"\"\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 \"EndpointIdentifiers\": \"\",\n \"EndpointGroupArn\": \"\"\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=GlobalAccelerator_V20180706.RemoveEndpoints";
let payload = json!({
"EndpointIdentifiers": "",
"EndpointGroupArn": ""
});
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=GlobalAccelerator_V20180706.RemoveEndpoints' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"EndpointIdentifiers": "",
"EndpointGroupArn": ""
}'
echo '{
"EndpointIdentifiers": "",
"EndpointGroupArn": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.RemoveEndpoints' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "EndpointIdentifiers": "",\n "EndpointGroupArn": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.RemoveEndpoints'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"EndpointIdentifiers": "",
"EndpointGroupArn": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.RemoveEndpoints")! 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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.TagResource" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ResourceArn ""
:Tags ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.TagResource', [
'body' => '{
"ResourceArn": "",
"Tags": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.TagResource' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ResourceArn": "",
"Tags": ""
}'
echo '{
"ResourceArn": "",
"Tags": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.TagResource")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
UntagResource
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.UntagResource" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ResourceArn ""
:TagKeys ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.UntagResource', [
'body' => '{
"ResourceArn": "",
"TagKeys": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.UntagResource' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ResourceArn": "",
"TagKeys": ""
}'
echo '{
"ResourceArn": "",
"TagKeys": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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=GlobalAccelerator_V20180706.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
UpdateAccelerator
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateAccelerator
HEADERS
X-Amz-Target
BODY json
{
"AcceleratorArn": "",
"Name": "",
"IpAddressType": "",
"Enabled": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateAccelerator");
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 \"AcceleratorArn\": \"\",\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"Enabled\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateAccelerator" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:AcceleratorArn ""
:Name ""
:IpAddressType ""
:Enabled ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateAccelerator"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"AcceleratorArn\": \"\",\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"Enabled\": \"\"\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=GlobalAccelerator_V20180706.UpdateAccelerator"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"AcceleratorArn\": \"\",\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"Enabled\": \"\"\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=GlobalAccelerator_V20180706.UpdateAccelerator");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AcceleratorArn\": \"\",\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"Enabled\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateAccelerator"
payload := strings.NewReader("{\n \"AcceleratorArn\": \"\",\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"Enabled\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 80
{
"AcceleratorArn": "",
"Name": "",
"IpAddressType": "",
"Enabled": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateAccelerator")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"AcceleratorArn\": \"\",\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"Enabled\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateAccelerator"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AcceleratorArn\": \"\",\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"Enabled\": \"\"\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 \"AcceleratorArn\": \"\",\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"Enabled\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateAccelerator")
.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=GlobalAccelerator_V20180706.UpdateAccelerator")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"AcceleratorArn\": \"\",\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"Enabled\": \"\"\n}")
.asString();
const data = JSON.stringify({
AcceleratorArn: '',
Name: '',
IpAddressType: '',
Enabled: ''
});
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=GlobalAccelerator_V20180706.UpdateAccelerator');
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=GlobalAccelerator_V20180706.UpdateAccelerator',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AcceleratorArn: '', Name: '', IpAddressType: '', Enabled: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateAccelerator';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AcceleratorArn":"","Name":"","IpAddressType":"","Enabled":""}'
};
try {
const response = await 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=GlobalAccelerator_V20180706.UpdateAccelerator',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "AcceleratorArn": "",\n "Name": "",\n "IpAddressType": "",\n "Enabled": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AcceleratorArn\": \"\",\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"Enabled\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateAccelerator")
.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({AcceleratorArn: '', Name: '', IpAddressType: '', Enabled: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateAccelerator',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {AcceleratorArn: '', Name: '', IpAddressType: '', Enabled: ''},
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=GlobalAccelerator_V20180706.UpdateAccelerator');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
AcceleratorArn: '',
Name: '',
IpAddressType: '',
Enabled: ''
});
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=GlobalAccelerator_V20180706.UpdateAccelerator',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AcceleratorArn: '', Name: '', IpAddressType: '', Enabled: ''}
};
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=GlobalAccelerator_V20180706.UpdateAccelerator';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AcceleratorArn":"","Name":"","IpAddressType":"","Enabled":""}'
};
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 = @{ @"AcceleratorArn": @"",
@"Name": @"",
@"IpAddressType": @"",
@"Enabled": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateAccelerator"]
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=GlobalAccelerator_V20180706.UpdateAccelerator" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"AcceleratorArn\": \"\",\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"Enabled\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateAccelerator",
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([
'AcceleratorArn' => '',
'Name' => '',
'IpAddressType' => '',
'Enabled' => ''
]),
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=GlobalAccelerator_V20180706.UpdateAccelerator', [
'body' => '{
"AcceleratorArn": "",
"Name": "",
"IpAddressType": "",
"Enabled": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateAccelerator');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AcceleratorArn' => '',
'Name' => '',
'IpAddressType' => '',
'Enabled' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AcceleratorArn' => '',
'Name' => '',
'IpAddressType' => '',
'Enabled' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateAccelerator');
$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=GlobalAccelerator_V20180706.UpdateAccelerator' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AcceleratorArn": "",
"Name": "",
"IpAddressType": "",
"Enabled": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateAccelerator' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AcceleratorArn": "",
"Name": "",
"IpAddressType": "",
"Enabled": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AcceleratorArn\": \"\",\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"Enabled\": \"\"\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=GlobalAccelerator_V20180706.UpdateAccelerator"
payload = {
"AcceleratorArn": "",
"Name": "",
"IpAddressType": "",
"Enabled": ""
}
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=GlobalAccelerator_V20180706.UpdateAccelerator"
payload <- "{\n \"AcceleratorArn\": \"\",\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"Enabled\": \"\"\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=GlobalAccelerator_V20180706.UpdateAccelerator")
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 \"AcceleratorArn\": \"\",\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"Enabled\": \"\"\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 \"AcceleratorArn\": \"\",\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"Enabled\": \"\"\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=GlobalAccelerator_V20180706.UpdateAccelerator";
let payload = json!({
"AcceleratorArn": "",
"Name": "",
"IpAddressType": "",
"Enabled": ""
});
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=GlobalAccelerator_V20180706.UpdateAccelerator' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"AcceleratorArn": "",
"Name": "",
"IpAddressType": "",
"Enabled": ""
}'
echo '{
"AcceleratorArn": "",
"Name": "",
"IpAddressType": "",
"Enabled": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateAccelerator' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "AcceleratorArn": "",\n "Name": "",\n "IpAddressType": "",\n "Enabled": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateAccelerator'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"AcceleratorArn": "",
"Name": "",
"IpAddressType": "",
"Enabled": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateAccelerator")! 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
UpdateAcceleratorAttributes
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateAcceleratorAttributes
HEADERS
X-Amz-Target
BODY json
{
"AcceleratorArn": "",
"FlowLogsEnabled": "",
"FlowLogsS3Bucket": "",
"FlowLogsS3Prefix": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateAcceleratorAttributes");
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 \"AcceleratorArn\": \"\",\n \"FlowLogsEnabled\": \"\",\n \"FlowLogsS3Bucket\": \"\",\n \"FlowLogsS3Prefix\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateAcceleratorAttributes" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:AcceleratorArn ""
:FlowLogsEnabled ""
:FlowLogsS3Bucket ""
:FlowLogsS3Prefix ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateAcceleratorAttributes"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"AcceleratorArn\": \"\",\n \"FlowLogsEnabled\": \"\",\n \"FlowLogsS3Bucket\": \"\",\n \"FlowLogsS3Prefix\": \"\"\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=GlobalAccelerator_V20180706.UpdateAcceleratorAttributes"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"AcceleratorArn\": \"\",\n \"FlowLogsEnabled\": \"\",\n \"FlowLogsS3Bucket\": \"\",\n \"FlowLogsS3Prefix\": \"\"\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=GlobalAccelerator_V20180706.UpdateAcceleratorAttributes");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AcceleratorArn\": \"\",\n \"FlowLogsEnabled\": \"\",\n \"FlowLogsS3Bucket\": \"\",\n \"FlowLogsS3Prefix\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateAcceleratorAttributes"
payload := strings.NewReader("{\n \"AcceleratorArn\": \"\",\n \"FlowLogsEnabled\": \"\",\n \"FlowLogsS3Bucket\": \"\",\n \"FlowLogsS3Prefix\": \"\"\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: 103
{
"AcceleratorArn": "",
"FlowLogsEnabled": "",
"FlowLogsS3Bucket": "",
"FlowLogsS3Prefix": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateAcceleratorAttributes")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"AcceleratorArn\": \"\",\n \"FlowLogsEnabled\": \"\",\n \"FlowLogsS3Bucket\": \"\",\n \"FlowLogsS3Prefix\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateAcceleratorAttributes"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AcceleratorArn\": \"\",\n \"FlowLogsEnabled\": \"\",\n \"FlowLogsS3Bucket\": \"\",\n \"FlowLogsS3Prefix\": \"\"\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 \"AcceleratorArn\": \"\",\n \"FlowLogsEnabled\": \"\",\n \"FlowLogsS3Bucket\": \"\",\n \"FlowLogsS3Prefix\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateAcceleratorAttributes")
.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=GlobalAccelerator_V20180706.UpdateAcceleratorAttributes")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"AcceleratorArn\": \"\",\n \"FlowLogsEnabled\": \"\",\n \"FlowLogsS3Bucket\": \"\",\n \"FlowLogsS3Prefix\": \"\"\n}")
.asString();
const data = JSON.stringify({
AcceleratorArn: '',
FlowLogsEnabled: '',
FlowLogsS3Bucket: '',
FlowLogsS3Prefix: ''
});
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=GlobalAccelerator_V20180706.UpdateAcceleratorAttributes');
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=GlobalAccelerator_V20180706.UpdateAcceleratorAttributes',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
AcceleratorArn: '',
FlowLogsEnabled: '',
FlowLogsS3Bucket: '',
FlowLogsS3Prefix: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateAcceleratorAttributes';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AcceleratorArn":"","FlowLogsEnabled":"","FlowLogsS3Bucket":"","FlowLogsS3Prefix":""}'
};
try {
const response = await 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=GlobalAccelerator_V20180706.UpdateAcceleratorAttributes',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "AcceleratorArn": "",\n "FlowLogsEnabled": "",\n "FlowLogsS3Bucket": "",\n "FlowLogsS3Prefix": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AcceleratorArn\": \"\",\n \"FlowLogsEnabled\": \"\",\n \"FlowLogsS3Bucket\": \"\",\n \"FlowLogsS3Prefix\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateAcceleratorAttributes")
.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({
AcceleratorArn: '',
FlowLogsEnabled: '',
FlowLogsS3Bucket: '',
FlowLogsS3Prefix: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateAcceleratorAttributes',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
AcceleratorArn: '',
FlowLogsEnabled: '',
FlowLogsS3Bucket: '',
FlowLogsS3Prefix: ''
},
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=GlobalAccelerator_V20180706.UpdateAcceleratorAttributes');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
AcceleratorArn: '',
FlowLogsEnabled: '',
FlowLogsS3Bucket: '',
FlowLogsS3Prefix: ''
});
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=GlobalAccelerator_V20180706.UpdateAcceleratorAttributes',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
AcceleratorArn: '',
FlowLogsEnabled: '',
FlowLogsS3Bucket: '',
FlowLogsS3Prefix: ''
}
};
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=GlobalAccelerator_V20180706.UpdateAcceleratorAttributes';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AcceleratorArn":"","FlowLogsEnabled":"","FlowLogsS3Bucket":"","FlowLogsS3Prefix":""}'
};
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 = @{ @"AcceleratorArn": @"",
@"FlowLogsEnabled": @"",
@"FlowLogsS3Bucket": @"",
@"FlowLogsS3Prefix": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateAcceleratorAttributes"]
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=GlobalAccelerator_V20180706.UpdateAcceleratorAttributes" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"AcceleratorArn\": \"\",\n \"FlowLogsEnabled\": \"\",\n \"FlowLogsS3Bucket\": \"\",\n \"FlowLogsS3Prefix\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateAcceleratorAttributes",
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([
'AcceleratorArn' => '',
'FlowLogsEnabled' => '',
'FlowLogsS3Bucket' => '',
'FlowLogsS3Prefix' => ''
]),
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=GlobalAccelerator_V20180706.UpdateAcceleratorAttributes', [
'body' => '{
"AcceleratorArn": "",
"FlowLogsEnabled": "",
"FlowLogsS3Bucket": "",
"FlowLogsS3Prefix": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateAcceleratorAttributes');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AcceleratorArn' => '',
'FlowLogsEnabled' => '',
'FlowLogsS3Bucket' => '',
'FlowLogsS3Prefix' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AcceleratorArn' => '',
'FlowLogsEnabled' => '',
'FlowLogsS3Bucket' => '',
'FlowLogsS3Prefix' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateAcceleratorAttributes');
$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=GlobalAccelerator_V20180706.UpdateAcceleratorAttributes' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AcceleratorArn": "",
"FlowLogsEnabled": "",
"FlowLogsS3Bucket": "",
"FlowLogsS3Prefix": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateAcceleratorAttributes' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AcceleratorArn": "",
"FlowLogsEnabled": "",
"FlowLogsS3Bucket": "",
"FlowLogsS3Prefix": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AcceleratorArn\": \"\",\n \"FlowLogsEnabled\": \"\",\n \"FlowLogsS3Bucket\": \"\",\n \"FlowLogsS3Prefix\": \"\"\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=GlobalAccelerator_V20180706.UpdateAcceleratorAttributes"
payload = {
"AcceleratorArn": "",
"FlowLogsEnabled": "",
"FlowLogsS3Bucket": "",
"FlowLogsS3Prefix": ""
}
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=GlobalAccelerator_V20180706.UpdateAcceleratorAttributes"
payload <- "{\n \"AcceleratorArn\": \"\",\n \"FlowLogsEnabled\": \"\",\n \"FlowLogsS3Bucket\": \"\",\n \"FlowLogsS3Prefix\": \"\"\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=GlobalAccelerator_V20180706.UpdateAcceleratorAttributes")
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 \"AcceleratorArn\": \"\",\n \"FlowLogsEnabled\": \"\",\n \"FlowLogsS3Bucket\": \"\",\n \"FlowLogsS3Prefix\": \"\"\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 \"AcceleratorArn\": \"\",\n \"FlowLogsEnabled\": \"\",\n \"FlowLogsS3Bucket\": \"\",\n \"FlowLogsS3Prefix\": \"\"\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=GlobalAccelerator_V20180706.UpdateAcceleratorAttributes";
let payload = json!({
"AcceleratorArn": "",
"FlowLogsEnabled": "",
"FlowLogsS3Bucket": "",
"FlowLogsS3Prefix": ""
});
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=GlobalAccelerator_V20180706.UpdateAcceleratorAttributes' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"AcceleratorArn": "",
"FlowLogsEnabled": "",
"FlowLogsS3Bucket": "",
"FlowLogsS3Prefix": ""
}'
echo '{
"AcceleratorArn": "",
"FlowLogsEnabled": "",
"FlowLogsS3Bucket": "",
"FlowLogsS3Prefix": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateAcceleratorAttributes' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "AcceleratorArn": "",\n "FlowLogsEnabled": "",\n "FlowLogsS3Bucket": "",\n "FlowLogsS3Prefix": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateAcceleratorAttributes'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"AcceleratorArn": "",
"FlowLogsEnabled": "",
"FlowLogsS3Bucket": "",
"FlowLogsS3Prefix": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateAcceleratorAttributes")! 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
UpdateCustomRoutingAccelerator
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator
HEADERS
X-Amz-Target
BODY json
{
"AcceleratorArn": "",
"Name": "",
"IpAddressType": "",
"Enabled": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator");
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 \"AcceleratorArn\": \"\",\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"Enabled\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:AcceleratorArn ""
:Name ""
:IpAddressType ""
:Enabled ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"AcceleratorArn\": \"\",\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"Enabled\": \"\"\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=GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"AcceleratorArn\": \"\",\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"Enabled\": \"\"\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=GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AcceleratorArn\": \"\",\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"Enabled\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator"
payload := strings.NewReader("{\n \"AcceleratorArn\": \"\",\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"Enabled\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 80
{
"AcceleratorArn": "",
"Name": "",
"IpAddressType": "",
"Enabled": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"AcceleratorArn\": \"\",\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"Enabled\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AcceleratorArn\": \"\",\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"Enabled\": \"\"\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 \"AcceleratorArn\": \"\",\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"Enabled\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator")
.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=GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"AcceleratorArn\": \"\",\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"Enabled\": \"\"\n}")
.asString();
const data = JSON.stringify({
AcceleratorArn: '',
Name: '',
IpAddressType: '',
Enabled: ''
});
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=GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator');
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=GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AcceleratorArn: '', Name: '', IpAddressType: '', Enabled: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AcceleratorArn":"","Name":"","IpAddressType":"","Enabled":""}'
};
try {
const response = await 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=GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "AcceleratorArn": "",\n "Name": "",\n "IpAddressType": "",\n "Enabled": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AcceleratorArn\": \"\",\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"Enabled\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator")
.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({AcceleratorArn: '', Name: '', IpAddressType: '', Enabled: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {AcceleratorArn: '', Name: '', IpAddressType: '', Enabled: ''},
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=GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
AcceleratorArn: '',
Name: '',
IpAddressType: '',
Enabled: ''
});
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=GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {AcceleratorArn: '', Name: '', IpAddressType: '', Enabled: ''}
};
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=GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AcceleratorArn":"","Name":"","IpAddressType":"","Enabled":""}'
};
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 = @{ @"AcceleratorArn": @"",
@"Name": @"",
@"IpAddressType": @"",
@"Enabled": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator"]
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=GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"AcceleratorArn\": \"\",\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"Enabled\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator",
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([
'AcceleratorArn' => '',
'Name' => '',
'IpAddressType' => '',
'Enabled' => ''
]),
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=GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator', [
'body' => '{
"AcceleratorArn": "",
"Name": "",
"IpAddressType": "",
"Enabled": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AcceleratorArn' => '',
'Name' => '',
'IpAddressType' => '',
'Enabled' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AcceleratorArn' => '',
'Name' => '',
'IpAddressType' => '',
'Enabled' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator');
$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=GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AcceleratorArn": "",
"Name": "",
"IpAddressType": "",
"Enabled": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AcceleratorArn": "",
"Name": "",
"IpAddressType": "",
"Enabled": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AcceleratorArn\": \"\",\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"Enabled\": \"\"\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=GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator"
payload = {
"AcceleratorArn": "",
"Name": "",
"IpAddressType": "",
"Enabled": ""
}
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=GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator"
payload <- "{\n \"AcceleratorArn\": \"\",\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"Enabled\": \"\"\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=GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator")
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 \"AcceleratorArn\": \"\",\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"Enabled\": \"\"\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 \"AcceleratorArn\": \"\",\n \"Name\": \"\",\n \"IpAddressType\": \"\",\n \"Enabled\": \"\"\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=GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator";
let payload = json!({
"AcceleratorArn": "",
"Name": "",
"IpAddressType": "",
"Enabled": ""
});
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=GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"AcceleratorArn": "",
"Name": "",
"IpAddressType": "",
"Enabled": ""
}'
echo '{
"AcceleratorArn": "",
"Name": "",
"IpAddressType": "",
"Enabled": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "AcceleratorArn": "",\n "Name": "",\n "IpAddressType": "",\n "Enabled": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"AcceleratorArn": "",
"Name": "",
"IpAddressType": "",
"Enabled": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator")! 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
UpdateCustomRoutingAcceleratorAttributes
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingAcceleratorAttributes
HEADERS
X-Amz-Target
BODY json
{
"AcceleratorArn": "",
"FlowLogsEnabled": "",
"FlowLogsS3Bucket": "",
"FlowLogsS3Prefix": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingAcceleratorAttributes");
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 \"AcceleratorArn\": \"\",\n \"FlowLogsEnabled\": \"\",\n \"FlowLogsS3Bucket\": \"\",\n \"FlowLogsS3Prefix\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingAcceleratorAttributes" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:AcceleratorArn ""
:FlowLogsEnabled ""
:FlowLogsS3Bucket ""
:FlowLogsS3Prefix ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingAcceleratorAttributes"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"AcceleratorArn\": \"\",\n \"FlowLogsEnabled\": \"\",\n \"FlowLogsS3Bucket\": \"\",\n \"FlowLogsS3Prefix\": \"\"\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=GlobalAccelerator_V20180706.UpdateCustomRoutingAcceleratorAttributes"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"AcceleratorArn\": \"\",\n \"FlowLogsEnabled\": \"\",\n \"FlowLogsS3Bucket\": \"\",\n \"FlowLogsS3Prefix\": \"\"\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=GlobalAccelerator_V20180706.UpdateCustomRoutingAcceleratorAttributes");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AcceleratorArn\": \"\",\n \"FlowLogsEnabled\": \"\",\n \"FlowLogsS3Bucket\": \"\",\n \"FlowLogsS3Prefix\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingAcceleratorAttributes"
payload := strings.NewReader("{\n \"AcceleratorArn\": \"\",\n \"FlowLogsEnabled\": \"\",\n \"FlowLogsS3Bucket\": \"\",\n \"FlowLogsS3Prefix\": \"\"\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: 103
{
"AcceleratorArn": "",
"FlowLogsEnabled": "",
"FlowLogsS3Bucket": "",
"FlowLogsS3Prefix": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingAcceleratorAttributes")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"AcceleratorArn\": \"\",\n \"FlowLogsEnabled\": \"\",\n \"FlowLogsS3Bucket\": \"\",\n \"FlowLogsS3Prefix\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingAcceleratorAttributes"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AcceleratorArn\": \"\",\n \"FlowLogsEnabled\": \"\",\n \"FlowLogsS3Bucket\": \"\",\n \"FlowLogsS3Prefix\": \"\"\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 \"AcceleratorArn\": \"\",\n \"FlowLogsEnabled\": \"\",\n \"FlowLogsS3Bucket\": \"\",\n \"FlowLogsS3Prefix\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingAcceleratorAttributes")
.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=GlobalAccelerator_V20180706.UpdateCustomRoutingAcceleratorAttributes")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"AcceleratorArn\": \"\",\n \"FlowLogsEnabled\": \"\",\n \"FlowLogsS3Bucket\": \"\",\n \"FlowLogsS3Prefix\": \"\"\n}")
.asString();
const data = JSON.stringify({
AcceleratorArn: '',
FlowLogsEnabled: '',
FlowLogsS3Bucket: '',
FlowLogsS3Prefix: ''
});
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=GlobalAccelerator_V20180706.UpdateCustomRoutingAcceleratorAttributes');
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=GlobalAccelerator_V20180706.UpdateCustomRoutingAcceleratorAttributes',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
AcceleratorArn: '',
FlowLogsEnabled: '',
FlowLogsS3Bucket: '',
FlowLogsS3Prefix: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingAcceleratorAttributes';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AcceleratorArn":"","FlowLogsEnabled":"","FlowLogsS3Bucket":"","FlowLogsS3Prefix":""}'
};
try {
const response = await 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=GlobalAccelerator_V20180706.UpdateCustomRoutingAcceleratorAttributes',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "AcceleratorArn": "",\n "FlowLogsEnabled": "",\n "FlowLogsS3Bucket": "",\n "FlowLogsS3Prefix": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AcceleratorArn\": \"\",\n \"FlowLogsEnabled\": \"\",\n \"FlowLogsS3Bucket\": \"\",\n \"FlowLogsS3Prefix\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingAcceleratorAttributes")
.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({
AcceleratorArn: '',
FlowLogsEnabled: '',
FlowLogsS3Bucket: '',
FlowLogsS3Prefix: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingAcceleratorAttributes',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
AcceleratorArn: '',
FlowLogsEnabled: '',
FlowLogsS3Bucket: '',
FlowLogsS3Prefix: ''
},
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=GlobalAccelerator_V20180706.UpdateCustomRoutingAcceleratorAttributes');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
AcceleratorArn: '',
FlowLogsEnabled: '',
FlowLogsS3Bucket: '',
FlowLogsS3Prefix: ''
});
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=GlobalAccelerator_V20180706.UpdateCustomRoutingAcceleratorAttributes',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
AcceleratorArn: '',
FlowLogsEnabled: '',
FlowLogsS3Bucket: '',
FlowLogsS3Prefix: ''
}
};
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=GlobalAccelerator_V20180706.UpdateCustomRoutingAcceleratorAttributes';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"AcceleratorArn":"","FlowLogsEnabled":"","FlowLogsS3Bucket":"","FlowLogsS3Prefix":""}'
};
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 = @{ @"AcceleratorArn": @"",
@"FlowLogsEnabled": @"",
@"FlowLogsS3Bucket": @"",
@"FlowLogsS3Prefix": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingAcceleratorAttributes"]
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=GlobalAccelerator_V20180706.UpdateCustomRoutingAcceleratorAttributes" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"AcceleratorArn\": \"\",\n \"FlowLogsEnabled\": \"\",\n \"FlowLogsS3Bucket\": \"\",\n \"FlowLogsS3Prefix\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingAcceleratorAttributes",
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([
'AcceleratorArn' => '',
'FlowLogsEnabled' => '',
'FlowLogsS3Bucket' => '',
'FlowLogsS3Prefix' => ''
]),
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=GlobalAccelerator_V20180706.UpdateCustomRoutingAcceleratorAttributes', [
'body' => '{
"AcceleratorArn": "",
"FlowLogsEnabled": "",
"FlowLogsS3Bucket": "",
"FlowLogsS3Prefix": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingAcceleratorAttributes');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AcceleratorArn' => '',
'FlowLogsEnabled' => '',
'FlowLogsS3Bucket' => '',
'FlowLogsS3Prefix' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AcceleratorArn' => '',
'FlowLogsEnabled' => '',
'FlowLogsS3Bucket' => '',
'FlowLogsS3Prefix' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingAcceleratorAttributes');
$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=GlobalAccelerator_V20180706.UpdateCustomRoutingAcceleratorAttributes' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AcceleratorArn": "",
"FlowLogsEnabled": "",
"FlowLogsS3Bucket": "",
"FlowLogsS3Prefix": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingAcceleratorAttributes' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AcceleratorArn": "",
"FlowLogsEnabled": "",
"FlowLogsS3Bucket": "",
"FlowLogsS3Prefix": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AcceleratorArn\": \"\",\n \"FlowLogsEnabled\": \"\",\n \"FlowLogsS3Bucket\": \"\",\n \"FlowLogsS3Prefix\": \"\"\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=GlobalAccelerator_V20180706.UpdateCustomRoutingAcceleratorAttributes"
payload = {
"AcceleratorArn": "",
"FlowLogsEnabled": "",
"FlowLogsS3Bucket": "",
"FlowLogsS3Prefix": ""
}
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=GlobalAccelerator_V20180706.UpdateCustomRoutingAcceleratorAttributes"
payload <- "{\n \"AcceleratorArn\": \"\",\n \"FlowLogsEnabled\": \"\",\n \"FlowLogsS3Bucket\": \"\",\n \"FlowLogsS3Prefix\": \"\"\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=GlobalAccelerator_V20180706.UpdateCustomRoutingAcceleratorAttributes")
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 \"AcceleratorArn\": \"\",\n \"FlowLogsEnabled\": \"\",\n \"FlowLogsS3Bucket\": \"\",\n \"FlowLogsS3Prefix\": \"\"\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 \"AcceleratorArn\": \"\",\n \"FlowLogsEnabled\": \"\",\n \"FlowLogsS3Bucket\": \"\",\n \"FlowLogsS3Prefix\": \"\"\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=GlobalAccelerator_V20180706.UpdateCustomRoutingAcceleratorAttributes";
let payload = json!({
"AcceleratorArn": "",
"FlowLogsEnabled": "",
"FlowLogsS3Bucket": "",
"FlowLogsS3Prefix": ""
});
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=GlobalAccelerator_V20180706.UpdateCustomRoutingAcceleratorAttributes' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"AcceleratorArn": "",
"FlowLogsEnabled": "",
"FlowLogsS3Bucket": "",
"FlowLogsS3Prefix": ""
}'
echo '{
"AcceleratorArn": "",
"FlowLogsEnabled": "",
"FlowLogsS3Bucket": "",
"FlowLogsS3Prefix": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingAcceleratorAttributes' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "AcceleratorArn": "",\n "FlowLogsEnabled": "",\n "FlowLogsS3Bucket": "",\n "FlowLogsS3Prefix": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingAcceleratorAttributes'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"AcceleratorArn": "",
"FlowLogsEnabled": "",
"FlowLogsS3Bucket": "",
"FlowLogsS3Prefix": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingAcceleratorAttributes")! 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
UpdateCustomRoutingListener
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingListener
HEADERS
X-Amz-Target
BODY json
{
"ListenerArn": "",
"PortRanges": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingListener");
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 \"ListenerArn\": \"\",\n \"PortRanges\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingListener" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ListenerArn ""
:PortRanges ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingListener"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ListenerArn\": \"\",\n \"PortRanges\": \"\"\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=GlobalAccelerator_V20180706.UpdateCustomRoutingListener"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ListenerArn\": \"\",\n \"PortRanges\": \"\"\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=GlobalAccelerator_V20180706.UpdateCustomRoutingListener");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ListenerArn\": \"\",\n \"PortRanges\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingListener"
payload := strings.NewReader("{\n \"ListenerArn\": \"\",\n \"PortRanges\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 43
{
"ListenerArn": "",
"PortRanges": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingListener")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ListenerArn\": \"\",\n \"PortRanges\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingListener"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ListenerArn\": \"\",\n \"PortRanges\": \"\"\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 \"ListenerArn\": \"\",\n \"PortRanges\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingListener")
.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=GlobalAccelerator_V20180706.UpdateCustomRoutingListener")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ListenerArn\": \"\",\n \"PortRanges\": \"\"\n}")
.asString();
const data = JSON.stringify({
ListenerArn: '',
PortRanges: ''
});
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=GlobalAccelerator_V20180706.UpdateCustomRoutingListener');
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=GlobalAccelerator_V20180706.UpdateCustomRoutingListener',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ListenerArn: '', PortRanges: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingListener';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ListenerArn":"","PortRanges":""}'
};
try {
const response = await 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=GlobalAccelerator_V20180706.UpdateCustomRoutingListener',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ListenerArn": "",\n "PortRanges": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ListenerArn\": \"\",\n \"PortRanges\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingListener")
.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({ListenerArn: '', PortRanges: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingListener',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {ListenerArn: '', PortRanges: ''},
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=GlobalAccelerator_V20180706.UpdateCustomRoutingListener');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ListenerArn: '',
PortRanges: ''
});
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=GlobalAccelerator_V20180706.UpdateCustomRoutingListener',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ListenerArn: '', PortRanges: ''}
};
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=GlobalAccelerator_V20180706.UpdateCustomRoutingListener';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ListenerArn":"","PortRanges":""}'
};
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 = @{ @"ListenerArn": @"",
@"PortRanges": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingListener"]
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=GlobalAccelerator_V20180706.UpdateCustomRoutingListener" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"ListenerArn\": \"\",\n \"PortRanges\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingListener",
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([
'ListenerArn' => '',
'PortRanges' => ''
]),
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=GlobalAccelerator_V20180706.UpdateCustomRoutingListener', [
'body' => '{
"ListenerArn": "",
"PortRanges": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingListener');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ListenerArn' => '',
'PortRanges' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ListenerArn' => '',
'PortRanges' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingListener');
$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=GlobalAccelerator_V20180706.UpdateCustomRoutingListener' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ListenerArn": "",
"PortRanges": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingListener' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ListenerArn": "",
"PortRanges": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ListenerArn\": \"\",\n \"PortRanges\": \"\"\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=GlobalAccelerator_V20180706.UpdateCustomRoutingListener"
payload = {
"ListenerArn": "",
"PortRanges": ""
}
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=GlobalAccelerator_V20180706.UpdateCustomRoutingListener"
payload <- "{\n \"ListenerArn\": \"\",\n \"PortRanges\": \"\"\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=GlobalAccelerator_V20180706.UpdateCustomRoutingListener")
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 \"ListenerArn\": \"\",\n \"PortRanges\": \"\"\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 \"ListenerArn\": \"\",\n \"PortRanges\": \"\"\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=GlobalAccelerator_V20180706.UpdateCustomRoutingListener";
let payload = json!({
"ListenerArn": "",
"PortRanges": ""
});
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=GlobalAccelerator_V20180706.UpdateCustomRoutingListener' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ListenerArn": "",
"PortRanges": ""
}'
echo '{
"ListenerArn": "",
"PortRanges": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingListener' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ListenerArn": "",\n "PortRanges": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingListener'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"ListenerArn": "",
"PortRanges": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateCustomRoutingListener")! 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
UpdateEndpointGroup
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateEndpointGroup
HEADERS
X-Amz-Target
BODY json
{
"EndpointGroupArn": "",
"EndpointConfigurations": "",
"TrafficDialPercentage": "",
"HealthCheckPort": "",
"HealthCheckProtocol": "",
"HealthCheckPath": "",
"HealthCheckIntervalSeconds": "",
"ThresholdCount": "",
"PortOverrides": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateEndpointGroup");
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 \"EndpointGroupArn\": \"\",\n \"EndpointConfigurations\": \"\",\n \"TrafficDialPercentage\": \"\",\n \"HealthCheckPort\": \"\",\n \"HealthCheckProtocol\": \"\",\n \"HealthCheckPath\": \"\",\n \"HealthCheckIntervalSeconds\": \"\",\n \"ThresholdCount\": \"\",\n \"PortOverrides\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateEndpointGroup" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:EndpointGroupArn ""
:EndpointConfigurations ""
:TrafficDialPercentage ""
:HealthCheckPort ""
:HealthCheckProtocol ""
:HealthCheckPath ""
:HealthCheckIntervalSeconds ""
:ThresholdCount ""
:PortOverrides ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateEndpointGroup"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"EndpointGroupArn\": \"\",\n \"EndpointConfigurations\": \"\",\n \"TrafficDialPercentage\": \"\",\n \"HealthCheckPort\": \"\",\n \"HealthCheckProtocol\": \"\",\n \"HealthCheckPath\": \"\",\n \"HealthCheckIntervalSeconds\": \"\",\n \"ThresholdCount\": \"\",\n \"PortOverrides\": \"\"\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=GlobalAccelerator_V20180706.UpdateEndpointGroup"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"EndpointGroupArn\": \"\",\n \"EndpointConfigurations\": \"\",\n \"TrafficDialPercentage\": \"\",\n \"HealthCheckPort\": \"\",\n \"HealthCheckProtocol\": \"\",\n \"HealthCheckPath\": \"\",\n \"HealthCheckIntervalSeconds\": \"\",\n \"ThresholdCount\": \"\",\n \"PortOverrides\": \"\"\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=GlobalAccelerator_V20180706.UpdateEndpointGroup");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"EndpointGroupArn\": \"\",\n \"EndpointConfigurations\": \"\",\n \"TrafficDialPercentage\": \"\",\n \"HealthCheckPort\": \"\",\n \"HealthCheckProtocol\": \"\",\n \"HealthCheckPath\": \"\",\n \"HealthCheckIntervalSeconds\": \"\",\n \"ThresholdCount\": \"\",\n \"PortOverrides\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateEndpointGroup"
payload := strings.NewReader("{\n \"EndpointGroupArn\": \"\",\n \"EndpointConfigurations\": \"\",\n \"TrafficDialPercentage\": \"\",\n \"HealthCheckPort\": \"\",\n \"HealthCheckProtocol\": \"\",\n \"HealthCheckPath\": \"\",\n \"HealthCheckIntervalSeconds\": \"\",\n \"ThresholdCount\": \"\",\n \"PortOverrides\": \"\"\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: 253
{
"EndpointGroupArn": "",
"EndpointConfigurations": "",
"TrafficDialPercentage": "",
"HealthCheckPort": "",
"HealthCheckProtocol": "",
"HealthCheckPath": "",
"HealthCheckIntervalSeconds": "",
"ThresholdCount": "",
"PortOverrides": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateEndpointGroup")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"EndpointGroupArn\": \"\",\n \"EndpointConfigurations\": \"\",\n \"TrafficDialPercentage\": \"\",\n \"HealthCheckPort\": \"\",\n \"HealthCheckProtocol\": \"\",\n \"HealthCheckPath\": \"\",\n \"HealthCheckIntervalSeconds\": \"\",\n \"ThresholdCount\": \"\",\n \"PortOverrides\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateEndpointGroup"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"EndpointGroupArn\": \"\",\n \"EndpointConfigurations\": \"\",\n \"TrafficDialPercentage\": \"\",\n \"HealthCheckPort\": \"\",\n \"HealthCheckProtocol\": \"\",\n \"HealthCheckPath\": \"\",\n \"HealthCheckIntervalSeconds\": \"\",\n \"ThresholdCount\": \"\",\n \"PortOverrides\": \"\"\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 \"EndpointGroupArn\": \"\",\n \"EndpointConfigurations\": \"\",\n \"TrafficDialPercentage\": \"\",\n \"HealthCheckPort\": \"\",\n \"HealthCheckProtocol\": \"\",\n \"HealthCheckPath\": \"\",\n \"HealthCheckIntervalSeconds\": \"\",\n \"ThresholdCount\": \"\",\n \"PortOverrides\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateEndpointGroup")
.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=GlobalAccelerator_V20180706.UpdateEndpointGroup")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"EndpointGroupArn\": \"\",\n \"EndpointConfigurations\": \"\",\n \"TrafficDialPercentage\": \"\",\n \"HealthCheckPort\": \"\",\n \"HealthCheckProtocol\": \"\",\n \"HealthCheckPath\": \"\",\n \"HealthCheckIntervalSeconds\": \"\",\n \"ThresholdCount\": \"\",\n \"PortOverrides\": \"\"\n}")
.asString();
const data = JSON.stringify({
EndpointGroupArn: '',
EndpointConfigurations: '',
TrafficDialPercentage: '',
HealthCheckPort: '',
HealthCheckProtocol: '',
HealthCheckPath: '',
HealthCheckIntervalSeconds: '',
ThresholdCount: '',
PortOverrides: ''
});
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=GlobalAccelerator_V20180706.UpdateEndpointGroup');
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=GlobalAccelerator_V20180706.UpdateEndpointGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
EndpointGroupArn: '',
EndpointConfigurations: '',
TrafficDialPercentage: '',
HealthCheckPort: '',
HealthCheckProtocol: '',
HealthCheckPath: '',
HealthCheckIntervalSeconds: '',
ThresholdCount: '',
PortOverrides: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateEndpointGroup';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"EndpointGroupArn":"","EndpointConfigurations":"","TrafficDialPercentage":"","HealthCheckPort":"","HealthCheckProtocol":"","HealthCheckPath":"","HealthCheckIntervalSeconds":"","ThresholdCount":"","PortOverrides":""}'
};
try {
const response = await 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=GlobalAccelerator_V20180706.UpdateEndpointGroup',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "EndpointGroupArn": "",\n "EndpointConfigurations": "",\n "TrafficDialPercentage": "",\n "HealthCheckPort": "",\n "HealthCheckProtocol": "",\n "HealthCheckPath": "",\n "HealthCheckIntervalSeconds": "",\n "ThresholdCount": "",\n "PortOverrides": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"EndpointGroupArn\": \"\",\n \"EndpointConfigurations\": \"\",\n \"TrafficDialPercentage\": \"\",\n \"HealthCheckPort\": \"\",\n \"HealthCheckProtocol\": \"\",\n \"HealthCheckPath\": \"\",\n \"HealthCheckIntervalSeconds\": \"\",\n \"ThresholdCount\": \"\",\n \"PortOverrides\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateEndpointGroup")
.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({
EndpointGroupArn: '',
EndpointConfigurations: '',
TrafficDialPercentage: '',
HealthCheckPort: '',
HealthCheckProtocol: '',
HealthCheckPath: '',
HealthCheckIntervalSeconds: '',
ThresholdCount: '',
PortOverrides: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateEndpointGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
EndpointGroupArn: '',
EndpointConfigurations: '',
TrafficDialPercentage: '',
HealthCheckPort: '',
HealthCheckProtocol: '',
HealthCheckPath: '',
HealthCheckIntervalSeconds: '',
ThresholdCount: '',
PortOverrides: ''
},
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=GlobalAccelerator_V20180706.UpdateEndpointGroup');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
EndpointGroupArn: '',
EndpointConfigurations: '',
TrafficDialPercentage: '',
HealthCheckPort: '',
HealthCheckProtocol: '',
HealthCheckPath: '',
HealthCheckIntervalSeconds: '',
ThresholdCount: '',
PortOverrides: ''
});
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=GlobalAccelerator_V20180706.UpdateEndpointGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
EndpointGroupArn: '',
EndpointConfigurations: '',
TrafficDialPercentage: '',
HealthCheckPort: '',
HealthCheckProtocol: '',
HealthCheckPath: '',
HealthCheckIntervalSeconds: '',
ThresholdCount: '',
PortOverrides: ''
}
};
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=GlobalAccelerator_V20180706.UpdateEndpointGroup';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"EndpointGroupArn":"","EndpointConfigurations":"","TrafficDialPercentage":"","HealthCheckPort":"","HealthCheckProtocol":"","HealthCheckPath":"","HealthCheckIntervalSeconds":"","ThresholdCount":"","PortOverrides":""}'
};
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 = @{ @"EndpointGroupArn": @"",
@"EndpointConfigurations": @"",
@"TrafficDialPercentage": @"",
@"HealthCheckPort": @"",
@"HealthCheckProtocol": @"",
@"HealthCheckPath": @"",
@"HealthCheckIntervalSeconds": @"",
@"ThresholdCount": @"",
@"PortOverrides": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateEndpointGroup"]
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=GlobalAccelerator_V20180706.UpdateEndpointGroup" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"EndpointGroupArn\": \"\",\n \"EndpointConfigurations\": \"\",\n \"TrafficDialPercentage\": \"\",\n \"HealthCheckPort\": \"\",\n \"HealthCheckProtocol\": \"\",\n \"HealthCheckPath\": \"\",\n \"HealthCheckIntervalSeconds\": \"\",\n \"ThresholdCount\": \"\",\n \"PortOverrides\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateEndpointGroup",
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([
'EndpointGroupArn' => '',
'EndpointConfigurations' => '',
'TrafficDialPercentage' => '',
'HealthCheckPort' => '',
'HealthCheckProtocol' => '',
'HealthCheckPath' => '',
'HealthCheckIntervalSeconds' => '',
'ThresholdCount' => '',
'PortOverrides' => ''
]),
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=GlobalAccelerator_V20180706.UpdateEndpointGroup', [
'body' => '{
"EndpointGroupArn": "",
"EndpointConfigurations": "",
"TrafficDialPercentage": "",
"HealthCheckPort": "",
"HealthCheckProtocol": "",
"HealthCheckPath": "",
"HealthCheckIntervalSeconds": "",
"ThresholdCount": "",
"PortOverrides": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateEndpointGroup');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'EndpointGroupArn' => '',
'EndpointConfigurations' => '',
'TrafficDialPercentage' => '',
'HealthCheckPort' => '',
'HealthCheckProtocol' => '',
'HealthCheckPath' => '',
'HealthCheckIntervalSeconds' => '',
'ThresholdCount' => '',
'PortOverrides' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'EndpointGroupArn' => '',
'EndpointConfigurations' => '',
'TrafficDialPercentage' => '',
'HealthCheckPort' => '',
'HealthCheckProtocol' => '',
'HealthCheckPath' => '',
'HealthCheckIntervalSeconds' => '',
'ThresholdCount' => '',
'PortOverrides' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateEndpointGroup');
$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=GlobalAccelerator_V20180706.UpdateEndpointGroup' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EndpointGroupArn": "",
"EndpointConfigurations": "",
"TrafficDialPercentage": "",
"HealthCheckPort": "",
"HealthCheckProtocol": "",
"HealthCheckPath": "",
"HealthCheckIntervalSeconds": "",
"ThresholdCount": "",
"PortOverrides": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateEndpointGroup' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EndpointGroupArn": "",
"EndpointConfigurations": "",
"TrafficDialPercentage": "",
"HealthCheckPort": "",
"HealthCheckProtocol": "",
"HealthCheckPath": "",
"HealthCheckIntervalSeconds": "",
"ThresholdCount": "",
"PortOverrides": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"EndpointGroupArn\": \"\",\n \"EndpointConfigurations\": \"\",\n \"TrafficDialPercentage\": \"\",\n \"HealthCheckPort\": \"\",\n \"HealthCheckProtocol\": \"\",\n \"HealthCheckPath\": \"\",\n \"HealthCheckIntervalSeconds\": \"\",\n \"ThresholdCount\": \"\",\n \"PortOverrides\": \"\"\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=GlobalAccelerator_V20180706.UpdateEndpointGroup"
payload = {
"EndpointGroupArn": "",
"EndpointConfigurations": "",
"TrafficDialPercentage": "",
"HealthCheckPort": "",
"HealthCheckProtocol": "",
"HealthCheckPath": "",
"HealthCheckIntervalSeconds": "",
"ThresholdCount": "",
"PortOverrides": ""
}
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=GlobalAccelerator_V20180706.UpdateEndpointGroup"
payload <- "{\n \"EndpointGroupArn\": \"\",\n \"EndpointConfigurations\": \"\",\n \"TrafficDialPercentage\": \"\",\n \"HealthCheckPort\": \"\",\n \"HealthCheckProtocol\": \"\",\n \"HealthCheckPath\": \"\",\n \"HealthCheckIntervalSeconds\": \"\",\n \"ThresholdCount\": \"\",\n \"PortOverrides\": \"\"\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=GlobalAccelerator_V20180706.UpdateEndpointGroup")
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 \"EndpointGroupArn\": \"\",\n \"EndpointConfigurations\": \"\",\n \"TrafficDialPercentage\": \"\",\n \"HealthCheckPort\": \"\",\n \"HealthCheckProtocol\": \"\",\n \"HealthCheckPath\": \"\",\n \"HealthCheckIntervalSeconds\": \"\",\n \"ThresholdCount\": \"\",\n \"PortOverrides\": \"\"\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 \"EndpointGroupArn\": \"\",\n \"EndpointConfigurations\": \"\",\n \"TrafficDialPercentage\": \"\",\n \"HealthCheckPort\": \"\",\n \"HealthCheckProtocol\": \"\",\n \"HealthCheckPath\": \"\",\n \"HealthCheckIntervalSeconds\": \"\",\n \"ThresholdCount\": \"\",\n \"PortOverrides\": \"\"\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=GlobalAccelerator_V20180706.UpdateEndpointGroup";
let payload = json!({
"EndpointGroupArn": "",
"EndpointConfigurations": "",
"TrafficDialPercentage": "",
"HealthCheckPort": "",
"HealthCheckProtocol": "",
"HealthCheckPath": "",
"HealthCheckIntervalSeconds": "",
"ThresholdCount": "",
"PortOverrides": ""
});
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=GlobalAccelerator_V20180706.UpdateEndpointGroup' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"EndpointGroupArn": "",
"EndpointConfigurations": "",
"TrafficDialPercentage": "",
"HealthCheckPort": "",
"HealthCheckProtocol": "",
"HealthCheckPath": "",
"HealthCheckIntervalSeconds": "",
"ThresholdCount": "",
"PortOverrides": ""
}'
echo '{
"EndpointGroupArn": "",
"EndpointConfigurations": "",
"TrafficDialPercentage": "",
"HealthCheckPort": "",
"HealthCheckProtocol": "",
"HealthCheckPath": "",
"HealthCheckIntervalSeconds": "",
"ThresholdCount": "",
"PortOverrides": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateEndpointGroup' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "EndpointGroupArn": "",\n "EndpointConfigurations": "",\n "TrafficDialPercentage": "",\n "HealthCheckPort": "",\n "HealthCheckProtocol": "",\n "HealthCheckPath": "",\n "HealthCheckIntervalSeconds": "",\n "ThresholdCount": "",\n "PortOverrides": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateEndpointGroup'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"EndpointGroupArn": "",
"EndpointConfigurations": "",
"TrafficDialPercentage": "",
"HealthCheckPort": "",
"HealthCheckProtocol": "",
"HealthCheckPath": "",
"HealthCheckIntervalSeconds": "",
"ThresholdCount": "",
"PortOverrides": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateEndpointGroup")! 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
UpdateListener
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateListener
HEADERS
X-Amz-Target
BODY json
{
"ListenerArn": "",
"PortRanges": "",
"Protocol": "",
"ClientAffinity": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateListener");
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 \"ListenerArn\": \"\",\n \"PortRanges\": \"\",\n \"Protocol\": \"\",\n \"ClientAffinity\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateListener" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ListenerArn ""
:PortRanges ""
:Protocol ""
:ClientAffinity ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateListener"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ListenerArn\": \"\",\n \"PortRanges\": \"\",\n \"Protocol\": \"\",\n \"ClientAffinity\": \"\"\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=GlobalAccelerator_V20180706.UpdateListener"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ListenerArn\": \"\",\n \"PortRanges\": \"\",\n \"Protocol\": \"\",\n \"ClientAffinity\": \"\"\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=GlobalAccelerator_V20180706.UpdateListener");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ListenerArn\": \"\",\n \"PortRanges\": \"\",\n \"Protocol\": \"\",\n \"ClientAffinity\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateListener"
payload := strings.NewReader("{\n \"ListenerArn\": \"\",\n \"PortRanges\": \"\",\n \"Protocol\": \"\",\n \"ClientAffinity\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 85
{
"ListenerArn": "",
"PortRanges": "",
"Protocol": "",
"ClientAffinity": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateListener")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ListenerArn\": \"\",\n \"PortRanges\": \"\",\n \"Protocol\": \"\",\n \"ClientAffinity\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateListener"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ListenerArn\": \"\",\n \"PortRanges\": \"\",\n \"Protocol\": \"\",\n \"ClientAffinity\": \"\"\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 \"ListenerArn\": \"\",\n \"PortRanges\": \"\",\n \"Protocol\": \"\",\n \"ClientAffinity\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateListener")
.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=GlobalAccelerator_V20180706.UpdateListener")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ListenerArn\": \"\",\n \"PortRanges\": \"\",\n \"Protocol\": \"\",\n \"ClientAffinity\": \"\"\n}")
.asString();
const data = JSON.stringify({
ListenerArn: '',
PortRanges: '',
Protocol: '',
ClientAffinity: ''
});
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=GlobalAccelerator_V20180706.UpdateListener');
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=GlobalAccelerator_V20180706.UpdateListener',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ListenerArn: '', PortRanges: '', Protocol: '', ClientAffinity: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateListener';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ListenerArn":"","PortRanges":"","Protocol":"","ClientAffinity":""}'
};
try {
const response = await 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=GlobalAccelerator_V20180706.UpdateListener',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ListenerArn": "",\n "PortRanges": "",\n "Protocol": "",\n "ClientAffinity": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ListenerArn\": \"\",\n \"PortRanges\": \"\",\n \"Protocol\": \"\",\n \"ClientAffinity\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateListener")
.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({ListenerArn: '', PortRanges: '', Protocol: '', ClientAffinity: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateListener',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {ListenerArn: '', PortRanges: '', Protocol: '', ClientAffinity: ''},
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=GlobalAccelerator_V20180706.UpdateListener');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ListenerArn: '',
PortRanges: '',
Protocol: '',
ClientAffinity: ''
});
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=GlobalAccelerator_V20180706.UpdateListener',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ListenerArn: '', PortRanges: '', Protocol: '', ClientAffinity: ''}
};
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=GlobalAccelerator_V20180706.UpdateListener';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ListenerArn":"","PortRanges":"","Protocol":"","ClientAffinity":""}'
};
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 = @{ @"ListenerArn": @"",
@"PortRanges": @"",
@"Protocol": @"",
@"ClientAffinity": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateListener"]
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=GlobalAccelerator_V20180706.UpdateListener" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"ListenerArn\": \"\",\n \"PortRanges\": \"\",\n \"Protocol\": \"\",\n \"ClientAffinity\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateListener",
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([
'ListenerArn' => '',
'PortRanges' => '',
'Protocol' => '',
'ClientAffinity' => ''
]),
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=GlobalAccelerator_V20180706.UpdateListener', [
'body' => '{
"ListenerArn": "",
"PortRanges": "",
"Protocol": "",
"ClientAffinity": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateListener');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ListenerArn' => '',
'PortRanges' => '',
'Protocol' => '',
'ClientAffinity' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ListenerArn' => '',
'PortRanges' => '',
'Protocol' => '',
'ClientAffinity' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateListener');
$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=GlobalAccelerator_V20180706.UpdateListener' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ListenerArn": "",
"PortRanges": "",
"Protocol": "",
"ClientAffinity": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateListener' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ListenerArn": "",
"PortRanges": "",
"Protocol": "",
"ClientAffinity": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ListenerArn\": \"\",\n \"PortRanges\": \"\",\n \"Protocol\": \"\",\n \"ClientAffinity\": \"\"\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=GlobalAccelerator_V20180706.UpdateListener"
payload = {
"ListenerArn": "",
"PortRanges": "",
"Protocol": "",
"ClientAffinity": ""
}
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=GlobalAccelerator_V20180706.UpdateListener"
payload <- "{\n \"ListenerArn\": \"\",\n \"PortRanges\": \"\",\n \"Protocol\": \"\",\n \"ClientAffinity\": \"\"\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=GlobalAccelerator_V20180706.UpdateListener")
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 \"ListenerArn\": \"\",\n \"PortRanges\": \"\",\n \"Protocol\": \"\",\n \"ClientAffinity\": \"\"\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 \"ListenerArn\": \"\",\n \"PortRanges\": \"\",\n \"Protocol\": \"\",\n \"ClientAffinity\": \"\"\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=GlobalAccelerator_V20180706.UpdateListener";
let payload = json!({
"ListenerArn": "",
"PortRanges": "",
"Protocol": "",
"ClientAffinity": ""
});
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=GlobalAccelerator_V20180706.UpdateListener' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ListenerArn": "",
"PortRanges": "",
"Protocol": "",
"ClientAffinity": ""
}'
echo '{
"ListenerArn": "",
"PortRanges": "",
"Protocol": "",
"ClientAffinity": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateListener' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ListenerArn": "",\n "PortRanges": "",\n "Protocol": "",\n "ClientAffinity": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateListener'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"ListenerArn": "",
"PortRanges": "",
"Protocol": "",
"ClientAffinity": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.UpdateListener")! 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
WithdrawByoipCidr
{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.WithdrawByoipCidr
HEADERS
X-Amz-Target
BODY json
{
"Cidr": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.WithdrawByoipCidr");
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 \"Cidr\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.WithdrawByoipCidr" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Cidr ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.WithdrawByoipCidr"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Cidr\": \"\"\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=GlobalAccelerator_V20180706.WithdrawByoipCidr"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Cidr\": \"\"\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=GlobalAccelerator_V20180706.WithdrawByoipCidr");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Cidr\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.WithdrawByoipCidr"
payload := strings.NewReader("{\n \"Cidr\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 16
{
"Cidr": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.WithdrawByoipCidr")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Cidr\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.WithdrawByoipCidr"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Cidr\": \"\"\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 \"Cidr\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.WithdrawByoipCidr")
.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=GlobalAccelerator_V20180706.WithdrawByoipCidr")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Cidr\": \"\"\n}")
.asString();
const data = JSON.stringify({
Cidr: ''
});
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=GlobalAccelerator_V20180706.WithdrawByoipCidr');
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=GlobalAccelerator_V20180706.WithdrawByoipCidr',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Cidr: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.WithdrawByoipCidr';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Cidr":""}'
};
try {
const response = await 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=GlobalAccelerator_V20180706.WithdrawByoipCidr',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Cidr": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Cidr\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.WithdrawByoipCidr")
.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({Cidr: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.WithdrawByoipCidr',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Cidr: ''},
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=GlobalAccelerator_V20180706.WithdrawByoipCidr');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Cidr: ''
});
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=GlobalAccelerator_V20180706.WithdrawByoipCidr',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Cidr: ''}
};
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=GlobalAccelerator_V20180706.WithdrawByoipCidr';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Cidr":""}'
};
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 = @{ @"Cidr": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.WithdrawByoipCidr"]
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=GlobalAccelerator_V20180706.WithdrawByoipCidr" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Cidr\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.WithdrawByoipCidr",
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([
'Cidr' => ''
]),
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=GlobalAccelerator_V20180706.WithdrawByoipCidr', [
'body' => '{
"Cidr": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.WithdrawByoipCidr');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Cidr' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Cidr' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.WithdrawByoipCidr');
$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=GlobalAccelerator_V20180706.WithdrawByoipCidr' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Cidr": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.WithdrawByoipCidr' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Cidr": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Cidr\": \"\"\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=GlobalAccelerator_V20180706.WithdrawByoipCidr"
payload = { "Cidr": "" }
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=GlobalAccelerator_V20180706.WithdrawByoipCidr"
payload <- "{\n \"Cidr\": \"\"\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=GlobalAccelerator_V20180706.WithdrawByoipCidr")
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 \"Cidr\": \"\"\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 \"Cidr\": \"\"\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=GlobalAccelerator_V20180706.WithdrawByoipCidr";
let payload = json!({"Cidr": ""});
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=GlobalAccelerator_V20180706.WithdrawByoipCidr' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Cidr": ""
}'
echo '{
"Cidr": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.WithdrawByoipCidr' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Cidr": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.WithdrawByoipCidr'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["Cidr": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=GlobalAccelerator_V20180706.WithdrawByoipCidr")! 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()