Amazon WorkMail
POST
AssociateDelegateToResource
{{baseUrl}}/#X-Amz-Target=WorkMailService.AssociateDelegateToResource
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"ResourceId": "",
"EntityId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.AssociateDelegateToResource");
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 \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"EntityId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.AssociateDelegateToResource" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:ResourceId ""
:EntityId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.AssociateDelegateToResource"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"EntityId\": \"\"\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=WorkMailService.AssociateDelegateToResource"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"EntityId\": \"\"\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=WorkMailService.AssociateDelegateToResource");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"EntityId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.AssociateDelegateToResource"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"EntityId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 64
{
"OrganizationId": "",
"ResourceId": "",
"EntityId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.AssociateDelegateToResource")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"EntityId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.AssociateDelegateToResource"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"EntityId\": \"\"\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 \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"EntityId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.AssociateDelegateToResource")
.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=WorkMailService.AssociateDelegateToResource")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"EntityId\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
ResourceId: '',
EntityId: ''
});
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=WorkMailService.AssociateDelegateToResource');
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=WorkMailService.AssociateDelegateToResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', ResourceId: '', EntityId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.AssociateDelegateToResource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","ResourceId":"","EntityId":""}'
};
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=WorkMailService.AssociateDelegateToResource',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "ResourceId": "",\n "EntityId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"EntityId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.AssociateDelegateToResource")
.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({OrganizationId: '', ResourceId: '', EntityId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.AssociateDelegateToResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', ResourceId: '', EntityId: ''},
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=WorkMailService.AssociateDelegateToResource');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
ResourceId: '',
EntityId: ''
});
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=WorkMailService.AssociateDelegateToResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', ResourceId: '', EntityId: ''}
};
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=WorkMailService.AssociateDelegateToResource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","ResourceId":"","EntityId":""}'
};
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 = @{ @"OrganizationId": @"",
@"ResourceId": @"",
@"EntityId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.AssociateDelegateToResource"]
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=WorkMailService.AssociateDelegateToResource" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"EntityId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.AssociateDelegateToResource",
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([
'OrganizationId' => '',
'ResourceId' => '',
'EntityId' => ''
]),
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=WorkMailService.AssociateDelegateToResource', [
'body' => '{
"OrganizationId": "",
"ResourceId": "",
"EntityId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.AssociateDelegateToResource');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'ResourceId' => '',
'EntityId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'ResourceId' => '',
'EntityId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.AssociateDelegateToResource');
$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=WorkMailService.AssociateDelegateToResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"ResourceId": "",
"EntityId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.AssociateDelegateToResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"ResourceId": "",
"EntityId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"EntityId\": \"\"\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=WorkMailService.AssociateDelegateToResource"
payload = {
"OrganizationId": "",
"ResourceId": "",
"EntityId": ""
}
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=WorkMailService.AssociateDelegateToResource"
payload <- "{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"EntityId\": \"\"\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=WorkMailService.AssociateDelegateToResource")
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 \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"EntityId\": \"\"\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 \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"EntityId\": \"\"\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=WorkMailService.AssociateDelegateToResource";
let payload = json!({
"OrganizationId": "",
"ResourceId": "",
"EntityId": ""
});
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=WorkMailService.AssociateDelegateToResource' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"ResourceId": "",
"EntityId": ""
}'
echo '{
"OrganizationId": "",
"ResourceId": "",
"EntityId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.AssociateDelegateToResource' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "ResourceId": "",\n "EntityId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.AssociateDelegateToResource'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"ResourceId": "",
"EntityId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.AssociateDelegateToResource")! 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
AssociateMemberToGroup
{{baseUrl}}/#X-Amz-Target=WorkMailService.AssociateMemberToGroup
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"GroupId": "",
"MemberId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.AssociateMemberToGroup");
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 \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"MemberId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.AssociateMemberToGroup" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:GroupId ""
:MemberId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.AssociateMemberToGroup"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"MemberId\": \"\"\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=WorkMailService.AssociateMemberToGroup"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"MemberId\": \"\"\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=WorkMailService.AssociateMemberToGroup");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"MemberId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.AssociateMemberToGroup"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"MemberId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 61
{
"OrganizationId": "",
"GroupId": "",
"MemberId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.AssociateMemberToGroup")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"MemberId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.AssociateMemberToGroup"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"MemberId\": \"\"\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 \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"MemberId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.AssociateMemberToGroup")
.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=WorkMailService.AssociateMemberToGroup")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"MemberId\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
GroupId: '',
MemberId: ''
});
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=WorkMailService.AssociateMemberToGroup');
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=WorkMailService.AssociateMemberToGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', GroupId: '', MemberId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.AssociateMemberToGroup';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","GroupId":"","MemberId":""}'
};
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=WorkMailService.AssociateMemberToGroup',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "GroupId": "",\n "MemberId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"MemberId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.AssociateMemberToGroup")
.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({OrganizationId: '', GroupId: '', MemberId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.AssociateMemberToGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', GroupId: '', MemberId: ''},
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=WorkMailService.AssociateMemberToGroup');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
GroupId: '',
MemberId: ''
});
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=WorkMailService.AssociateMemberToGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', GroupId: '', MemberId: ''}
};
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=WorkMailService.AssociateMemberToGroup';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","GroupId":"","MemberId":""}'
};
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 = @{ @"OrganizationId": @"",
@"GroupId": @"",
@"MemberId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.AssociateMemberToGroup"]
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=WorkMailService.AssociateMemberToGroup" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"MemberId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.AssociateMemberToGroup",
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([
'OrganizationId' => '',
'GroupId' => '',
'MemberId' => ''
]),
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=WorkMailService.AssociateMemberToGroup', [
'body' => '{
"OrganizationId": "",
"GroupId": "",
"MemberId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.AssociateMemberToGroup');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'GroupId' => '',
'MemberId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'GroupId' => '',
'MemberId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.AssociateMemberToGroup');
$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=WorkMailService.AssociateMemberToGroup' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"GroupId": "",
"MemberId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.AssociateMemberToGroup' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"GroupId": "",
"MemberId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"MemberId\": \"\"\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=WorkMailService.AssociateMemberToGroup"
payload = {
"OrganizationId": "",
"GroupId": "",
"MemberId": ""
}
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=WorkMailService.AssociateMemberToGroup"
payload <- "{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"MemberId\": \"\"\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=WorkMailService.AssociateMemberToGroup")
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 \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"MemberId\": \"\"\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 \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"MemberId\": \"\"\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=WorkMailService.AssociateMemberToGroup";
let payload = json!({
"OrganizationId": "",
"GroupId": "",
"MemberId": ""
});
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=WorkMailService.AssociateMemberToGroup' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"GroupId": "",
"MemberId": ""
}'
echo '{
"OrganizationId": "",
"GroupId": "",
"MemberId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.AssociateMemberToGroup' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "GroupId": "",\n "MemberId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.AssociateMemberToGroup'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"GroupId": "",
"MemberId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.AssociateMemberToGroup")! 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
AssumeImpersonationRole
{{baseUrl}}/#X-Amz-Target=WorkMailService.AssumeImpersonationRole
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"ImpersonationRoleId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.AssumeImpersonationRole");
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 \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.AssumeImpersonationRole" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:ImpersonationRoleId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.AssumeImpersonationRole"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\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=WorkMailService.AssumeImpersonationRole"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\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=WorkMailService.AssumeImpersonationRole");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.AssumeImpersonationRole"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\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: 55
{
"OrganizationId": "",
"ImpersonationRoleId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.AssumeImpersonationRole")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.AssumeImpersonationRole"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\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 \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.AssumeImpersonationRole")
.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=WorkMailService.AssumeImpersonationRole")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
ImpersonationRoleId: ''
});
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=WorkMailService.AssumeImpersonationRole');
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=WorkMailService.AssumeImpersonationRole',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', ImpersonationRoleId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.AssumeImpersonationRole';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","ImpersonationRoleId":""}'
};
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=WorkMailService.AssumeImpersonationRole',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "ImpersonationRoleId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.AssumeImpersonationRole")
.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({OrganizationId: '', ImpersonationRoleId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.AssumeImpersonationRole',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', ImpersonationRoleId: ''},
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=WorkMailService.AssumeImpersonationRole');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
ImpersonationRoleId: ''
});
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=WorkMailService.AssumeImpersonationRole',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', ImpersonationRoleId: ''}
};
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=WorkMailService.AssumeImpersonationRole';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","ImpersonationRoleId":""}'
};
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 = @{ @"OrganizationId": @"",
@"ImpersonationRoleId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.AssumeImpersonationRole"]
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=WorkMailService.AssumeImpersonationRole" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.AssumeImpersonationRole",
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([
'OrganizationId' => '',
'ImpersonationRoleId' => ''
]),
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=WorkMailService.AssumeImpersonationRole', [
'body' => '{
"OrganizationId": "",
"ImpersonationRoleId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.AssumeImpersonationRole');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'ImpersonationRoleId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'ImpersonationRoleId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.AssumeImpersonationRole');
$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=WorkMailService.AssumeImpersonationRole' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"ImpersonationRoleId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.AssumeImpersonationRole' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"ImpersonationRoleId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\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=WorkMailService.AssumeImpersonationRole"
payload = {
"OrganizationId": "",
"ImpersonationRoleId": ""
}
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=WorkMailService.AssumeImpersonationRole"
payload <- "{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\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=WorkMailService.AssumeImpersonationRole")
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 \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\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 \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\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=WorkMailService.AssumeImpersonationRole";
let payload = json!({
"OrganizationId": "",
"ImpersonationRoleId": ""
});
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=WorkMailService.AssumeImpersonationRole' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"ImpersonationRoleId": ""
}'
echo '{
"OrganizationId": "",
"ImpersonationRoleId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.AssumeImpersonationRole' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "ImpersonationRoleId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.AssumeImpersonationRole'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"ImpersonationRoleId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.AssumeImpersonationRole")! 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
CancelMailboxExportJob
{{baseUrl}}/#X-Amz-Target=WorkMailService.CancelMailboxExportJob
HEADERS
X-Amz-Target
BODY json
{
"ClientToken": "",
"JobId": "",
"OrganizationId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.CancelMailboxExportJob");
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 \"ClientToken\": \"\",\n \"JobId\": \"\",\n \"OrganizationId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.CancelMailboxExportJob" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ClientToken ""
:JobId ""
:OrganizationId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.CancelMailboxExportJob"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ClientToken\": \"\",\n \"JobId\": \"\",\n \"OrganizationId\": \"\"\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=WorkMailService.CancelMailboxExportJob"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ClientToken\": \"\",\n \"JobId\": \"\",\n \"OrganizationId\": \"\"\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=WorkMailService.CancelMailboxExportJob");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ClientToken\": \"\",\n \"JobId\": \"\",\n \"OrganizationId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.CancelMailboxExportJob"
payload := strings.NewReader("{\n \"ClientToken\": \"\",\n \"JobId\": \"\",\n \"OrganizationId\": \"\"\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
{
"ClientToken": "",
"JobId": "",
"OrganizationId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.CancelMailboxExportJob")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ClientToken\": \"\",\n \"JobId\": \"\",\n \"OrganizationId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.CancelMailboxExportJob"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ClientToken\": \"\",\n \"JobId\": \"\",\n \"OrganizationId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"ClientToken\": \"\",\n \"JobId\": \"\",\n \"OrganizationId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.CancelMailboxExportJob")
.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=WorkMailService.CancelMailboxExportJob")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ClientToken\": \"\",\n \"JobId\": \"\",\n \"OrganizationId\": \"\"\n}")
.asString();
const data = JSON.stringify({
ClientToken: '',
JobId: '',
OrganizationId: ''
});
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=WorkMailService.CancelMailboxExportJob');
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=WorkMailService.CancelMailboxExportJob',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ClientToken: '', JobId: '', OrganizationId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.CancelMailboxExportJob';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ClientToken":"","JobId":"","OrganizationId":""}'
};
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=WorkMailService.CancelMailboxExportJob',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ClientToken": "",\n "JobId": "",\n "OrganizationId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ClientToken\": \"\",\n \"JobId\": \"\",\n \"OrganizationId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.CancelMailboxExportJob")
.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({ClientToken: '', JobId: '', OrganizationId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.CancelMailboxExportJob',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {ClientToken: '', JobId: '', OrganizationId: ''},
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=WorkMailService.CancelMailboxExportJob');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ClientToken: '',
JobId: '',
OrganizationId: ''
});
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=WorkMailService.CancelMailboxExportJob',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ClientToken: '', JobId: '', OrganizationId: ''}
};
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=WorkMailService.CancelMailboxExportJob';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ClientToken":"","JobId":"","OrganizationId":""}'
};
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 = @{ @"ClientToken": @"",
@"JobId": @"",
@"OrganizationId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.CancelMailboxExportJob"]
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=WorkMailService.CancelMailboxExportJob" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"ClientToken\": \"\",\n \"JobId\": \"\",\n \"OrganizationId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.CancelMailboxExportJob",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ClientToken' => '',
'JobId' => '',
'OrganizationId' => ''
]),
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=WorkMailService.CancelMailboxExportJob', [
'body' => '{
"ClientToken": "",
"JobId": "",
"OrganizationId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.CancelMailboxExportJob');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ClientToken' => '',
'JobId' => '',
'OrganizationId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ClientToken' => '',
'JobId' => '',
'OrganizationId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.CancelMailboxExportJob');
$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=WorkMailService.CancelMailboxExportJob' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ClientToken": "",
"JobId": "",
"OrganizationId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.CancelMailboxExportJob' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ClientToken": "",
"JobId": "",
"OrganizationId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ClientToken\": \"\",\n \"JobId\": \"\",\n \"OrganizationId\": \"\"\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=WorkMailService.CancelMailboxExportJob"
payload = {
"ClientToken": "",
"JobId": "",
"OrganizationId": ""
}
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=WorkMailService.CancelMailboxExportJob"
payload <- "{\n \"ClientToken\": \"\",\n \"JobId\": \"\",\n \"OrganizationId\": \"\"\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=WorkMailService.CancelMailboxExportJob")
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 \"ClientToken\": \"\",\n \"JobId\": \"\",\n \"OrganizationId\": \"\"\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 \"ClientToken\": \"\",\n \"JobId\": \"\",\n \"OrganizationId\": \"\"\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=WorkMailService.CancelMailboxExportJob";
let payload = json!({
"ClientToken": "",
"JobId": "",
"OrganizationId": ""
});
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=WorkMailService.CancelMailboxExportJob' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ClientToken": "",
"JobId": "",
"OrganizationId": ""
}'
echo '{
"ClientToken": "",
"JobId": "",
"OrganizationId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.CancelMailboxExportJob' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ClientToken": "",\n "JobId": "",\n "OrganizationId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.CancelMailboxExportJob'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"ClientToken": "",
"JobId": "",
"OrganizationId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.CancelMailboxExportJob")! 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
CreateAlias
{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateAlias
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"EntityId": "",
"Alias": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateAlias");
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 \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Alias\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateAlias" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:EntityId ""
:Alias ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateAlias"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Alias\": \"\"\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=WorkMailService.CreateAlias"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Alias\": \"\"\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=WorkMailService.CreateAlias");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Alias\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateAlias"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Alias\": \"\"\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: 59
{
"OrganizationId": "",
"EntityId": "",
"Alias": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateAlias")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Alias\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateAlias"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Alias\": \"\"\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 \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Alias\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateAlias")
.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=WorkMailService.CreateAlias")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Alias\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
EntityId: '',
Alias: ''
});
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=WorkMailService.CreateAlias');
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=WorkMailService.CreateAlias',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', EntityId: '', Alias: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateAlias';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","EntityId":"","Alias":""}'
};
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=WorkMailService.CreateAlias',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "EntityId": "",\n "Alias": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Alias\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateAlias")
.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({OrganizationId: '', EntityId: '', Alias: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateAlias',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', EntityId: '', Alias: ''},
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=WorkMailService.CreateAlias');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
EntityId: '',
Alias: ''
});
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=WorkMailService.CreateAlias',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', EntityId: '', Alias: ''}
};
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=WorkMailService.CreateAlias';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","EntityId":"","Alias":""}'
};
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 = @{ @"OrganizationId": @"",
@"EntityId": @"",
@"Alias": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateAlias"]
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=WorkMailService.CreateAlias" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Alias\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateAlias",
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([
'OrganizationId' => '',
'EntityId' => '',
'Alias' => ''
]),
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=WorkMailService.CreateAlias', [
'body' => '{
"OrganizationId": "",
"EntityId": "",
"Alias": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateAlias');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'EntityId' => '',
'Alias' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'EntityId' => '',
'Alias' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateAlias');
$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=WorkMailService.CreateAlias' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"EntityId": "",
"Alias": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateAlias' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"EntityId": "",
"Alias": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Alias\": \"\"\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=WorkMailService.CreateAlias"
payload = {
"OrganizationId": "",
"EntityId": "",
"Alias": ""
}
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=WorkMailService.CreateAlias"
payload <- "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Alias\": \"\"\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=WorkMailService.CreateAlias")
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 \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Alias\": \"\"\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 \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Alias\": \"\"\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=WorkMailService.CreateAlias";
let payload = json!({
"OrganizationId": "",
"EntityId": "",
"Alias": ""
});
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=WorkMailService.CreateAlias' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"EntityId": "",
"Alias": ""
}'
echo '{
"OrganizationId": "",
"EntityId": "",
"Alias": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateAlias' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "EntityId": "",\n "Alias": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateAlias'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"EntityId": "",
"Alias": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateAlias")! 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
CreateAvailabilityConfiguration
{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateAvailabilityConfiguration
HEADERS
X-Amz-Target
BODY json
{
"ClientToken": "",
"OrganizationId": "",
"DomainName": "",
"EwsProvider": "",
"LambdaProvider": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateAvailabilityConfiguration");
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 \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": \"\",\n \"LambdaProvider\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateAvailabilityConfiguration" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ClientToken ""
:OrganizationId ""
:DomainName ""
:EwsProvider ""
:LambdaProvider ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateAvailabilityConfiguration"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": \"\",\n \"LambdaProvider\": \"\"\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=WorkMailService.CreateAvailabilityConfiguration"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": \"\",\n \"LambdaProvider\": \"\"\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=WorkMailService.CreateAvailabilityConfiguration");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": \"\",\n \"LambdaProvider\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateAvailabilityConfiguration"
payload := strings.NewReader("{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": \"\",\n \"LambdaProvider\": \"\"\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: 112
{
"ClientToken": "",
"OrganizationId": "",
"DomainName": "",
"EwsProvider": "",
"LambdaProvider": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateAvailabilityConfiguration")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": \"\",\n \"LambdaProvider\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateAvailabilityConfiguration"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": \"\",\n \"LambdaProvider\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": \"\",\n \"LambdaProvider\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateAvailabilityConfiguration")
.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=WorkMailService.CreateAvailabilityConfiguration")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": \"\",\n \"LambdaProvider\": \"\"\n}")
.asString();
const data = JSON.stringify({
ClientToken: '',
OrganizationId: '',
DomainName: '',
EwsProvider: '',
LambdaProvider: ''
});
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=WorkMailService.CreateAvailabilityConfiguration');
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=WorkMailService.CreateAvailabilityConfiguration',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
ClientToken: '',
OrganizationId: '',
DomainName: '',
EwsProvider: '',
LambdaProvider: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateAvailabilityConfiguration';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ClientToken":"","OrganizationId":"","DomainName":"","EwsProvider":"","LambdaProvider":""}'
};
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=WorkMailService.CreateAvailabilityConfiguration',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ClientToken": "",\n "OrganizationId": "",\n "DomainName": "",\n "EwsProvider": "",\n "LambdaProvider": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": \"\",\n \"LambdaProvider\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateAvailabilityConfiguration")
.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({
ClientToken: '',
OrganizationId: '',
DomainName: '',
EwsProvider: '',
LambdaProvider: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateAvailabilityConfiguration',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
ClientToken: '',
OrganizationId: '',
DomainName: '',
EwsProvider: '',
LambdaProvider: ''
},
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=WorkMailService.CreateAvailabilityConfiguration');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ClientToken: '',
OrganizationId: '',
DomainName: '',
EwsProvider: '',
LambdaProvider: ''
});
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=WorkMailService.CreateAvailabilityConfiguration',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
ClientToken: '',
OrganizationId: '',
DomainName: '',
EwsProvider: '',
LambdaProvider: ''
}
};
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=WorkMailService.CreateAvailabilityConfiguration';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ClientToken":"","OrganizationId":"","DomainName":"","EwsProvider":"","LambdaProvider":""}'
};
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 = @{ @"ClientToken": @"",
@"OrganizationId": @"",
@"DomainName": @"",
@"EwsProvider": @"",
@"LambdaProvider": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateAvailabilityConfiguration"]
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=WorkMailService.CreateAvailabilityConfiguration" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": \"\",\n \"LambdaProvider\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateAvailabilityConfiguration",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ClientToken' => '',
'OrganizationId' => '',
'DomainName' => '',
'EwsProvider' => '',
'LambdaProvider' => ''
]),
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=WorkMailService.CreateAvailabilityConfiguration', [
'body' => '{
"ClientToken": "",
"OrganizationId": "",
"DomainName": "",
"EwsProvider": "",
"LambdaProvider": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateAvailabilityConfiguration');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ClientToken' => '',
'OrganizationId' => '',
'DomainName' => '',
'EwsProvider' => '',
'LambdaProvider' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ClientToken' => '',
'OrganizationId' => '',
'DomainName' => '',
'EwsProvider' => '',
'LambdaProvider' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateAvailabilityConfiguration');
$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=WorkMailService.CreateAvailabilityConfiguration' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ClientToken": "",
"OrganizationId": "",
"DomainName": "",
"EwsProvider": "",
"LambdaProvider": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateAvailabilityConfiguration' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ClientToken": "",
"OrganizationId": "",
"DomainName": "",
"EwsProvider": "",
"LambdaProvider": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": \"\",\n \"LambdaProvider\": \"\"\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=WorkMailService.CreateAvailabilityConfiguration"
payload = {
"ClientToken": "",
"OrganizationId": "",
"DomainName": "",
"EwsProvider": "",
"LambdaProvider": ""
}
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=WorkMailService.CreateAvailabilityConfiguration"
payload <- "{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": \"\",\n \"LambdaProvider\": \"\"\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=WorkMailService.CreateAvailabilityConfiguration")
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 \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": \"\",\n \"LambdaProvider\": \"\"\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 \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": \"\",\n \"LambdaProvider\": \"\"\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=WorkMailService.CreateAvailabilityConfiguration";
let payload = json!({
"ClientToken": "",
"OrganizationId": "",
"DomainName": "",
"EwsProvider": "",
"LambdaProvider": ""
});
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=WorkMailService.CreateAvailabilityConfiguration' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ClientToken": "",
"OrganizationId": "",
"DomainName": "",
"EwsProvider": "",
"LambdaProvider": ""
}'
echo '{
"ClientToken": "",
"OrganizationId": "",
"DomainName": "",
"EwsProvider": "",
"LambdaProvider": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateAvailabilityConfiguration' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ClientToken": "",\n "OrganizationId": "",\n "DomainName": "",\n "EwsProvider": "",\n "LambdaProvider": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateAvailabilityConfiguration'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"ClientToken": "",
"OrganizationId": "",
"DomainName": "",
"EwsProvider": "",
"LambdaProvider": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateAvailabilityConfiguration")! 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
CreateGroup
{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateGroup
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"Name": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateGroup");
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 \"OrganizationId\": \"\",\n \"Name\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateGroup" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:Name ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateGroup"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"Name\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateGroup"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"Name\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateGroup");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"Name\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateGroup"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"Name\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 40
{
"OrganizationId": "",
"Name": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateGroup")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"Name\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateGroup"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"Name\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"Name\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateGroup")
.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=WorkMailService.CreateGroup")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"Name\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
Name: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateGroup');
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=WorkMailService.CreateGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', Name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateGroup';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","Name":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateGroup',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "Name": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"Name\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateGroup")
.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({OrganizationId: '', Name: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', Name: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateGroup');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
Name: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', Name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateGroup';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","Name":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"OrganizationId": @"",
@"Name": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateGroup"]
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=WorkMailService.CreateGroup" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"Name\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateGroup",
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([
'OrganizationId' => '',
'Name' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateGroup', [
'body' => '{
"OrganizationId": "",
"Name": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateGroup');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'Name' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'Name' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateGroup');
$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=WorkMailService.CreateGroup' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"Name": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateGroup' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"Name": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"Name\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateGroup"
payload = {
"OrganizationId": "",
"Name": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateGroup"
payload <- "{\n \"OrganizationId\": \"\",\n \"Name\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateGroup")
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 \"OrganizationId\": \"\",\n \"Name\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"OrganizationId\": \"\",\n \"Name\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateGroup";
let payload = json!({
"OrganizationId": "",
"Name": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateGroup' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"Name": ""
}'
echo '{
"OrganizationId": "",
"Name": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateGroup' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "Name": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateGroup'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"Name": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateGroup")! 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
CreateImpersonationRole
{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateImpersonationRole
HEADERS
X-Amz-Target
BODY json
{
"ClientToken": "",
"OrganizationId": "",
"Name": "",
"Type": "",
"Description": "",
"Rules": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateImpersonationRole");
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 \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\",\n \"Description\": \"\",\n \"Rules\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateImpersonationRole" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ClientToken ""
:OrganizationId ""
:Name ""
:Type ""
:Description ""
:Rules ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateImpersonationRole"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\",\n \"Description\": \"\",\n \"Rules\": \"\"\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=WorkMailService.CreateImpersonationRole"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\",\n \"Description\": \"\",\n \"Rules\": \"\"\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=WorkMailService.CreateImpersonationRole");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\",\n \"Description\": \"\",\n \"Rules\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateImpersonationRole"
payload := strings.NewReader("{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\",\n \"Description\": \"\",\n \"Rules\": \"\"\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: 111
{
"ClientToken": "",
"OrganizationId": "",
"Name": "",
"Type": "",
"Description": "",
"Rules": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateImpersonationRole")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\",\n \"Description\": \"\",\n \"Rules\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateImpersonationRole"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\",\n \"Description\": \"\",\n \"Rules\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\",\n \"Description\": \"\",\n \"Rules\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateImpersonationRole")
.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=WorkMailService.CreateImpersonationRole")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\",\n \"Description\": \"\",\n \"Rules\": \"\"\n}")
.asString();
const data = JSON.stringify({
ClientToken: '',
OrganizationId: '',
Name: '',
Type: '',
Description: '',
Rules: ''
});
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=WorkMailService.CreateImpersonationRole');
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=WorkMailService.CreateImpersonationRole',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
ClientToken: '',
OrganizationId: '',
Name: '',
Type: '',
Description: '',
Rules: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateImpersonationRole';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ClientToken":"","OrganizationId":"","Name":"","Type":"","Description":"","Rules":""}'
};
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=WorkMailService.CreateImpersonationRole',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ClientToken": "",\n "OrganizationId": "",\n "Name": "",\n "Type": "",\n "Description": "",\n "Rules": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\",\n \"Description\": \"\",\n \"Rules\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateImpersonationRole")
.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({
ClientToken: '',
OrganizationId: '',
Name: '',
Type: '',
Description: '',
Rules: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateImpersonationRole',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
ClientToken: '',
OrganizationId: '',
Name: '',
Type: '',
Description: '',
Rules: ''
},
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=WorkMailService.CreateImpersonationRole');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ClientToken: '',
OrganizationId: '',
Name: '',
Type: '',
Description: '',
Rules: ''
});
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=WorkMailService.CreateImpersonationRole',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
ClientToken: '',
OrganizationId: '',
Name: '',
Type: '',
Description: '',
Rules: ''
}
};
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=WorkMailService.CreateImpersonationRole';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ClientToken":"","OrganizationId":"","Name":"","Type":"","Description":"","Rules":""}'
};
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 = @{ @"ClientToken": @"",
@"OrganizationId": @"",
@"Name": @"",
@"Type": @"",
@"Description": @"",
@"Rules": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateImpersonationRole"]
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=WorkMailService.CreateImpersonationRole" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\",\n \"Description\": \"\",\n \"Rules\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateImpersonationRole",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ClientToken' => '',
'OrganizationId' => '',
'Name' => '',
'Type' => '',
'Description' => '',
'Rules' => ''
]),
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=WorkMailService.CreateImpersonationRole', [
'body' => '{
"ClientToken": "",
"OrganizationId": "",
"Name": "",
"Type": "",
"Description": "",
"Rules": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateImpersonationRole');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ClientToken' => '',
'OrganizationId' => '',
'Name' => '',
'Type' => '',
'Description' => '',
'Rules' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ClientToken' => '',
'OrganizationId' => '',
'Name' => '',
'Type' => '',
'Description' => '',
'Rules' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateImpersonationRole');
$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=WorkMailService.CreateImpersonationRole' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ClientToken": "",
"OrganizationId": "",
"Name": "",
"Type": "",
"Description": "",
"Rules": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateImpersonationRole' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ClientToken": "",
"OrganizationId": "",
"Name": "",
"Type": "",
"Description": "",
"Rules": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\",\n \"Description\": \"\",\n \"Rules\": \"\"\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=WorkMailService.CreateImpersonationRole"
payload = {
"ClientToken": "",
"OrganizationId": "",
"Name": "",
"Type": "",
"Description": "",
"Rules": ""
}
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=WorkMailService.CreateImpersonationRole"
payload <- "{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\",\n \"Description\": \"\",\n \"Rules\": \"\"\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=WorkMailService.CreateImpersonationRole")
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 \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\",\n \"Description\": \"\",\n \"Rules\": \"\"\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 \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\",\n \"Description\": \"\",\n \"Rules\": \"\"\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=WorkMailService.CreateImpersonationRole";
let payload = json!({
"ClientToken": "",
"OrganizationId": "",
"Name": "",
"Type": "",
"Description": "",
"Rules": ""
});
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=WorkMailService.CreateImpersonationRole' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ClientToken": "",
"OrganizationId": "",
"Name": "",
"Type": "",
"Description": "",
"Rules": ""
}'
echo '{
"ClientToken": "",
"OrganizationId": "",
"Name": "",
"Type": "",
"Description": "",
"Rules": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateImpersonationRole' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ClientToken": "",\n "OrganizationId": "",\n "Name": "",\n "Type": "",\n "Description": "",\n "Rules": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateImpersonationRole'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"ClientToken": "",
"OrganizationId": "",
"Name": "",
"Type": "",
"Description": "",
"Rules": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateImpersonationRole")! 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
CreateMobileDeviceAccessRule
{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateMobileDeviceAccessRule
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"ClientToken": "",
"Name": "",
"Description": "",
"Effect": "",
"DeviceTypes": "",
"NotDeviceTypes": "",
"DeviceModels": "",
"NotDeviceModels": "",
"DeviceOperatingSystems": "",
"NotDeviceOperatingSystems": "",
"DeviceUserAgents": "",
"NotDeviceUserAgents": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateMobileDeviceAccessRule");
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 \"OrganizationId\": \"\",\n \"ClientToken\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Effect\": \"\",\n \"DeviceTypes\": \"\",\n \"NotDeviceTypes\": \"\",\n \"DeviceModels\": \"\",\n \"NotDeviceModels\": \"\",\n \"DeviceOperatingSystems\": \"\",\n \"NotDeviceOperatingSystems\": \"\",\n \"DeviceUserAgents\": \"\",\n \"NotDeviceUserAgents\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateMobileDeviceAccessRule" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:ClientToken ""
:Name ""
:Description ""
:Effect ""
:DeviceTypes ""
:NotDeviceTypes ""
:DeviceModels ""
:NotDeviceModels ""
:DeviceOperatingSystems ""
:NotDeviceOperatingSystems ""
:DeviceUserAgents ""
:NotDeviceUserAgents ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateMobileDeviceAccessRule"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"ClientToken\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Effect\": \"\",\n \"DeviceTypes\": \"\",\n \"NotDeviceTypes\": \"\",\n \"DeviceModels\": \"\",\n \"NotDeviceModels\": \"\",\n \"DeviceOperatingSystems\": \"\",\n \"NotDeviceOperatingSystems\": \"\",\n \"DeviceUserAgents\": \"\",\n \"NotDeviceUserAgents\": \"\"\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=WorkMailService.CreateMobileDeviceAccessRule"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"ClientToken\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Effect\": \"\",\n \"DeviceTypes\": \"\",\n \"NotDeviceTypes\": \"\",\n \"DeviceModels\": \"\",\n \"NotDeviceModels\": \"\",\n \"DeviceOperatingSystems\": \"\",\n \"NotDeviceOperatingSystems\": \"\",\n \"DeviceUserAgents\": \"\",\n \"NotDeviceUserAgents\": \"\"\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=WorkMailService.CreateMobileDeviceAccessRule");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"ClientToken\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Effect\": \"\",\n \"DeviceTypes\": \"\",\n \"NotDeviceTypes\": \"\",\n \"DeviceModels\": \"\",\n \"NotDeviceModels\": \"\",\n \"DeviceOperatingSystems\": \"\",\n \"NotDeviceOperatingSystems\": \"\",\n \"DeviceUserAgents\": \"\",\n \"NotDeviceUserAgents\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateMobileDeviceAccessRule"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"ClientToken\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Effect\": \"\",\n \"DeviceTypes\": \"\",\n \"NotDeviceTypes\": \"\",\n \"DeviceModels\": \"\",\n \"NotDeviceModels\": \"\",\n \"DeviceOperatingSystems\": \"\",\n \"NotDeviceOperatingSystems\": \"\",\n \"DeviceUserAgents\": \"\",\n \"NotDeviceUserAgents\": \"\"\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: 312
{
"OrganizationId": "",
"ClientToken": "",
"Name": "",
"Description": "",
"Effect": "",
"DeviceTypes": "",
"NotDeviceTypes": "",
"DeviceModels": "",
"NotDeviceModels": "",
"DeviceOperatingSystems": "",
"NotDeviceOperatingSystems": "",
"DeviceUserAgents": "",
"NotDeviceUserAgents": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateMobileDeviceAccessRule")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"ClientToken\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Effect\": \"\",\n \"DeviceTypes\": \"\",\n \"NotDeviceTypes\": \"\",\n \"DeviceModels\": \"\",\n \"NotDeviceModels\": \"\",\n \"DeviceOperatingSystems\": \"\",\n \"NotDeviceOperatingSystems\": \"\",\n \"DeviceUserAgents\": \"\",\n \"NotDeviceUserAgents\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateMobileDeviceAccessRule"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"ClientToken\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Effect\": \"\",\n \"DeviceTypes\": \"\",\n \"NotDeviceTypes\": \"\",\n \"DeviceModels\": \"\",\n \"NotDeviceModels\": \"\",\n \"DeviceOperatingSystems\": \"\",\n \"NotDeviceOperatingSystems\": \"\",\n \"DeviceUserAgents\": \"\",\n \"NotDeviceUserAgents\": \"\"\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 \"OrganizationId\": \"\",\n \"ClientToken\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Effect\": \"\",\n \"DeviceTypes\": \"\",\n \"NotDeviceTypes\": \"\",\n \"DeviceModels\": \"\",\n \"NotDeviceModels\": \"\",\n \"DeviceOperatingSystems\": \"\",\n \"NotDeviceOperatingSystems\": \"\",\n \"DeviceUserAgents\": \"\",\n \"NotDeviceUserAgents\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateMobileDeviceAccessRule")
.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=WorkMailService.CreateMobileDeviceAccessRule")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"ClientToken\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Effect\": \"\",\n \"DeviceTypes\": \"\",\n \"NotDeviceTypes\": \"\",\n \"DeviceModels\": \"\",\n \"NotDeviceModels\": \"\",\n \"DeviceOperatingSystems\": \"\",\n \"NotDeviceOperatingSystems\": \"\",\n \"DeviceUserAgents\": \"\",\n \"NotDeviceUserAgents\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
ClientToken: '',
Name: '',
Description: '',
Effect: '',
DeviceTypes: '',
NotDeviceTypes: '',
DeviceModels: '',
NotDeviceModels: '',
DeviceOperatingSystems: '',
NotDeviceOperatingSystems: '',
DeviceUserAgents: '',
NotDeviceUserAgents: ''
});
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=WorkMailService.CreateMobileDeviceAccessRule');
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=WorkMailService.CreateMobileDeviceAccessRule',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
OrganizationId: '',
ClientToken: '',
Name: '',
Description: '',
Effect: '',
DeviceTypes: '',
NotDeviceTypes: '',
DeviceModels: '',
NotDeviceModels: '',
DeviceOperatingSystems: '',
NotDeviceOperatingSystems: '',
DeviceUserAgents: '',
NotDeviceUserAgents: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateMobileDeviceAccessRule';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","ClientToken":"","Name":"","Description":"","Effect":"","DeviceTypes":"","NotDeviceTypes":"","DeviceModels":"","NotDeviceModels":"","DeviceOperatingSystems":"","NotDeviceOperatingSystems":"","DeviceUserAgents":"","NotDeviceUserAgents":""}'
};
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=WorkMailService.CreateMobileDeviceAccessRule',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "ClientToken": "",\n "Name": "",\n "Description": "",\n "Effect": "",\n "DeviceTypes": "",\n "NotDeviceTypes": "",\n "DeviceModels": "",\n "NotDeviceModels": "",\n "DeviceOperatingSystems": "",\n "NotDeviceOperatingSystems": "",\n "DeviceUserAgents": "",\n "NotDeviceUserAgents": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"ClientToken\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Effect\": \"\",\n \"DeviceTypes\": \"\",\n \"NotDeviceTypes\": \"\",\n \"DeviceModels\": \"\",\n \"NotDeviceModels\": \"\",\n \"DeviceOperatingSystems\": \"\",\n \"NotDeviceOperatingSystems\": \"\",\n \"DeviceUserAgents\": \"\",\n \"NotDeviceUserAgents\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateMobileDeviceAccessRule")
.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({
OrganizationId: '',
ClientToken: '',
Name: '',
Description: '',
Effect: '',
DeviceTypes: '',
NotDeviceTypes: '',
DeviceModels: '',
NotDeviceModels: '',
DeviceOperatingSystems: '',
NotDeviceOperatingSystems: '',
DeviceUserAgents: '',
NotDeviceUserAgents: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateMobileDeviceAccessRule',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
OrganizationId: '',
ClientToken: '',
Name: '',
Description: '',
Effect: '',
DeviceTypes: '',
NotDeviceTypes: '',
DeviceModels: '',
NotDeviceModels: '',
DeviceOperatingSystems: '',
NotDeviceOperatingSystems: '',
DeviceUserAgents: '',
NotDeviceUserAgents: ''
},
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=WorkMailService.CreateMobileDeviceAccessRule');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
ClientToken: '',
Name: '',
Description: '',
Effect: '',
DeviceTypes: '',
NotDeviceTypes: '',
DeviceModels: '',
NotDeviceModels: '',
DeviceOperatingSystems: '',
NotDeviceOperatingSystems: '',
DeviceUserAgents: '',
NotDeviceUserAgents: ''
});
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=WorkMailService.CreateMobileDeviceAccessRule',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
OrganizationId: '',
ClientToken: '',
Name: '',
Description: '',
Effect: '',
DeviceTypes: '',
NotDeviceTypes: '',
DeviceModels: '',
NotDeviceModels: '',
DeviceOperatingSystems: '',
NotDeviceOperatingSystems: '',
DeviceUserAgents: '',
NotDeviceUserAgents: ''
}
};
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=WorkMailService.CreateMobileDeviceAccessRule';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","ClientToken":"","Name":"","Description":"","Effect":"","DeviceTypes":"","NotDeviceTypes":"","DeviceModels":"","NotDeviceModels":"","DeviceOperatingSystems":"","NotDeviceOperatingSystems":"","DeviceUserAgents":"","NotDeviceUserAgents":""}'
};
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 = @{ @"OrganizationId": @"",
@"ClientToken": @"",
@"Name": @"",
@"Description": @"",
@"Effect": @"",
@"DeviceTypes": @"",
@"NotDeviceTypes": @"",
@"DeviceModels": @"",
@"NotDeviceModels": @"",
@"DeviceOperatingSystems": @"",
@"NotDeviceOperatingSystems": @"",
@"DeviceUserAgents": @"",
@"NotDeviceUserAgents": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateMobileDeviceAccessRule"]
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=WorkMailService.CreateMobileDeviceAccessRule" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"ClientToken\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Effect\": \"\",\n \"DeviceTypes\": \"\",\n \"NotDeviceTypes\": \"\",\n \"DeviceModels\": \"\",\n \"NotDeviceModels\": \"\",\n \"DeviceOperatingSystems\": \"\",\n \"NotDeviceOperatingSystems\": \"\",\n \"DeviceUserAgents\": \"\",\n \"NotDeviceUserAgents\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateMobileDeviceAccessRule",
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([
'OrganizationId' => '',
'ClientToken' => '',
'Name' => '',
'Description' => '',
'Effect' => '',
'DeviceTypes' => '',
'NotDeviceTypes' => '',
'DeviceModels' => '',
'NotDeviceModels' => '',
'DeviceOperatingSystems' => '',
'NotDeviceOperatingSystems' => '',
'DeviceUserAgents' => '',
'NotDeviceUserAgents' => ''
]),
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=WorkMailService.CreateMobileDeviceAccessRule', [
'body' => '{
"OrganizationId": "",
"ClientToken": "",
"Name": "",
"Description": "",
"Effect": "",
"DeviceTypes": "",
"NotDeviceTypes": "",
"DeviceModels": "",
"NotDeviceModels": "",
"DeviceOperatingSystems": "",
"NotDeviceOperatingSystems": "",
"DeviceUserAgents": "",
"NotDeviceUserAgents": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateMobileDeviceAccessRule');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'ClientToken' => '',
'Name' => '',
'Description' => '',
'Effect' => '',
'DeviceTypes' => '',
'NotDeviceTypes' => '',
'DeviceModels' => '',
'NotDeviceModels' => '',
'DeviceOperatingSystems' => '',
'NotDeviceOperatingSystems' => '',
'DeviceUserAgents' => '',
'NotDeviceUserAgents' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'ClientToken' => '',
'Name' => '',
'Description' => '',
'Effect' => '',
'DeviceTypes' => '',
'NotDeviceTypes' => '',
'DeviceModels' => '',
'NotDeviceModels' => '',
'DeviceOperatingSystems' => '',
'NotDeviceOperatingSystems' => '',
'DeviceUserAgents' => '',
'NotDeviceUserAgents' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateMobileDeviceAccessRule');
$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=WorkMailService.CreateMobileDeviceAccessRule' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"ClientToken": "",
"Name": "",
"Description": "",
"Effect": "",
"DeviceTypes": "",
"NotDeviceTypes": "",
"DeviceModels": "",
"NotDeviceModels": "",
"DeviceOperatingSystems": "",
"NotDeviceOperatingSystems": "",
"DeviceUserAgents": "",
"NotDeviceUserAgents": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateMobileDeviceAccessRule' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"ClientToken": "",
"Name": "",
"Description": "",
"Effect": "",
"DeviceTypes": "",
"NotDeviceTypes": "",
"DeviceModels": "",
"NotDeviceModels": "",
"DeviceOperatingSystems": "",
"NotDeviceOperatingSystems": "",
"DeviceUserAgents": "",
"NotDeviceUserAgents": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"ClientToken\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Effect\": \"\",\n \"DeviceTypes\": \"\",\n \"NotDeviceTypes\": \"\",\n \"DeviceModels\": \"\",\n \"NotDeviceModels\": \"\",\n \"DeviceOperatingSystems\": \"\",\n \"NotDeviceOperatingSystems\": \"\",\n \"DeviceUserAgents\": \"\",\n \"NotDeviceUserAgents\": \"\"\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=WorkMailService.CreateMobileDeviceAccessRule"
payload = {
"OrganizationId": "",
"ClientToken": "",
"Name": "",
"Description": "",
"Effect": "",
"DeviceTypes": "",
"NotDeviceTypes": "",
"DeviceModels": "",
"NotDeviceModels": "",
"DeviceOperatingSystems": "",
"NotDeviceOperatingSystems": "",
"DeviceUserAgents": "",
"NotDeviceUserAgents": ""
}
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=WorkMailService.CreateMobileDeviceAccessRule"
payload <- "{\n \"OrganizationId\": \"\",\n \"ClientToken\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Effect\": \"\",\n \"DeviceTypes\": \"\",\n \"NotDeviceTypes\": \"\",\n \"DeviceModels\": \"\",\n \"NotDeviceModels\": \"\",\n \"DeviceOperatingSystems\": \"\",\n \"NotDeviceOperatingSystems\": \"\",\n \"DeviceUserAgents\": \"\",\n \"NotDeviceUserAgents\": \"\"\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=WorkMailService.CreateMobileDeviceAccessRule")
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 \"OrganizationId\": \"\",\n \"ClientToken\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Effect\": \"\",\n \"DeviceTypes\": \"\",\n \"NotDeviceTypes\": \"\",\n \"DeviceModels\": \"\",\n \"NotDeviceModels\": \"\",\n \"DeviceOperatingSystems\": \"\",\n \"NotDeviceOperatingSystems\": \"\",\n \"DeviceUserAgents\": \"\",\n \"NotDeviceUserAgents\": \"\"\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 \"OrganizationId\": \"\",\n \"ClientToken\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Effect\": \"\",\n \"DeviceTypes\": \"\",\n \"NotDeviceTypes\": \"\",\n \"DeviceModels\": \"\",\n \"NotDeviceModels\": \"\",\n \"DeviceOperatingSystems\": \"\",\n \"NotDeviceOperatingSystems\": \"\",\n \"DeviceUserAgents\": \"\",\n \"NotDeviceUserAgents\": \"\"\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=WorkMailService.CreateMobileDeviceAccessRule";
let payload = json!({
"OrganizationId": "",
"ClientToken": "",
"Name": "",
"Description": "",
"Effect": "",
"DeviceTypes": "",
"NotDeviceTypes": "",
"DeviceModels": "",
"NotDeviceModels": "",
"DeviceOperatingSystems": "",
"NotDeviceOperatingSystems": "",
"DeviceUserAgents": "",
"NotDeviceUserAgents": ""
});
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=WorkMailService.CreateMobileDeviceAccessRule' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"ClientToken": "",
"Name": "",
"Description": "",
"Effect": "",
"DeviceTypes": "",
"NotDeviceTypes": "",
"DeviceModels": "",
"NotDeviceModels": "",
"DeviceOperatingSystems": "",
"NotDeviceOperatingSystems": "",
"DeviceUserAgents": "",
"NotDeviceUserAgents": ""
}'
echo '{
"OrganizationId": "",
"ClientToken": "",
"Name": "",
"Description": "",
"Effect": "",
"DeviceTypes": "",
"NotDeviceTypes": "",
"DeviceModels": "",
"NotDeviceModels": "",
"DeviceOperatingSystems": "",
"NotDeviceOperatingSystems": "",
"DeviceUserAgents": "",
"NotDeviceUserAgents": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateMobileDeviceAccessRule' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "ClientToken": "",\n "Name": "",\n "Description": "",\n "Effect": "",\n "DeviceTypes": "",\n "NotDeviceTypes": "",\n "DeviceModels": "",\n "NotDeviceModels": "",\n "DeviceOperatingSystems": "",\n "NotDeviceOperatingSystems": "",\n "DeviceUserAgents": "",\n "NotDeviceUserAgents": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateMobileDeviceAccessRule'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"ClientToken": "",
"Name": "",
"Description": "",
"Effect": "",
"DeviceTypes": "",
"NotDeviceTypes": "",
"DeviceModels": "",
"NotDeviceModels": "",
"DeviceOperatingSystems": "",
"NotDeviceOperatingSystems": "",
"DeviceUserAgents": "",
"NotDeviceUserAgents": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateMobileDeviceAccessRule")! 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
CreateOrganization
{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateOrganization
HEADERS
X-Amz-Target
BODY json
{
"DirectoryId": "",
"Alias": "",
"ClientToken": "",
"Domains": "",
"KmsKeyArn": "",
"EnableInteroperability": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateOrganization");
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 \"DirectoryId\": \"\",\n \"Alias\": \"\",\n \"ClientToken\": \"\",\n \"Domains\": \"\",\n \"KmsKeyArn\": \"\",\n \"EnableInteroperability\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateOrganization" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DirectoryId ""
:Alias ""
:ClientToken ""
:Domains ""
:KmsKeyArn ""
:EnableInteroperability ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateOrganization"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DirectoryId\": \"\",\n \"Alias\": \"\",\n \"ClientToken\": \"\",\n \"Domains\": \"\",\n \"KmsKeyArn\": \"\",\n \"EnableInteroperability\": \"\"\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=WorkMailService.CreateOrganization"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DirectoryId\": \"\",\n \"Alias\": \"\",\n \"ClientToken\": \"\",\n \"Domains\": \"\",\n \"KmsKeyArn\": \"\",\n \"EnableInteroperability\": \"\"\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=WorkMailService.CreateOrganization");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DirectoryId\": \"\",\n \"Alias\": \"\",\n \"ClientToken\": \"\",\n \"Domains\": \"\",\n \"KmsKeyArn\": \"\",\n \"EnableInteroperability\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateOrganization"
payload := strings.NewReader("{\n \"DirectoryId\": \"\",\n \"Alias\": \"\",\n \"ClientToken\": \"\",\n \"Domains\": \"\",\n \"KmsKeyArn\": \"\",\n \"EnableInteroperability\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 127
{
"DirectoryId": "",
"Alias": "",
"ClientToken": "",
"Domains": "",
"KmsKeyArn": "",
"EnableInteroperability": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateOrganization")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DirectoryId\": \"\",\n \"Alias\": \"\",\n \"ClientToken\": \"\",\n \"Domains\": \"\",\n \"KmsKeyArn\": \"\",\n \"EnableInteroperability\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateOrganization"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DirectoryId\": \"\",\n \"Alias\": \"\",\n \"ClientToken\": \"\",\n \"Domains\": \"\",\n \"KmsKeyArn\": \"\",\n \"EnableInteroperability\": \"\"\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 \"DirectoryId\": \"\",\n \"Alias\": \"\",\n \"ClientToken\": \"\",\n \"Domains\": \"\",\n \"KmsKeyArn\": \"\",\n \"EnableInteroperability\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateOrganization")
.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=WorkMailService.CreateOrganization")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DirectoryId\": \"\",\n \"Alias\": \"\",\n \"ClientToken\": \"\",\n \"Domains\": \"\",\n \"KmsKeyArn\": \"\",\n \"EnableInteroperability\": \"\"\n}")
.asString();
const data = JSON.stringify({
DirectoryId: '',
Alias: '',
ClientToken: '',
Domains: '',
KmsKeyArn: '',
EnableInteroperability: ''
});
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=WorkMailService.CreateOrganization');
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=WorkMailService.CreateOrganization',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
DirectoryId: '',
Alias: '',
ClientToken: '',
Domains: '',
KmsKeyArn: '',
EnableInteroperability: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateOrganization';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","Alias":"","ClientToken":"","Domains":"","KmsKeyArn":"","EnableInteroperability":""}'
};
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=WorkMailService.CreateOrganization',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DirectoryId": "",\n "Alias": "",\n "ClientToken": "",\n "Domains": "",\n "KmsKeyArn": "",\n "EnableInteroperability": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DirectoryId\": \"\",\n \"Alias\": \"\",\n \"ClientToken\": \"\",\n \"Domains\": \"\",\n \"KmsKeyArn\": \"\",\n \"EnableInteroperability\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateOrganization")
.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({
DirectoryId: '',
Alias: '',
ClientToken: '',
Domains: '',
KmsKeyArn: '',
EnableInteroperability: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateOrganization',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
DirectoryId: '',
Alias: '',
ClientToken: '',
Domains: '',
KmsKeyArn: '',
EnableInteroperability: ''
},
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=WorkMailService.CreateOrganization');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DirectoryId: '',
Alias: '',
ClientToken: '',
Domains: '',
KmsKeyArn: '',
EnableInteroperability: ''
});
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=WorkMailService.CreateOrganization',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
DirectoryId: '',
Alias: '',
ClientToken: '',
Domains: '',
KmsKeyArn: '',
EnableInteroperability: ''
}
};
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=WorkMailService.CreateOrganization';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DirectoryId":"","Alias":"","ClientToken":"","Domains":"","KmsKeyArn":"","EnableInteroperability":""}'
};
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 = @{ @"DirectoryId": @"",
@"Alias": @"",
@"ClientToken": @"",
@"Domains": @"",
@"KmsKeyArn": @"",
@"EnableInteroperability": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateOrganization"]
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=WorkMailService.CreateOrganization" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DirectoryId\": \"\",\n \"Alias\": \"\",\n \"ClientToken\": \"\",\n \"Domains\": \"\",\n \"KmsKeyArn\": \"\",\n \"EnableInteroperability\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateOrganization",
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([
'DirectoryId' => '',
'Alias' => '',
'ClientToken' => '',
'Domains' => '',
'KmsKeyArn' => '',
'EnableInteroperability' => ''
]),
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=WorkMailService.CreateOrganization', [
'body' => '{
"DirectoryId": "",
"Alias": "",
"ClientToken": "",
"Domains": "",
"KmsKeyArn": "",
"EnableInteroperability": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateOrganization');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DirectoryId' => '',
'Alias' => '',
'ClientToken' => '',
'Domains' => '',
'KmsKeyArn' => '',
'EnableInteroperability' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DirectoryId' => '',
'Alias' => '',
'ClientToken' => '',
'Domains' => '',
'KmsKeyArn' => '',
'EnableInteroperability' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateOrganization');
$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=WorkMailService.CreateOrganization' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"Alias": "",
"ClientToken": "",
"Domains": "",
"KmsKeyArn": "",
"EnableInteroperability": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateOrganization' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DirectoryId": "",
"Alias": "",
"ClientToken": "",
"Domains": "",
"KmsKeyArn": "",
"EnableInteroperability": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DirectoryId\": \"\",\n \"Alias\": \"\",\n \"ClientToken\": \"\",\n \"Domains\": \"\",\n \"KmsKeyArn\": \"\",\n \"EnableInteroperability\": \"\"\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=WorkMailService.CreateOrganization"
payload = {
"DirectoryId": "",
"Alias": "",
"ClientToken": "",
"Domains": "",
"KmsKeyArn": "",
"EnableInteroperability": ""
}
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=WorkMailService.CreateOrganization"
payload <- "{\n \"DirectoryId\": \"\",\n \"Alias\": \"\",\n \"ClientToken\": \"\",\n \"Domains\": \"\",\n \"KmsKeyArn\": \"\",\n \"EnableInteroperability\": \"\"\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=WorkMailService.CreateOrganization")
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 \"DirectoryId\": \"\",\n \"Alias\": \"\",\n \"ClientToken\": \"\",\n \"Domains\": \"\",\n \"KmsKeyArn\": \"\",\n \"EnableInteroperability\": \"\"\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 \"DirectoryId\": \"\",\n \"Alias\": \"\",\n \"ClientToken\": \"\",\n \"Domains\": \"\",\n \"KmsKeyArn\": \"\",\n \"EnableInteroperability\": \"\"\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=WorkMailService.CreateOrganization";
let payload = json!({
"DirectoryId": "",
"Alias": "",
"ClientToken": "",
"Domains": "",
"KmsKeyArn": "",
"EnableInteroperability": ""
});
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=WorkMailService.CreateOrganization' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DirectoryId": "",
"Alias": "",
"ClientToken": "",
"Domains": "",
"KmsKeyArn": "",
"EnableInteroperability": ""
}'
echo '{
"DirectoryId": "",
"Alias": "",
"ClientToken": "",
"Domains": "",
"KmsKeyArn": "",
"EnableInteroperability": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateOrganization' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DirectoryId": "",\n "Alias": "",\n "ClientToken": "",\n "Domains": "",\n "KmsKeyArn": "",\n "EnableInteroperability": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateOrganization'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DirectoryId": "",
"Alias": "",
"ClientToken": "",
"Domains": "",
"KmsKeyArn": "",
"EnableInteroperability": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateOrganization")! 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
CreateResource
{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateResource
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"Name": "",
"Type": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateResource");
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 \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateResource" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:Name ""
:Type ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateResource"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\"\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=WorkMailService.CreateResource"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\"\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=WorkMailService.CreateResource");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateResource"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 54
{
"OrganizationId": "",
"Name": "",
"Type": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateResource")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateResource"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\"\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 \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateResource")
.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=WorkMailService.CreateResource")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
Name: '',
Type: ''
});
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=WorkMailService.CreateResource');
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=WorkMailService.CreateResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', Name: '', Type: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateResource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","Name":"","Type":""}'
};
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=WorkMailService.CreateResource',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "Name": "",\n "Type": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateResource")
.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({OrganizationId: '', Name: '', Type: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', Name: '', Type: ''},
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=WorkMailService.CreateResource');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
Name: '',
Type: ''
});
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=WorkMailService.CreateResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', Name: '', Type: ''}
};
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=WorkMailService.CreateResource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","Name":"","Type":""}'
};
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 = @{ @"OrganizationId": @"",
@"Name": @"",
@"Type": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateResource"]
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=WorkMailService.CreateResource" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateResource",
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([
'OrganizationId' => '',
'Name' => '',
'Type' => ''
]),
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=WorkMailService.CreateResource', [
'body' => '{
"OrganizationId": "",
"Name": "",
"Type": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateResource');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'Name' => '',
'Type' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'Name' => '',
'Type' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateResource');
$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=WorkMailService.CreateResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"Name": "",
"Type": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"Name": "",
"Type": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\"\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=WorkMailService.CreateResource"
payload = {
"OrganizationId": "",
"Name": "",
"Type": ""
}
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=WorkMailService.CreateResource"
payload <- "{\n \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\"\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=WorkMailService.CreateResource")
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 \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\"\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 \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\"\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=WorkMailService.CreateResource";
let payload = json!({
"OrganizationId": "",
"Name": "",
"Type": ""
});
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=WorkMailService.CreateResource' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"Name": "",
"Type": ""
}'
echo '{
"OrganizationId": "",
"Name": "",
"Type": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateResource' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "Name": "",\n "Type": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateResource'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"Name": "",
"Type": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateResource")! 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
CreateUser
{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateUser
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"Name": "",
"DisplayName": "",
"Password": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateUser");
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 \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"Password\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateUser" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:Name ""
:DisplayName ""
:Password ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateUser"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"Password\": \"\"\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=WorkMailService.CreateUser"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"Password\": \"\"\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=WorkMailService.CreateUser");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"Password\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateUser"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"Password\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 79
{
"OrganizationId": "",
"Name": "",
"DisplayName": "",
"Password": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateUser")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"Password\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateUser"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"Password\": \"\"\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 \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"Password\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateUser")
.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=WorkMailService.CreateUser")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"Password\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
Name: '',
DisplayName: '',
Password: ''
});
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=WorkMailService.CreateUser');
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=WorkMailService.CreateUser',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', Name: '', DisplayName: '', Password: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateUser';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","Name":"","DisplayName":"","Password":""}'
};
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=WorkMailService.CreateUser',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "Name": "",\n "DisplayName": "",\n "Password": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"Password\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateUser")
.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({OrganizationId: '', Name: '', DisplayName: '', Password: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateUser',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', Name: '', DisplayName: '', Password: ''},
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=WorkMailService.CreateUser');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
Name: '',
DisplayName: '',
Password: ''
});
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=WorkMailService.CreateUser',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', Name: '', DisplayName: '', Password: ''}
};
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=WorkMailService.CreateUser';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","Name":"","DisplayName":"","Password":""}'
};
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 = @{ @"OrganizationId": @"",
@"Name": @"",
@"DisplayName": @"",
@"Password": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateUser"]
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=WorkMailService.CreateUser" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"Password\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateUser",
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([
'OrganizationId' => '',
'Name' => '',
'DisplayName' => '',
'Password' => ''
]),
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=WorkMailService.CreateUser', [
'body' => '{
"OrganizationId": "",
"Name": "",
"DisplayName": "",
"Password": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateUser');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'Name' => '',
'DisplayName' => '',
'Password' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'Name' => '',
'DisplayName' => '',
'Password' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateUser');
$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=WorkMailService.CreateUser' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"Name": "",
"DisplayName": "",
"Password": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateUser' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"Name": "",
"DisplayName": "",
"Password": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"Password\": \"\"\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=WorkMailService.CreateUser"
payload = {
"OrganizationId": "",
"Name": "",
"DisplayName": "",
"Password": ""
}
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=WorkMailService.CreateUser"
payload <- "{\n \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"Password\": \"\"\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=WorkMailService.CreateUser")
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 \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"Password\": \"\"\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 \"OrganizationId\": \"\",\n \"Name\": \"\",\n \"DisplayName\": \"\",\n \"Password\": \"\"\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=WorkMailService.CreateUser";
let payload = json!({
"OrganizationId": "",
"Name": "",
"DisplayName": "",
"Password": ""
});
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=WorkMailService.CreateUser' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"Name": "",
"DisplayName": "",
"Password": ""
}'
echo '{
"OrganizationId": "",
"Name": "",
"DisplayName": "",
"Password": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateUser' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "Name": "",\n "DisplayName": "",\n "Password": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateUser'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"Name": "",
"DisplayName": "",
"Password": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.CreateUser")! 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
DeleteAccessControlRule
{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAccessControlRule
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"Name": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAccessControlRule");
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 \"OrganizationId\": \"\",\n \"Name\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAccessControlRule" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:Name ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAccessControlRule"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"Name\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAccessControlRule"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"Name\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAccessControlRule");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"Name\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAccessControlRule"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"Name\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 40
{
"OrganizationId": "",
"Name": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAccessControlRule")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"Name\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAccessControlRule"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"Name\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"Name\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAccessControlRule")
.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=WorkMailService.DeleteAccessControlRule")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"Name\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
Name: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAccessControlRule');
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=WorkMailService.DeleteAccessControlRule',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', Name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAccessControlRule';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","Name":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAccessControlRule',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "Name": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"Name\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAccessControlRule")
.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({OrganizationId: '', Name: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAccessControlRule',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', Name: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAccessControlRule');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
Name: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAccessControlRule',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', Name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAccessControlRule';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","Name":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"OrganizationId": @"",
@"Name": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAccessControlRule"]
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=WorkMailService.DeleteAccessControlRule" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"Name\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAccessControlRule",
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([
'OrganizationId' => '',
'Name' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAccessControlRule', [
'body' => '{
"OrganizationId": "",
"Name": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAccessControlRule');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'Name' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'Name' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAccessControlRule');
$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=WorkMailService.DeleteAccessControlRule' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"Name": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAccessControlRule' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"Name": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"Name\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAccessControlRule"
payload = {
"OrganizationId": "",
"Name": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAccessControlRule"
payload <- "{\n \"OrganizationId\": \"\",\n \"Name\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAccessControlRule")
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 \"OrganizationId\": \"\",\n \"Name\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"OrganizationId\": \"\",\n \"Name\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAccessControlRule";
let payload = json!({
"OrganizationId": "",
"Name": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAccessControlRule' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"Name": ""
}'
echo '{
"OrganizationId": "",
"Name": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAccessControlRule' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "Name": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAccessControlRule'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"Name": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAccessControlRule")! 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
DeleteAlias
{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAlias
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"EntityId": "",
"Alias": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAlias");
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 \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Alias\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAlias" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:EntityId ""
:Alias ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAlias"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Alias\": \"\"\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=WorkMailService.DeleteAlias"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Alias\": \"\"\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=WorkMailService.DeleteAlias");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Alias\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAlias"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Alias\": \"\"\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: 59
{
"OrganizationId": "",
"EntityId": "",
"Alias": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAlias")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Alias\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAlias"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Alias\": \"\"\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 \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Alias\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAlias")
.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=WorkMailService.DeleteAlias")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Alias\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
EntityId: '',
Alias: ''
});
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=WorkMailService.DeleteAlias');
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=WorkMailService.DeleteAlias',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', EntityId: '', Alias: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAlias';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","EntityId":"","Alias":""}'
};
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=WorkMailService.DeleteAlias',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "EntityId": "",\n "Alias": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Alias\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAlias")
.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({OrganizationId: '', EntityId: '', Alias: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAlias',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', EntityId: '', Alias: ''},
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=WorkMailService.DeleteAlias');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
EntityId: '',
Alias: ''
});
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=WorkMailService.DeleteAlias',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', EntityId: '', Alias: ''}
};
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=WorkMailService.DeleteAlias';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","EntityId":"","Alias":""}'
};
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 = @{ @"OrganizationId": @"",
@"EntityId": @"",
@"Alias": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAlias"]
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=WorkMailService.DeleteAlias" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Alias\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAlias",
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([
'OrganizationId' => '',
'EntityId' => '',
'Alias' => ''
]),
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=WorkMailService.DeleteAlias', [
'body' => '{
"OrganizationId": "",
"EntityId": "",
"Alias": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAlias');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'EntityId' => '',
'Alias' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'EntityId' => '',
'Alias' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAlias');
$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=WorkMailService.DeleteAlias' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"EntityId": "",
"Alias": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAlias' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"EntityId": "",
"Alias": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Alias\": \"\"\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=WorkMailService.DeleteAlias"
payload = {
"OrganizationId": "",
"EntityId": "",
"Alias": ""
}
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=WorkMailService.DeleteAlias"
payload <- "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Alias\": \"\"\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=WorkMailService.DeleteAlias")
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 \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Alias\": \"\"\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 \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Alias\": \"\"\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=WorkMailService.DeleteAlias";
let payload = json!({
"OrganizationId": "",
"EntityId": "",
"Alias": ""
});
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=WorkMailService.DeleteAlias' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"EntityId": "",
"Alias": ""
}'
echo '{
"OrganizationId": "",
"EntityId": "",
"Alias": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAlias' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "EntityId": "",\n "Alias": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAlias'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"EntityId": "",
"Alias": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAlias")! 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
DeleteAvailabilityConfiguration
{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAvailabilityConfiguration
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"DomainName": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAvailabilityConfiguration");
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 \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAvailabilityConfiguration" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:DomainName ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAvailabilityConfiguration"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\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=WorkMailService.DeleteAvailabilityConfiguration"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\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=WorkMailService.DeleteAvailabilityConfiguration");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAvailabilityConfiguration"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 46
{
"OrganizationId": "",
"DomainName": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAvailabilityConfiguration")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAvailabilityConfiguration"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\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 \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAvailabilityConfiguration")
.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=WorkMailService.DeleteAvailabilityConfiguration")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
DomainName: ''
});
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=WorkMailService.DeleteAvailabilityConfiguration');
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=WorkMailService.DeleteAvailabilityConfiguration',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', DomainName: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAvailabilityConfiguration';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","DomainName":""}'
};
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=WorkMailService.DeleteAvailabilityConfiguration',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "DomainName": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAvailabilityConfiguration")
.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({OrganizationId: '', DomainName: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAvailabilityConfiguration',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', DomainName: ''},
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=WorkMailService.DeleteAvailabilityConfiguration');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
DomainName: ''
});
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=WorkMailService.DeleteAvailabilityConfiguration',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', DomainName: ''}
};
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=WorkMailService.DeleteAvailabilityConfiguration';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","DomainName":""}'
};
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 = @{ @"OrganizationId": @"",
@"DomainName": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAvailabilityConfiguration"]
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=WorkMailService.DeleteAvailabilityConfiguration" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAvailabilityConfiguration",
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([
'OrganizationId' => '',
'DomainName' => ''
]),
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=WorkMailService.DeleteAvailabilityConfiguration', [
'body' => '{
"OrganizationId": "",
"DomainName": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAvailabilityConfiguration');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'DomainName' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'DomainName' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAvailabilityConfiguration');
$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=WorkMailService.DeleteAvailabilityConfiguration' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"DomainName": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAvailabilityConfiguration' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"DomainName": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\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=WorkMailService.DeleteAvailabilityConfiguration"
payload = {
"OrganizationId": "",
"DomainName": ""
}
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=WorkMailService.DeleteAvailabilityConfiguration"
payload <- "{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\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=WorkMailService.DeleteAvailabilityConfiguration")
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 \"OrganizationId\": \"\",\n \"DomainName\": \"\"\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 \"OrganizationId\": \"\",\n \"DomainName\": \"\"\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=WorkMailService.DeleteAvailabilityConfiguration";
let payload = json!({
"OrganizationId": "",
"DomainName": ""
});
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=WorkMailService.DeleteAvailabilityConfiguration' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"DomainName": ""
}'
echo '{
"OrganizationId": "",
"DomainName": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAvailabilityConfiguration' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "DomainName": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAvailabilityConfiguration'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"DomainName": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteAvailabilityConfiguration")! 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
DeleteEmailMonitoringConfiguration
{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteEmailMonitoringConfiguration
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteEmailMonitoringConfiguration");
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 \"OrganizationId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteEmailMonitoringConfiguration" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteEmailMonitoringConfiguration"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\"\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=WorkMailService.DeleteEmailMonitoringConfiguration"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\"\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=WorkMailService.DeleteEmailMonitoringConfiguration");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteEmailMonitoringConfiguration"
payload := strings.NewReader("{\n \"OrganizationId\": \"\"\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
{
"OrganizationId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteEmailMonitoringConfiguration")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteEmailMonitoringConfiguration"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\"\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 \"OrganizationId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteEmailMonitoringConfiguration")
.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=WorkMailService.DeleteEmailMonitoringConfiguration")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: ''
});
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=WorkMailService.DeleteEmailMonitoringConfiguration');
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=WorkMailService.DeleteEmailMonitoringConfiguration',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteEmailMonitoringConfiguration';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":""}'
};
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=WorkMailService.DeleteEmailMonitoringConfiguration',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteEmailMonitoringConfiguration")
.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({OrganizationId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteEmailMonitoringConfiguration',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: ''},
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=WorkMailService.DeleteEmailMonitoringConfiguration');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: ''
});
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=WorkMailService.DeleteEmailMonitoringConfiguration',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: ''}
};
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=WorkMailService.DeleteEmailMonitoringConfiguration';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":""}'
};
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 = @{ @"OrganizationId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteEmailMonitoringConfiguration"]
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=WorkMailService.DeleteEmailMonitoringConfiguration" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteEmailMonitoringConfiguration",
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([
'OrganizationId' => ''
]),
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=WorkMailService.DeleteEmailMonitoringConfiguration', [
'body' => '{
"OrganizationId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteEmailMonitoringConfiguration');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteEmailMonitoringConfiguration');
$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=WorkMailService.DeleteEmailMonitoringConfiguration' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteEmailMonitoringConfiguration' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\"\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=WorkMailService.DeleteEmailMonitoringConfiguration"
payload = { "OrganizationId": "" }
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=WorkMailService.DeleteEmailMonitoringConfiguration"
payload <- "{\n \"OrganizationId\": \"\"\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=WorkMailService.DeleteEmailMonitoringConfiguration")
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 \"OrganizationId\": \"\"\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 \"OrganizationId\": \"\"\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=WorkMailService.DeleteEmailMonitoringConfiguration";
let payload = json!({"OrganizationId": ""});
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=WorkMailService.DeleteEmailMonitoringConfiguration' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": ""
}'
echo '{
"OrganizationId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteEmailMonitoringConfiguration' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteEmailMonitoringConfiguration'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["OrganizationId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteEmailMonitoringConfiguration")! 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
DeleteGroup
{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteGroup
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"GroupId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteGroup");
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 \"OrganizationId\": \"\",\n \"GroupId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteGroup" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:GroupId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteGroup"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\"\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=WorkMailService.DeleteGroup"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\"\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=WorkMailService.DeleteGroup");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteGroup"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\"\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
{
"OrganizationId": "",
"GroupId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteGroup")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteGroup"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\"\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 \"OrganizationId\": \"\",\n \"GroupId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteGroup")
.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=WorkMailService.DeleteGroup")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
GroupId: ''
});
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=WorkMailService.DeleteGroup');
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=WorkMailService.DeleteGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', GroupId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteGroup';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","GroupId":""}'
};
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=WorkMailService.DeleteGroup',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "GroupId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteGroup")
.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({OrganizationId: '', GroupId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', GroupId: ''},
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=WorkMailService.DeleteGroup');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
GroupId: ''
});
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=WorkMailService.DeleteGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', GroupId: ''}
};
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=WorkMailService.DeleteGroup';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","GroupId":""}'
};
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 = @{ @"OrganizationId": @"",
@"GroupId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteGroup"]
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=WorkMailService.DeleteGroup" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteGroup",
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([
'OrganizationId' => '',
'GroupId' => ''
]),
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=WorkMailService.DeleteGroup', [
'body' => '{
"OrganizationId": "",
"GroupId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteGroup');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'GroupId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'GroupId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteGroup');
$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=WorkMailService.DeleteGroup' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"GroupId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteGroup' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"GroupId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\"\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=WorkMailService.DeleteGroup"
payload = {
"OrganizationId": "",
"GroupId": ""
}
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=WorkMailService.DeleteGroup"
payload <- "{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\"\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=WorkMailService.DeleteGroup")
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 \"OrganizationId\": \"\",\n \"GroupId\": \"\"\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 \"OrganizationId\": \"\",\n \"GroupId\": \"\"\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=WorkMailService.DeleteGroup";
let payload = json!({
"OrganizationId": "",
"GroupId": ""
});
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=WorkMailService.DeleteGroup' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"GroupId": ""
}'
echo '{
"OrganizationId": "",
"GroupId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteGroup' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "GroupId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteGroup'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"GroupId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteGroup")! 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
DeleteImpersonationRole
{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteImpersonationRole
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"ImpersonationRoleId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteImpersonationRole");
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 \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteImpersonationRole" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:ImpersonationRoleId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteImpersonationRole"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\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=WorkMailService.DeleteImpersonationRole"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\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=WorkMailService.DeleteImpersonationRole");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteImpersonationRole"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\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: 55
{
"OrganizationId": "",
"ImpersonationRoleId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteImpersonationRole")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteImpersonationRole"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\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 \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteImpersonationRole")
.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=WorkMailService.DeleteImpersonationRole")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
ImpersonationRoleId: ''
});
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=WorkMailService.DeleteImpersonationRole');
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=WorkMailService.DeleteImpersonationRole',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', ImpersonationRoleId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteImpersonationRole';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","ImpersonationRoleId":""}'
};
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=WorkMailService.DeleteImpersonationRole',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "ImpersonationRoleId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteImpersonationRole")
.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({OrganizationId: '', ImpersonationRoleId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteImpersonationRole',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', ImpersonationRoleId: ''},
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=WorkMailService.DeleteImpersonationRole');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
ImpersonationRoleId: ''
});
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=WorkMailService.DeleteImpersonationRole',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', ImpersonationRoleId: ''}
};
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=WorkMailService.DeleteImpersonationRole';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","ImpersonationRoleId":""}'
};
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 = @{ @"OrganizationId": @"",
@"ImpersonationRoleId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteImpersonationRole"]
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=WorkMailService.DeleteImpersonationRole" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteImpersonationRole",
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([
'OrganizationId' => '',
'ImpersonationRoleId' => ''
]),
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=WorkMailService.DeleteImpersonationRole', [
'body' => '{
"OrganizationId": "",
"ImpersonationRoleId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteImpersonationRole');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'ImpersonationRoleId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'ImpersonationRoleId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteImpersonationRole');
$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=WorkMailService.DeleteImpersonationRole' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"ImpersonationRoleId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteImpersonationRole' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"ImpersonationRoleId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\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=WorkMailService.DeleteImpersonationRole"
payload = {
"OrganizationId": "",
"ImpersonationRoleId": ""
}
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=WorkMailService.DeleteImpersonationRole"
payload <- "{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\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=WorkMailService.DeleteImpersonationRole")
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 \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\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 \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\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=WorkMailService.DeleteImpersonationRole";
let payload = json!({
"OrganizationId": "",
"ImpersonationRoleId": ""
});
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=WorkMailService.DeleteImpersonationRole' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"ImpersonationRoleId": ""
}'
echo '{
"OrganizationId": "",
"ImpersonationRoleId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteImpersonationRole' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "ImpersonationRoleId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteImpersonationRole'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"ImpersonationRoleId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteImpersonationRole")! 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
DeleteMailboxPermissions
{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMailboxPermissions
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"EntityId": "",
"GranteeId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMailboxPermissions");
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 \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"GranteeId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMailboxPermissions" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:EntityId ""
:GranteeId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMailboxPermissions"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"GranteeId\": \"\"\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=WorkMailService.DeleteMailboxPermissions"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"GranteeId\": \"\"\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=WorkMailService.DeleteMailboxPermissions");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"GranteeId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMailboxPermissions"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"GranteeId\": \"\"\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: 63
{
"OrganizationId": "",
"EntityId": "",
"GranteeId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMailboxPermissions")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"GranteeId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMailboxPermissions"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"GranteeId\": \"\"\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 \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"GranteeId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMailboxPermissions")
.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=WorkMailService.DeleteMailboxPermissions")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"GranteeId\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
EntityId: '',
GranteeId: ''
});
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=WorkMailService.DeleteMailboxPermissions');
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=WorkMailService.DeleteMailboxPermissions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', EntityId: '', GranteeId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMailboxPermissions';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","EntityId":"","GranteeId":""}'
};
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=WorkMailService.DeleteMailboxPermissions',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "EntityId": "",\n "GranteeId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"GranteeId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMailboxPermissions")
.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({OrganizationId: '', EntityId: '', GranteeId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMailboxPermissions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', EntityId: '', GranteeId: ''},
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=WorkMailService.DeleteMailboxPermissions');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
EntityId: '',
GranteeId: ''
});
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=WorkMailService.DeleteMailboxPermissions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', EntityId: '', GranteeId: ''}
};
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=WorkMailService.DeleteMailboxPermissions';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","EntityId":"","GranteeId":""}'
};
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 = @{ @"OrganizationId": @"",
@"EntityId": @"",
@"GranteeId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMailboxPermissions"]
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=WorkMailService.DeleteMailboxPermissions" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"GranteeId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMailboxPermissions",
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([
'OrganizationId' => '',
'EntityId' => '',
'GranteeId' => ''
]),
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=WorkMailService.DeleteMailboxPermissions', [
'body' => '{
"OrganizationId": "",
"EntityId": "",
"GranteeId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMailboxPermissions');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'EntityId' => '',
'GranteeId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'EntityId' => '',
'GranteeId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMailboxPermissions');
$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=WorkMailService.DeleteMailboxPermissions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"EntityId": "",
"GranteeId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMailboxPermissions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"EntityId": "",
"GranteeId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"GranteeId\": \"\"\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=WorkMailService.DeleteMailboxPermissions"
payload = {
"OrganizationId": "",
"EntityId": "",
"GranteeId": ""
}
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=WorkMailService.DeleteMailboxPermissions"
payload <- "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"GranteeId\": \"\"\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=WorkMailService.DeleteMailboxPermissions")
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 \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"GranteeId\": \"\"\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 \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"GranteeId\": \"\"\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=WorkMailService.DeleteMailboxPermissions";
let payload = json!({
"OrganizationId": "",
"EntityId": "",
"GranteeId": ""
});
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=WorkMailService.DeleteMailboxPermissions' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"EntityId": "",
"GranteeId": ""
}'
echo '{
"OrganizationId": "",
"EntityId": "",
"GranteeId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMailboxPermissions' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "EntityId": "",\n "GranteeId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMailboxPermissions'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"EntityId": "",
"GranteeId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMailboxPermissions")! 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
DeleteMobileDeviceAccessOverride
{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMobileDeviceAccessOverride
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"UserId": "",
"DeviceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMobileDeviceAccessOverride");
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 \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMobileDeviceAccessOverride" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:UserId ""
:DeviceId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMobileDeviceAccessOverride"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\"\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=WorkMailService.DeleteMobileDeviceAccessOverride"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\"\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=WorkMailService.DeleteMobileDeviceAccessOverride");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMobileDeviceAccessOverride"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\"\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
{
"OrganizationId": "",
"UserId": "",
"DeviceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMobileDeviceAccessOverride")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMobileDeviceAccessOverride"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\"\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 \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMobileDeviceAccessOverride")
.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=WorkMailService.DeleteMobileDeviceAccessOverride")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
UserId: '',
DeviceId: ''
});
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=WorkMailService.DeleteMobileDeviceAccessOverride');
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=WorkMailService.DeleteMobileDeviceAccessOverride',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', UserId: '', DeviceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMobileDeviceAccessOverride';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","UserId":"","DeviceId":""}'
};
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=WorkMailService.DeleteMobileDeviceAccessOverride',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "UserId": "",\n "DeviceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMobileDeviceAccessOverride")
.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({OrganizationId: '', UserId: '', DeviceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMobileDeviceAccessOverride',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', UserId: '', DeviceId: ''},
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=WorkMailService.DeleteMobileDeviceAccessOverride');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
UserId: '',
DeviceId: ''
});
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=WorkMailService.DeleteMobileDeviceAccessOverride',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', UserId: '', DeviceId: ''}
};
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=WorkMailService.DeleteMobileDeviceAccessOverride';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","UserId":"","DeviceId":""}'
};
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 = @{ @"OrganizationId": @"",
@"UserId": @"",
@"DeviceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMobileDeviceAccessOverride"]
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=WorkMailService.DeleteMobileDeviceAccessOverride" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMobileDeviceAccessOverride",
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([
'OrganizationId' => '',
'UserId' => '',
'DeviceId' => ''
]),
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=WorkMailService.DeleteMobileDeviceAccessOverride', [
'body' => '{
"OrganizationId": "",
"UserId": "",
"DeviceId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMobileDeviceAccessOverride');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'UserId' => '',
'DeviceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'UserId' => '',
'DeviceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMobileDeviceAccessOverride');
$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=WorkMailService.DeleteMobileDeviceAccessOverride' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"UserId": "",
"DeviceId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMobileDeviceAccessOverride' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"UserId": "",
"DeviceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\"\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=WorkMailService.DeleteMobileDeviceAccessOverride"
payload = {
"OrganizationId": "",
"UserId": "",
"DeviceId": ""
}
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=WorkMailService.DeleteMobileDeviceAccessOverride"
payload <- "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\"\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=WorkMailService.DeleteMobileDeviceAccessOverride")
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 \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\"\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 \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\"\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=WorkMailService.DeleteMobileDeviceAccessOverride";
let payload = json!({
"OrganizationId": "",
"UserId": "",
"DeviceId": ""
});
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=WorkMailService.DeleteMobileDeviceAccessOverride' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"UserId": "",
"DeviceId": ""
}'
echo '{
"OrganizationId": "",
"UserId": "",
"DeviceId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMobileDeviceAccessOverride' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "UserId": "",\n "DeviceId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMobileDeviceAccessOverride'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"UserId": "",
"DeviceId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMobileDeviceAccessOverride")! 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
DeleteMobileDeviceAccessRule
{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMobileDeviceAccessRule
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"MobileDeviceAccessRuleId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMobileDeviceAccessRule");
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 \"OrganizationId\": \"\",\n \"MobileDeviceAccessRuleId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMobileDeviceAccessRule" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:MobileDeviceAccessRuleId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMobileDeviceAccessRule"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"MobileDeviceAccessRuleId\": \"\"\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=WorkMailService.DeleteMobileDeviceAccessRule"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"MobileDeviceAccessRuleId\": \"\"\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=WorkMailService.DeleteMobileDeviceAccessRule");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"MobileDeviceAccessRuleId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMobileDeviceAccessRule"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"MobileDeviceAccessRuleId\": \"\"\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
{
"OrganizationId": "",
"MobileDeviceAccessRuleId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMobileDeviceAccessRule")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"MobileDeviceAccessRuleId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMobileDeviceAccessRule"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"MobileDeviceAccessRuleId\": \"\"\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 \"OrganizationId\": \"\",\n \"MobileDeviceAccessRuleId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMobileDeviceAccessRule")
.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=WorkMailService.DeleteMobileDeviceAccessRule")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"MobileDeviceAccessRuleId\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
MobileDeviceAccessRuleId: ''
});
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=WorkMailService.DeleteMobileDeviceAccessRule');
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=WorkMailService.DeleteMobileDeviceAccessRule',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', MobileDeviceAccessRuleId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMobileDeviceAccessRule';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","MobileDeviceAccessRuleId":""}'
};
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=WorkMailService.DeleteMobileDeviceAccessRule',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "MobileDeviceAccessRuleId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"MobileDeviceAccessRuleId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMobileDeviceAccessRule")
.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({OrganizationId: '', MobileDeviceAccessRuleId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMobileDeviceAccessRule',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', MobileDeviceAccessRuleId: ''},
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=WorkMailService.DeleteMobileDeviceAccessRule');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
MobileDeviceAccessRuleId: ''
});
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=WorkMailService.DeleteMobileDeviceAccessRule',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', MobileDeviceAccessRuleId: ''}
};
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=WorkMailService.DeleteMobileDeviceAccessRule';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","MobileDeviceAccessRuleId":""}'
};
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 = @{ @"OrganizationId": @"",
@"MobileDeviceAccessRuleId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMobileDeviceAccessRule"]
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=WorkMailService.DeleteMobileDeviceAccessRule" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"MobileDeviceAccessRuleId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMobileDeviceAccessRule",
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([
'OrganizationId' => '',
'MobileDeviceAccessRuleId' => ''
]),
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=WorkMailService.DeleteMobileDeviceAccessRule', [
'body' => '{
"OrganizationId": "",
"MobileDeviceAccessRuleId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMobileDeviceAccessRule');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'MobileDeviceAccessRuleId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'MobileDeviceAccessRuleId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMobileDeviceAccessRule');
$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=WorkMailService.DeleteMobileDeviceAccessRule' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"MobileDeviceAccessRuleId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMobileDeviceAccessRule' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"MobileDeviceAccessRuleId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"MobileDeviceAccessRuleId\": \"\"\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=WorkMailService.DeleteMobileDeviceAccessRule"
payload = {
"OrganizationId": "",
"MobileDeviceAccessRuleId": ""
}
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=WorkMailService.DeleteMobileDeviceAccessRule"
payload <- "{\n \"OrganizationId\": \"\",\n \"MobileDeviceAccessRuleId\": \"\"\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=WorkMailService.DeleteMobileDeviceAccessRule")
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 \"OrganizationId\": \"\",\n \"MobileDeviceAccessRuleId\": \"\"\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 \"OrganizationId\": \"\",\n \"MobileDeviceAccessRuleId\": \"\"\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=WorkMailService.DeleteMobileDeviceAccessRule";
let payload = json!({
"OrganizationId": "",
"MobileDeviceAccessRuleId": ""
});
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=WorkMailService.DeleteMobileDeviceAccessRule' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"MobileDeviceAccessRuleId": ""
}'
echo '{
"OrganizationId": "",
"MobileDeviceAccessRuleId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMobileDeviceAccessRule' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "MobileDeviceAccessRuleId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMobileDeviceAccessRule'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"MobileDeviceAccessRuleId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteMobileDeviceAccessRule")! 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
DeleteOrganization
{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteOrganization
HEADERS
X-Amz-Target
BODY json
{
"ClientToken": "",
"OrganizationId": "",
"DeleteDirectory": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteOrganization");
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 \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DeleteDirectory\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteOrganization" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ClientToken ""
:OrganizationId ""
:DeleteDirectory ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteOrganization"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DeleteDirectory\": \"\"\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=WorkMailService.DeleteOrganization"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DeleteDirectory\": \"\"\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=WorkMailService.DeleteOrganization");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DeleteDirectory\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteOrganization"
payload := strings.NewReader("{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DeleteDirectory\": \"\"\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
{
"ClientToken": "",
"OrganizationId": "",
"DeleteDirectory": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteOrganization")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DeleteDirectory\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteOrganization"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DeleteDirectory\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DeleteDirectory\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteOrganization")
.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=WorkMailService.DeleteOrganization")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DeleteDirectory\": \"\"\n}")
.asString();
const data = JSON.stringify({
ClientToken: '',
OrganizationId: '',
DeleteDirectory: ''
});
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=WorkMailService.DeleteOrganization');
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=WorkMailService.DeleteOrganization',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ClientToken: '', OrganizationId: '', DeleteDirectory: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteOrganization';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ClientToken":"","OrganizationId":"","DeleteDirectory":""}'
};
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=WorkMailService.DeleteOrganization',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ClientToken": "",\n "OrganizationId": "",\n "DeleteDirectory": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DeleteDirectory\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteOrganization")
.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({ClientToken: '', OrganizationId: '', DeleteDirectory: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteOrganization',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {ClientToken: '', OrganizationId: '', DeleteDirectory: ''},
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=WorkMailService.DeleteOrganization');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ClientToken: '',
OrganizationId: '',
DeleteDirectory: ''
});
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=WorkMailService.DeleteOrganization',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ClientToken: '', OrganizationId: '', DeleteDirectory: ''}
};
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=WorkMailService.DeleteOrganization';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ClientToken":"","OrganizationId":"","DeleteDirectory":""}'
};
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 = @{ @"ClientToken": @"",
@"OrganizationId": @"",
@"DeleteDirectory": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteOrganization"]
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=WorkMailService.DeleteOrganization" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DeleteDirectory\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteOrganization",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ClientToken' => '',
'OrganizationId' => '',
'DeleteDirectory' => ''
]),
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=WorkMailService.DeleteOrganization', [
'body' => '{
"ClientToken": "",
"OrganizationId": "",
"DeleteDirectory": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteOrganization');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ClientToken' => '',
'OrganizationId' => '',
'DeleteDirectory' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ClientToken' => '',
'OrganizationId' => '',
'DeleteDirectory' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteOrganization');
$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=WorkMailService.DeleteOrganization' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ClientToken": "",
"OrganizationId": "",
"DeleteDirectory": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteOrganization' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ClientToken": "",
"OrganizationId": "",
"DeleteDirectory": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DeleteDirectory\": \"\"\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=WorkMailService.DeleteOrganization"
payload = {
"ClientToken": "",
"OrganizationId": "",
"DeleteDirectory": ""
}
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=WorkMailService.DeleteOrganization"
payload <- "{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DeleteDirectory\": \"\"\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=WorkMailService.DeleteOrganization")
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 \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DeleteDirectory\": \"\"\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 \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DeleteDirectory\": \"\"\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=WorkMailService.DeleteOrganization";
let payload = json!({
"ClientToken": "",
"OrganizationId": "",
"DeleteDirectory": ""
});
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=WorkMailService.DeleteOrganization' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ClientToken": "",
"OrganizationId": "",
"DeleteDirectory": ""
}'
echo '{
"ClientToken": "",
"OrganizationId": "",
"DeleteDirectory": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteOrganization' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ClientToken": "",\n "OrganizationId": "",\n "DeleteDirectory": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteOrganization'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"ClientToken": "",
"OrganizationId": "",
"DeleteDirectory": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteOrganization")! 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
DeleteResource
{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteResource
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"ResourceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteResource");
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 \"OrganizationId\": \"\",\n \"ResourceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteResource" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:ResourceId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteResource"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\"\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=WorkMailService.DeleteResource"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\"\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=WorkMailService.DeleteResource");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteResource"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 46
{
"OrganizationId": "",
"ResourceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteResource")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteResource"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\"\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 \"OrganizationId\": \"\",\n \"ResourceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteResource")
.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=WorkMailService.DeleteResource")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
ResourceId: ''
});
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=WorkMailService.DeleteResource');
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=WorkMailService.DeleteResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', ResourceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteResource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","ResourceId":""}'
};
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=WorkMailService.DeleteResource',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "ResourceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteResource")
.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({OrganizationId: '', ResourceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', ResourceId: ''},
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=WorkMailService.DeleteResource');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
ResourceId: ''
});
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=WorkMailService.DeleteResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', ResourceId: ''}
};
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=WorkMailService.DeleteResource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","ResourceId":""}'
};
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 = @{ @"OrganizationId": @"",
@"ResourceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteResource"]
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=WorkMailService.DeleteResource" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteResource",
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([
'OrganizationId' => '',
'ResourceId' => ''
]),
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=WorkMailService.DeleteResource', [
'body' => '{
"OrganizationId": "",
"ResourceId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteResource');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'ResourceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'ResourceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteResource');
$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=WorkMailService.DeleteResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"ResourceId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"ResourceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\"\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=WorkMailService.DeleteResource"
payload = {
"OrganizationId": "",
"ResourceId": ""
}
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=WorkMailService.DeleteResource"
payload <- "{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\"\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=WorkMailService.DeleteResource")
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 \"OrganizationId\": \"\",\n \"ResourceId\": \"\"\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 \"OrganizationId\": \"\",\n \"ResourceId\": \"\"\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=WorkMailService.DeleteResource";
let payload = json!({
"OrganizationId": "",
"ResourceId": ""
});
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=WorkMailService.DeleteResource' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"ResourceId": ""
}'
echo '{
"OrganizationId": "",
"ResourceId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteResource' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "ResourceId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteResource'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"ResourceId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteResource")! 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
DeleteRetentionPolicy
{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteRetentionPolicy
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"Id": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteRetentionPolicy");
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 \"OrganizationId\": \"\",\n \"Id\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteRetentionPolicy" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:Id ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteRetentionPolicy"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"Id\": \"\"\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=WorkMailService.DeleteRetentionPolicy"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"Id\": \"\"\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=WorkMailService.DeleteRetentionPolicy");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"Id\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteRetentionPolicy"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"Id\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 38
{
"OrganizationId": "",
"Id": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteRetentionPolicy")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"Id\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteRetentionPolicy"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"Id\": \"\"\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 \"OrganizationId\": \"\",\n \"Id\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteRetentionPolicy")
.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=WorkMailService.DeleteRetentionPolicy")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"Id\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
Id: ''
});
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=WorkMailService.DeleteRetentionPolicy');
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=WorkMailService.DeleteRetentionPolicy',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', Id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteRetentionPolicy';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","Id":""}'
};
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=WorkMailService.DeleteRetentionPolicy',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "Id": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"Id\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteRetentionPolicy")
.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({OrganizationId: '', Id: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteRetentionPolicy',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', Id: ''},
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=WorkMailService.DeleteRetentionPolicy');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
Id: ''
});
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=WorkMailService.DeleteRetentionPolicy',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', Id: ''}
};
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=WorkMailService.DeleteRetentionPolicy';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","Id":""}'
};
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 = @{ @"OrganizationId": @"",
@"Id": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteRetentionPolicy"]
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=WorkMailService.DeleteRetentionPolicy" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"Id\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteRetentionPolicy",
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([
'OrganizationId' => '',
'Id' => ''
]),
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=WorkMailService.DeleteRetentionPolicy', [
'body' => '{
"OrganizationId": "",
"Id": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteRetentionPolicy');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'Id' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'Id' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteRetentionPolicy');
$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=WorkMailService.DeleteRetentionPolicy' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"Id": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteRetentionPolicy' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"Id": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"Id\": \"\"\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=WorkMailService.DeleteRetentionPolicy"
payload = {
"OrganizationId": "",
"Id": ""
}
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=WorkMailService.DeleteRetentionPolicy"
payload <- "{\n \"OrganizationId\": \"\",\n \"Id\": \"\"\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=WorkMailService.DeleteRetentionPolicy")
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 \"OrganizationId\": \"\",\n \"Id\": \"\"\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 \"OrganizationId\": \"\",\n \"Id\": \"\"\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=WorkMailService.DeleteRetentionPolicy";
let payload = json!({
"OrganizationId": "",
"Id": ""
});
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=WorkMailService.DeleteRetentionPolicy' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"Id": ""
}'
echo '{
"OrganizationId": "",
"Id": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteRetentionPolicy' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "Id": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteRetentionPolicy'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"Id": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteRetentionPolicy")! 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
DeleteUser
{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteUser
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"UserId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteUser");
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 \"OrganizationId\": \"\",\n \"UserId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteUser" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:UserId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteUser"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\"\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=WorkMailService.DeleteUser"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\"\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=WorkMailService.DeleteUser");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteUser"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 42
{
"OrganizationId": "",
"UserId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteUser")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteUser"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\"\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 \"OrganizationId\": \"\",\n \"UserId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteUser")
.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=WorkMailService.DeleteUser")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
UserId: ''
});
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=WorkMailService.DeleteUser');
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=WorkMailService.DeleteUser',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', UserId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteUser';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","UserId":""}'
};
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=WorkMailService.DeleteUser',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "UserId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteUser")
.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({OrganizationId: '', UserId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteUser',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', UserId: ''},
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=WorkMailService.DeleteUser');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
UserId: ''
});
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=WorkMailService.DeleteUser',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', UserId: ''}
};
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=WorkMailService.DeleteUser';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","UserId":""}'
};
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 = @{ @"OrganizationId": @"",
@"UserId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteUser"]
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=WorkMailService.DeleteUser" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteUser",
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([
'OrganizationId' => '',
'UserId' => ''
]),
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=WorkMailService.DeleteUser', [
'body' => '{
"OrganizationId": "",
"UserId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteUser');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'UserId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'UserId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteUser');
$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=WorkMailService.DeleteUser' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"UserId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteUser' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"UserId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\"\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=WorkMailService.DeleteUser"
payload = {
"OrganizationId": "",
"UserId": ""
}
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=WorkMailService.DeleteUser"
payload <- "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\"\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=WorkMailService.DeleteUser")
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 \"OrganizationId\": \"\",\n \"UserId\": \"\"\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 \"OrganizationId\": \"\",\n \"UserId\": \"\"\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=WorkMailService.DeleteUser";
let payload = json!({
"OrganizationId": "",
"UserId": ""
});
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=WorkMailService.DeleteUser' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"UserId": ""
}'
echo '{
"OrganizationId": "",
"UserId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteUser' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "UserId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteUser'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"UserId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeleteUser")! 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
DeregisterFromWorkMail
{{baseUrl}}/#X-Amz-Target=WorkMailService.DeregisterFromWorkMail
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"EntityId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeregisterFromWorkMail");
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 \"OrganizationId\": \"\",\n \"EntityId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeregisterFromWorkMail" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:EntityId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeregisterFromWorkMail"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\"\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=WorkMailService.DeregisterFromWorkMail"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\"\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=WorkMailService.DeregisterFromWorkMail");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeregisterFromWorkMail"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\"\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: 44
{
"OrganizationId": "",
"EntityId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeregisterFromWorkMail")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeregisterFromWorkMail"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\"\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 \"OrganizationId\": \"\",\n \"EntityId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeregisterFromWorkMail")
.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=WorkMailService.DeregisterFromWorkMail")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
EntityId: ''
});
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=WorkMailService.DeregisterFromWorkMail');
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=WorkMailService.DeregisterFromWorkMail',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', EntityId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeregisterFromWorkMail';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","EntityId":""}'
};
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=WorkMailService.DeregisterFromWorkMail',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "EntityId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeregisterFromWorkMail")
.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({OrganizationId: '', EntityId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeregisterFromWorkMail',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', EntityId: ''},
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=WorkMailService.DeregisterFromWorkMail');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
EntityId: ''
});
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=WorkMailService.DeregisterFromWorkMail',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', EntityId: ''}
};
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=WorkMailService.DeregisterFromWorkMail';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","EntityId":""}'
};
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 = @{ @"OrganizationId": @"",
@"EntityId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.DeregisterFromWorkMail"]
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=WorkMailService.DeregisterFromWorkMail" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.DeregisterFromWorkMail",
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([
'OrganizationId' => '',
'EntityId' => ''
]),
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=WorkMailService.DeregisterFromWorkMail', [
'body' => '{
"OrganizationId": "",
"EntityId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DeregisterFromWorkMail');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'EntityId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'EntityId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DeregisterFromWorkMail');
$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=WorkMailService.DeregisterFromWorkMail' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"EntityId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeregisterFromWorkMail' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"EntityId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\"\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=WorkMailService.DeregisterFromWorkMail"
payload = {
"OrganizationId": "",
"EntityId": ""
}
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=WorkMailService.DeregisterFromWorkMail"
payload <- "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\"\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=WorkMailService.DeregisterFromWorkMail")
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 \"OrganizationId\": \"\",\n \"EntityId\": \"\"\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 \"OrganizationId\": \"\",\n \"EntityId\": \"\"\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=WorkMailService.DeregisterFromWorkMail";
let payload = json!({
"OrganizationId": "",
"EntityId": ""
});
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=WorkMailService.DeregisterFromWorkMail' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"EntityId": ""
}'
echo '{
"OrganizationId": "",
"EntityId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeregisterFromWorkMail' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "EntityId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeregisterFromWorkMail'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"EntityId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeregisterFromWorkMail")! 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
DeregisterMailDomain
{{baseUrl}}/#X-Amz-Target=WorkMailService.DeregisterMailDomain
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"DomainName": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeregisterMailDomain");
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 \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeregisterMailDomain" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:DomainName ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeregisterMailDomain"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\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=WorkMailService.DeregisterMailDomain"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\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=WorkMailService.DeregisterMailDomain");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeregisterMailDomain"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 46
{
"OrganizationId": "",
"DomainName": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeregisterMailDomain")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeregisterMailDomain"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\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 \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeregisterMailDomain")
.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=WorkMailService.DeregisterMailDomain")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
DomainName: ''
});
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=WorkMailService.DeregisterMailDomain');
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=WorkMailService.DeregisterMailDomain',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', DomainName: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeregisterMailDomain';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","DomainName":""}'
};
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=WorkMailService.DeregisterMailDomain',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "DomainName": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DeregisterMailDomain")
.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({OrganizationId: '', DomainName: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeregisterMailDomain',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', DomainName: ''},
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=WorkMailService.DeregisterMailDomain');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
DomainName: ''
});
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=WorkMailService.DeregisterMailDomain',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', DomainName: ''}
};
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=WorkMailService.DeregisterMailDomain';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","DomainName":""}'
};
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 = @{ @"OrganizationId": @"",
@"DomainName": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.DeregisterMailDomain"]
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=WorkMailService.DeregisterMailDomain" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.DeregisterMailDomain",
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([
'OrganizationId' => '',
'DomainName' => ''
]),
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=WorkMailService.DeregisterMailDomain', [
'body' => '{
"OrganizationId": "",
"DomainName": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DeregisterMailDomain');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'DomainName' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'DomainName' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DeregisterMailDomain');
$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=WorkMailService.DeregisterMailDomain' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"DomainName": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeregisterMailDomain' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"DomainName": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\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=WorkMailService.DeregisterMailDomain"
payload = {
"OrganizationId": "",
"DomainName": ""
}
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=WorkMailService.DeregisterMailDomain"
payload <- "{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\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=WorkMailService.DeregisterMailDomain")
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 \"OrganizationId\": \"\",\n \"DomainName\": \"\"\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 \"OrganizationId\": \"\",\n \"DomainName\": \"\"\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=WorkMailService.DeregisterMailDomain";
let payload = json!({
"OrganizationId": "",
"DomainName": ""
});
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=WorkMailService.DeregisterMailDomain' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"DomainName": ""
}'
echo '{
"OrganizationId": "",
"DomainName": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeregisterMailDomain' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "DomainName": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.DeregisterMailDomain'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"DomainName": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.DeregisterMailDomain")! 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
DescribeEmailMonitoringConfiguration
{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeEmailMonitoringConfiguration
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeEmailMonitoringConfiguration");
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 \"OrganizationId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeEmailMonitoringConfiguration" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeEmailMonitoringConfiguration"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\"\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=WorkMailService.DescribeEmailMonitoringConfiguration"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\"\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=WorkMailService.DescribeEmailMonitoringConfiguration");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeEmailMonitoringConfiguration"
payload := strings.NewReader("{\n \"OrganizationId\": \"\"\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
{
"OrganizationId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeEmailMonitoringConfiguration")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeEmailMonitoringConfiguration"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\"\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 \"OrganizationId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeEmailMonitoringConfiguration")
.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=WorkMailService.DescribeEmailMonitoringConfiguration")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: ''
});
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=WorkMailService.DescribeEmailMonitoringConfiguration');
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=WorkMailService.DescribeEmailMonitoringConfiguration',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeEmailMonitoringConfiguration';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":""}'
};
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=WorkMailService.DescribeEmailMonitoringConfiguration',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeEmailMonitoringConfiguration")
.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({OrganizationId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeEmailMonitoringConfiguration',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: ''},
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=WorkMailService.DescribeEmailMonitoringConfiguration');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: ''
});
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=WorkMailService.DescribeEmailMonitoringConfiguration',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: ''}
};
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=WorkMailService.DescribeEmailMonitoringConfiguration';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":""}'
};
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 = @{ @"OrganizationId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeEmailMonitoringConfiguration"]
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=WorkMailService.DescribeEmailMonitoringConfiguration" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeEmailMonitoringConfiguration",
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([
'OrganizationId' => ''
]),
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=WorkMailService.DescribeEmailMonitoringConfiguration', [
'body' => '{
"OrganizationId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeEmailMonitoringConfiguration');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeEmailMonitoringConfiguration');
$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=WorkMailService.DescribeEmailMonitoringConfiguration' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeEmailMonitoringConfiguration' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\"\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=WorkMailService.DescribeEmailMonitoringConfiguration"
payload = { "OrganizationId": "" }
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=WorkMailService.DescribeEmailMonitoringConfiguration"
payload <- "{\n \"OrganizationId\": \"\"\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=WorkMailService.DescribeEmailMonitoringConfiguration")
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 \"OrganizationId\": \"\"\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 \"OrganizationId\": \"\"\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=WorkMailService.DescribeEmailMonitoringConfiguration";
let payload = json!({"OrganizationId": ""});
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=WorkMailService.DescribeEmailMonitoringConfiguration' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": ""
}'
echo '{
"OrganizationId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeEmailMonitoringConfiguration' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeEmailMonitoringConfiguration'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["OrganizationId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeEmailMonitoringConfiguration")! 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
DescribeGroup
{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeGroup
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"GroupId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeGroup");
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 \"OrganizationId\": \"\",\n \"GroupId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeGroup" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:GroupId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeGroup"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\"\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=WorkMailService.DescribeGroup"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\"\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=WorkMailService.DescribeGroup");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeGroup"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\"\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
{
"OrganizationId": "",
"GroupId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeGroup")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeGroup"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\"\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 \"OrganizationId\": \"\",\n \"GroupId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeGroup")
.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=WorkMailService.DescribeGroup")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
GroupId: ''
});
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=WorkMailService.DescribeGroup');
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=WorkMailService.DescribeGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', GroupId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeGroup';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","GroupId":""}'
};
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=WorkMailService.DescribeGroup',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "GroupId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeGroup")
.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({OrganizationId: '', GroupId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', GroupId: ''},
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=WorkMailService.DescribeGroup');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
GroupId: ''
});
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=WorkMailService.DescribeGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', GroupId: ''}
};
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=WorkMailService.DescribeGroup';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","GroupId":""}'
};
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 = @{ @"OrganizationId": @"",
@"GroupId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeGroup"]
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=WorkMailService.DescribeGroup" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeGroup",
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([
'OrganizationId' => '',
'GroupId' => ''
]),
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=WorkMailService.DescribeGroup', [
'body' => '{
"OrganizationId": "",
"GroupId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeGroup');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'GroupId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'GroupId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeGroup');
$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=WorkMailService.DescribeGroup' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"GroupId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeGroup' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"GroupId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\"\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=WorkMailService.DescribeGroup"
payload = {
"OrganizationId": "",
"GroupId": ""
}
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=WorkMailService.DescribeGroup"
payload <- "{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\"\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=WorkMailService.DescribeGroup")
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 \"OrganizationId\": \"\",\n \"GroupId\": \"\"\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 \"OrganizationId\": \"\",\n \"GroupId\": \"\"\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=WorkMailService.DescribeGroup";
let payload = json!({
"OrganizationId": "",
"GroupId": ""
});
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=WorkMailService.DescribeGroup' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"GroupId": ""
}'
echo '{
"OrganizationId": "",
"GroupId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeGroup' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "GroupId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeGroup'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"GroupId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeGroup")! 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
DescribeInboundDmarcSettings
{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeInboundDmarcSettings
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeInboundDmarcSettings");
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 \"OrganizationId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeInboundDmarcSettings" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeInboundDmarcSettings"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\"\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=WorkMailService.DescribeInboundDmarcSettings"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\"\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=WorkMailService.DescribeInboundDmarcSettings");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeInboundDmarcSettings"
payload := strings.NewReader("{\n \"OrganizationId\": \"\"\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
{
"OrganizationId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeInboundDmarcSettings")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeInboundDmarcSettings"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\"\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 \"OrganizationId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeInboundDmarcSettings")
.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=WorkMailService.DescribeInboundDmarcSettings")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: ''
});
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=WorkMailService.DescribeInboundDmarcSettings');
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=WorkMailService.DescribeInboundDmarcSettings',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeInboundDmarcSettings';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":""}'
};
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=WorkMailService.DescribeInboundDmarcSettings',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeInboundDmarcSettings")
.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({OrganizationId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeInboundDmarcSettings',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: ''},
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=WorkMailService.DescribeInboundDmarcSettings');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: ''
});
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=WorkMailService.DescribeInboundDmarcSettings',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: ''}
};
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=WorkMailService.DescribeInboundDmarcSettings';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":""}'
};
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 = @{ @"OrganizationId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeInboundDmarcSettings"]
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=WorkMailService.DescribeInboundDmarcSettings" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeInboundDmarcSettings",
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([
'OrganizationId' => ''
]),
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=WorkMailService.DescribeInboundDmarcSettings', [
'body' => '{
"OrganizationId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeInboundDmarcSettings');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeInboundDmarcSettings');
$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=WorkMailService.DescribeInboundDmarcSettings' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeInboundDmarcSettings' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\"\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=WorkMailService.DescribeInboundDmarcSettings"
payload = { "OrganizationId": "" }
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=WorkMailService.DescribeInboundDmarcSettings"
payload <- "{\n \"OrganizationId\": \"\"\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=WorkMailService.DescribeInboundDmarcSettings")
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 \"OrganizationId\": \"\"\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 \"OrganizationId\": \"\"\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=WorkMailService.DescribeInboundDmarcSettings";
let payload = json!({"OrganizationId": ""});
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=WorkMailService.DescribeInboundDmarcSettings' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": ""
}'
echo '{
"OrganizationId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeInboundDmarcSettings' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeInboundDmarcSettings'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["OrganizationId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeInboundDmarcSettings")! 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
DescribeMailboxExportJob
{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeMailboxExportJob
HEADERS
X-Amz-Target
BODY json
{
"JobId": "",
"OrganizationId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeMailboxExportJob");
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 \"JobId\": \"\",\n \"OrganizationId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeMailboxExportJob" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:JobId ""
:OrganizationId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeMailboxExportJob"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"JobId\": \"\",\n \"OrganizationId\": \"\"\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=WorkMailService.DescribeMailboxExportJob"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"JobId\": \"\",\n \"OrganizationId\": \"\"\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=WorkMailService.DescribeMailboxExportJob");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"JobId\": \"\",\n \"OrganizationId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeMailboxExportJob"
payload := strings.NewReader("{\n \"JobId\": \"\",\n \"OrganizationId\": \"\"\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
{
"JobId": "",
"OrganizationId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeMailboxExportJob")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"JobId\": \"\",\n \"OrganizationId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeMailboxExportJob"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"JobId\": \"\",\n \"OrganizationId\": \"\"\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 \"JobId\": \"\",\n \"OrganizationId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeMailboxExportJob")
.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=WorkMailService.DescribeMailboxExportJob")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"JobId\": \"\",\n \"OrganizationId\": \"\"\n}")
.asString();
const data = JSON.stringify({
JobId: '',
OrganizationId: ''
});
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=WorkMailService.DescribeMailboxExportJob');
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=WorkMailService.DescribeMailboxExportJob',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {JobId: '', OrganizationId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeMailboxExportJob';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"JobId":"","OrganizationId":""}'
};
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=WorkMailService.DescribeMailboxExportJob',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "JobId": "",\n "OrganizationId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"JobId\": \"\",\n \"OrganizationId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeMailboxExportJob")
.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({JobId: '', OrganizationId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeMailboxExportJob',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {JobId: '', OrganizationId: ''},
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=WorkMailService.DescribeMailboxExportJob');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
JobId: '',
OrganizationId: ''
});
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=WorkMailService.DescribeMailboxExportJob',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {JobId: '', OrganizationId: ''}
};
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=WorkMailService.DescribeMailboxExportJob';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"JobId":"","OrganizationId":""}'
};
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 = @{ @"JobId": @"",
@"OrganizationId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeMailboxExportJob"]
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=WorkMailService.DescribeMailboxExportJob" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"JobId\": \"\",\n \"OrganizationId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeMailboxExportJob",
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([
'JobId' => '',
'OrganizationId' => ''
]),
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=WorkMailService.DescribeMailboxExportJob', [
'body' => '{
"JobId": "",
"OrganizationId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeMailboxExportJob');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'JobId' => '',
'OrganizationId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'JobId' => '',
'OrganizationId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeMailboxExportJob');
$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=WorkMailService.DescribeMailboxExportJob' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"JobId": "",
"OrganizationId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeMailboxExportJob' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"JobId": "",
"OrganizationId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"JobId\": \"\",\n \"OrganizationId\": \"\"\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=WorkMailService.DescribeMailboxExportJob"
payload = {
"JobId": "",
"OrganizationId": ""
}
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=WorkMailService.DescribeMailboxExportJob"
payload <- "{\n \"JobId\": \"\",\n \"OrganizationId\": \"\"\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=WorkMailService.DescribeMailboxExportJob")
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 \"JobId\": \"\",\n \"OrganizationId\": \"\"\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 \"JobId\": \"\",\n \"OrganizationId\": \"\"\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=WorkMailService.DescribeMailboxExportJob";
let payload = json!({
"JobId": "",
"OrganizationId": ""
});
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=WorkMailService.DescribeMailboxExportJob' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"JobId": "",
"OrganizationId": ""
}'
echo '{
"JobId": "",
"OrganizationId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeMailboxExportJob' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "JobId": "",\n "OrganizationId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeMailboxExportJob'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"JobId": "",
"OrganizationId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeMailboxExportJob")! 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
DescribeOrganization
{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeOrganization
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeOrganization");
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 \"OrganizationId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeOrganization" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeOrganization"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\"\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=WorkMailService.DescribeOrganization"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\"\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=WorkMailService.DescribeOrganization");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeOrganization"
payload := strings.NewReader("{\n \"OrganizationId\": \"\"\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
{
"OrganizationId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeOrganization")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeOrganization"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\"\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 \"OrganizationId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeOrganization")
.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=WorkMailService.DescribeOrganization")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: ''
});
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=WorkMailService.DescribeOrganization');
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=WorkMailService.DescribeOrganization',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeOrganization';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":""}'
};
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=WorkMailService.DescribeOrganization',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeOrganization")
.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({OrganizationId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeOrganization',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: ''},
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=WorkMailService.DescribeOrganization');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: ''
});
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=WorkMailService.DescribeOrganization',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: ''}
};
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=WorkMailService.DescribeOrganization';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":""}'
};
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 = @{ @"OrganizationId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeOrganization"]
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=WorkMailService.DescribeOrganization" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeOrganization",
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([
'OrganizationId' => ''
]),
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=WorkMailService.DescribeOrganization', [
'body' => '{
"OrganizationId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeOrganization');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeOrganization');
$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=WorkMailService.DescribeOrganization' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeOrganization' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\"\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=WorkMailService.DescribeOrganization"
payload = { "OrganizationId": "" }
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=WorkMailService.DescribeOrganization"
payload <- "{\n \"OrganizationId\": \"\"\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=WorkMailService.DescribeOrganization")
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 \"OrganizationId\": \"\"\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 \"OrganizationId\": \"\"\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=WorkMailService.DescribeOrganization";
let payload = json!({"OrganizationId": ""});
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=WorkMailService.DescribeOrganization' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": ""
}'
echo '{
"OrganizationId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeOrganization' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeOrganization'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["OrganizationId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeOrganization")! 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
DescribeResource
{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeResource
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"ResourceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeResource");
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 \"OrganizationId\": \"\",\n \"ResourceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeResource" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:ResourceId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeResource"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\"\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=WorkMailService.DescribeResource"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\"\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=WorkMailService.DescribeResource");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeResource"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 46
{
"OrganizationId": "",
"ResourceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeResource")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeResource"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\"\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 \"OrganizationId\": \"\",\n \"ResourceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeResource")
.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=WorkMailService.DescribeResource")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
ResourceId: ''
});
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=WorkMailService.DescribeResource');
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=WorkMailService.DescribeResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', ResourceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeResource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","ResourceId":""}'
};
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=WorkMailService.DescribeResource',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "ResourceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeResource")
.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({OrganizationId: '', ResourceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', ResourceId: ''},
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=WorkMailService.DescribeResource');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
ResourceId: ''
});
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=WorkMailService.DescribeResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', ResourceId: ''}
};
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=WorkMailService.DescribeResource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","ResourceId":""}'
};
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 = @{ @"OrganizationId": @"",
@"ResourceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeResource"]
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=WorkMailService.DescribeResource" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeResource",
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([
'OrganizationId' => '',
'ResourceId' => ''
]),
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=WorkMailService.DescribeResource', [
'body' => '{
"OrganizationId": "",
"ResourceId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeResource');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'ResourceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'ResourceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeResource');
$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=WorkMailService.DescribeResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"ResourceId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"ResourceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\"\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=WorkMailService.DescribeResource"
payload = {
"OrganizationId": "",
"ResourceId": ""
}
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=WorkMailService.DescribeResource"
payload <- "{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\"\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=WorkMailService.DescribeResource")
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 \"OrganizationId\": \"\",\n \"ResourceId\": \"\"\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 \"OrganizationId\": \"\",\n \"ResourceId\": \"\"\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=WorkMailService.DescribeResource";
let payload = json!({
"OrganizationId": "",
"ResourceId": ""
});
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=WorkMailService.DescribeResource' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"ResourceId": ""
}'
echo '{
"OrganizationId": "",
"ResourceId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeResource' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "ResourceId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeResource'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"ResourceId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeResource")! 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
DescribeUser
{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeUser
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"UserId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeUser");
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 \"OrganizationId\": \"\",\n \"UserId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeUser" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:UserId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeUser"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\"\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=WorkMailService.DescribeUser"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\"\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=WorkMailService.DescribeUser");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeUser"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 42
{
"OrganizationId": "",
"UserId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeUser")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeUser"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\"\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 \"OrganizationId\": \"\",\n \"UserId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeUser")
.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=WorkMailService.DescribeUser")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
UserId: ''
});
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=WorkMailService.DescribeUser');
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=WorkMailService.DescribeUser',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', UserId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeUser';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","UserId":""}'
};
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=WorkMailService.DescribeUser',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "UserId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeUser")
.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({OrganizationId: '', UserId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeUser',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', UserId: ''},
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=WorkMailService.DescribeUser');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
UserId: ''
});
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=WorkMailService.DescribeUser',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', UserId: ''}
};
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=WorkMailService.DescribeUser';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","UserId":""}'
};
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 = @{ @"OrganizationId": @"",
@"UserId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeUser"]
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=WorkMailService.DescribeUser" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeUser",
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([
'OrganizationId' => '',
'UserId' => ''
]),
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=WorkMailService.DescribeUser', [
'body' => '{
"OrganizationId": "",
"UserId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeUser');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'UserId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'UserId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeUser');
$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=WorkMailService.DescribeUser' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"UserId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeUser' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"UserId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\"\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=WorkMailService.DescribeUser"
payload = {
"OrganizationId": "",
"UserId": ""
}
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=WorkMailService.DescribeUser"
payload <- "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\"\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=WorkMailService.DescribeUser")
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 \"OrganizationId\": \"\",\n \"UserId\": \"\"\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 \"OrganizationId\": \"\",\n \"UserId\": \"\"\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=WorkMailService.DescribeUser";
let payload = json!({
"OrganizationId": "",
"UserId": ""
});
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=WorkMailService.DescribeUser' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"UserId": ""
}'
echo '{
"OrganizationId": "",
"UserId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeUser' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "UserId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeUser'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"UserId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.DescribeUser")! 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
DisassociateDelegateFromResource
{{baseUrl}}/#X-Amz-Target=WorkMailService.DisassociateDelegateFromResource
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"ResourceId": "",
"EntityId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.DisassociateDelegateFromResource");
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 \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"EntityId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.DisassociateDelegateFromResource" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:ResourceId ""
:EntityId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.DisassociateDelegateFromResource"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"EntityId\": \"\"\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=WorkMailService.DisassociateDelegateFromResource"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"EntityId\": \"\"\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=WorkMailService.DisassociateDelegateFromResource");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"EntityId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.DisassociateDelegateFromResource"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"EntityId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 64
{
"OrganizationId": "",
"ResourceId": "",
"EntityId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.DisassociateDelegateFromResource")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"EntityId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.DisassociateDelegateFromResource"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"EntityId\": \"\"\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 \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"EntityId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DisassociateDelegateFromResource")
.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=WorkMailService.DisassociateDelegateFromResource")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"EntityId\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
ResourceId: '',
EntityId: ''
});
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=WorkMailService.DisassociateDelegateFromResource');
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=WorkMailService.DisassociateDelegateFromResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', ResourceId: '', EntityId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.DisassociateDelegateFromResource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","ResourceId":"","EntityId":""}'
};
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=WorkMailService.DisassociateDelegateFromResource',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "ResourceId": "",\n "EntityId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"EntityId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DisassociateDelegateFromResource")
.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({OrganizationId: '', ResourceId: '', EntityId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.DisassociateDelegateFromResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', ResourceId: '', EntityId: ''},
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=WorkMailService.DisassociateDelegateFromResource');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
ResourceId: '',
EntityId: ''
});
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=WorkMailService.DisassociateDelegateFromResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', ResourceId: '', EntityId: ''}
};
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=WorkMailService.DisassociateDelegateFromResource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","ResourceId":"","EntityId":""}'
};
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 = @{ @"OrganizationId": @"",
@"ResourceId": @"",
@"EntityId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.DisassociateDelegateFromResource"]
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=WorkMailService.DisassociateDelegateFromResource" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"EntityId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.DisassociateDelegateFromResource",
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([
'OrganizationId' => '',
'ResourceId' => '',
'EntityId' => ''
]),
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=WorkMailService.DisassociateDelegateFromResource', [
'body' => '{
"OrganizationId": "",
"ResourceId": "",
"EntityId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DisassociateDelegateFromResource');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'ResourceId' => '',
'EntityId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'ResourceId' => '',
'EntityId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DisassociateDelegateFromResource');
$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=WorkMailService.DisassociateDelegateFromResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"ResourceId": "",
"EntityId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.DisassociateDelegateFromResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"ResourceId": "",
"EntityId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"EntityId\": \"\"\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=WorkMailService.DisassociateDelegateFromResource"
payload = {
"OrganizationId": "",
"ResourceId": "",
"EntityId": ""
}
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=WorkMailService.DisassociateDelegateFromResource"
payload <- "{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"EntityId\": \"\"\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=WorkMailService.DisassociateDelegateFromResource")
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 \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"EntityId\": \"\"\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 \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"EntityId\": \"\"\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=WorkMailService.DisassociateDelegateFromResource";
let payload = json!({
"OrganizationId": "",
"ResourceId": "",
"EntityId": ""
});
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=WorkMailService.DisassociateDelegateFromResource' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"ResourceId": "",
"EntityId": ""
}'
echo '{
"OrganizationId": "",
"ResourceId": "",
"EntityId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.DisassociateDelegateFromResource' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "ResourceId": "",\n "EntityId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.DisassociateDelegateFromResource'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"ResourceId": "",
"EntityId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.DisassociateDelegateFromResource")! 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
DisassociateMemberFromGroup
{{baseUrl}}/#X-Amz-Target=WorkMailService.DisassociateMemberFromGroup
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"GroupId": "",
"MemberId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.DisassociateMemberFromGroup");
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 \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"MemberId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.DisassociateMemberFromGroup" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:GroupId ""
:MemberId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.DisassociateMemberFromGroup"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"MemberId\": \"\"\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=WorkMailService.DisassociateMemberFromGroup"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"MemberId\": \"\"\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=WorkMailService.DisassociateMemberFromGroup");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"MemberId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.DisassociateMemberFromGroup"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"MemberId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 61
{
"OrganizationId": "",
"GroupId": "",
"MemberId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.DisassociateMemberFromGroup")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"MemberId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.DisassociateMemberFromGroup"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"MemberId\": \"\"\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 \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"MemberId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DisassociateMemberFromGroup")
.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=WorkMailService.DisassociateMemberFromGroup")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"MemberId\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
GroupId: '',
MemberId: ''
});
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=WorkMailService.DisassociateMemberFromGroup');
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=WorkMailService.DisassociateMemberFromGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', GroupId: '', MemberId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.DisassociateMemberFromGroup';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","GroupId":"","MemberId":""}'
};
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=WorkMailService.DisassociateMemberFromGroup',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "GroupId": "",\n "MemberId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"MemberId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.DisassociateMemberFromGroup")
.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({OrganizationId: '', GroupId: '', MemberId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.DisassociateMemberFromGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', GroupId: '', MemberId: ''},
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=WorkMailService.DisassociateMemberFromGroup');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
GroupId: '',
MemberId: ''
});
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=WorkMailService.DisassociateMemberFromGroup',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', GroupId: '', MemberId: ''}
};
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=WorkMailService.DisassociateMemberFromGroup';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","GroupId":"","MemberId":""}'
};
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 = @{ @"OrganizationId": @"",
@"GroupId": @"",
@"MemberId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.DisassociateMemberFromGroup"]
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=WorkMailService.DisassociateMemberFromGroup" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"MemberId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.DisassociateMemberFromGroup",
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([
'OrganizationId' => '',
'GroupId' => '',
'MemberId' => ''
]),
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=WorkMailService.DisassociateMemberFromGroup', [
'body' => '{
"OrganizationId": "",
"GroupId": "",
"MemberId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DisassociateMemberFromGroup');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'GroupId' => '',
'MemberId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'GroupId' => '',
'MemberId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.DisassociateMemberFromGroup');
$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=WorkMailService.DisassociateMemberFromGroup' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"GroupId": "",
"MemberId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.DisassociateMemberFromGroup' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"GroupId": "",
"MemberId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"MemberId\": \"\"\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=WorkMailService.DisassociateMemberFromGroup"
payload = {
"OrganizationId": "",
"GroupId": "",
"MemberId": ""
}
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=WorkMailService.DisassociateMemberFromGroup"
payload <- "{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"MemberId\": \"\"\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=WorkMailService.DisassociateMemberFromGroup")
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 \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"MemberId\": \"\"\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 \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"MemberId\": \"\"\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=WorkMailService.DisassociateMemberFromGroup";
let payload = json!({
"OrganizationId": "",
"GroupId": "",
"MemberId": ""
});
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=WorkMailService.DisassociateMemberFromGroup' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"GroupId": "",
"MemberId": ""
}'
echo '{
"OrganizationId": "",
"GroupId": "",
"MemberId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.DisassociateMemberFromGroup' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "GroupId": "",\n "MemberId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.DisassociateMemberFromGroup'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"GroupId": "",
"MemberId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.DisassociateMemberFromGroup")! 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
GetAccessControlEffect
{{baseUrl}}/#X-Amz-Target=WorkMailService.GetAccessControlEffect
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"IpAddress": "",
"Action": "",
"UserId": "",
"ImpersonationRoleId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetAccessControlEffect");
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 \"OrganizationId\": \"\",\n \"IpAddress\": \"\",\n \"Action\": \"\",\n \"UserId\": \"\",\n \"ImpersonationRoleId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetAccessControlEffect" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:IpAddress ""
:Action ""
:UserId ""
:ImpersonationRoleId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetAccessControlEffect"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"IpAddress\": \"\",\n \"Action\": \"\",\n \"UserId\": \"\",\n \"ImpersonationRoleId\": \"\"\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=WorkMailService.GetAccessControlEffect"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"IpAddress\": \"\",\n \"Action\": \"\",\n \"UserId\": \"\",\n \"ImpersonationRoleId\": \"\"\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=WorkMailService.GetAccessControlEffect");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"IpAddress\": \"\",\n \"Action\": \"\",\n \"UserId\": \"\",\n \"ImpersonationRoleId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetAccessControlEffect"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"IpAddress\": \"\",\n \"Action\": \"\",\n \"UserId\": \"\",\n \"ImpersonationRoleId\": \"\"\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: 106
{
"OrganizationId": "",
"IpAddress": "",
"Action": "",
"UserId": "",
"ImpersonationRoleId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetAccessControlEffect")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"IpAddress\": \"\",\n \"Action\": \"\",\n \"UserId\": \"\",\n \"ImpersonationRoleId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.GetAccessControlEffect"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"IpAddress\": \"\",\n \"Action\": \"\",\n \"UserId\": \"\",\n \"ImpersonationRoleId\": \"\"\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 \"OrganizationId\": \"\",\n \"IpAddress\": \"\",\n \"Action\": \"\",\n \"UserId\": \"\",\n \"ImpersonationRoleId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.GetAccessControlEffect")
.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=WorkMailService.GetAccessControlEffect")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"IpAddress\": \"\",\n \"Action\": \"\",\n \"UserId\": \"\",\n \"ImpersonationRoleId\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
IpAddress: '',
Action: '',
UserId: '',
ImpersonationRoleId: ''
});
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=WorkMailService.GetAccessControlEffect');
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=WorkMailService.GetAccessControlEffect',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
OrganizationId: '',
IpAddress: '',
Action: '',
UserId: '',
ImpersonationRoleId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetAccessControlEffect';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","IpAddress":"","Action":"","UserId":"","ImpersonationRoleId":""}'
};
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=WorkMailService.GetAccessControlEffect',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "IpAddress": "",\n "Action": "",\n "UserId": "",\n "ImpersonationRoleId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"IpAddress\": \"\",\n \"Action\": \"\",\n \"UserId\": \"\",\n \"ImpersonationRoleId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.GetAccessControlEffect")
.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({
OrganizationId: '',
IpAddress: '',
Action: '',
UserId: '',
ImpersonationRoleId: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetAccessControlEffect',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
OrganizationId: '',
IpAddress: '',
Action: '',
UserId: '',
ImpersonationRoleId: ''
},
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=WorkMailService.GetAccessControlEffect');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
IpAddress: '',
Action: '',
UserId: '',
ImpersonationRoleId: ''
});
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=WorkMailService.GetAccessControlEffect',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
OrganizationId: '',
IpAddress: '',
Action: '',
UserId: '',
ImpersonationRoleId: ''
}
};
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=WorkMailService.GetAccessControlEffect';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","IpAddress":"","Action":"","UserId":"","ImpersonationRoleId":""}'
};
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 = @{ @"OrganizationId": @"",
@"IpAddress": @"",
@"Action": @"",
@"UserId": @"",
@"ImpersonationRoleId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.GetAccessControlEffect"]
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=WorkMailService.GetAccessControlEffect" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"IpAddress\": \"\",\n \"Action\": \"\",\n \"UserId\": \"\",\n \"ImpersonationRoleId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.GetAccessControlEffect",
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([
'OrganizationId' => '',
'IpAddress' => '',
'Action' => '',
'UserId' => '',
'ImpersonationRoleId' => ''
]),
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=WorkMailService.GetAccessControlEffect', [
'body' => '{
"OrganizationId": "",
"IpAddress": "",
"Action": "",
"UserId": "",
"ImpersonationRoleId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.GetAccessControlEffect');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'IpAddress' => '',
'Action' => '',
'UserId' => '',
'ImpersonationRoleId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'IpAddress' => '',
'Action' => '',
'UserId' => '',
'ImpersonationRoleId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.GetAccessControlEffect');
$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=WorkMailService.GetAccessControlEffect' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"IpAddress": "",
"Action": "",
"UserId": "",
"ImpersonationRoleId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetAccessControlEffect' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"IpAddress": "",
"Action": "",
"UserId": "",
"ImpersonationRoleId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"IpAddress\": \"\",\n \"Action\": \"\",\n \"UserId\": \"\",\n \"ImpersonationRoleId\": \"\"\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=WorkMailService.GetAccessControlEffect"
payload = {
"OrganizationId": "",
"IpAddress": "",
"Action": "",
"UserId": "",
"ImpersonationRoleId": ""
}
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=WorkMailService.GetAccessControlEffect"
payload <- "{\n \"OrganizationId\": \"\",\n \"IpAddress\": \"\",\n \"Action\": \"\",\n \"UserId\": \"\",\n \"ImpersonationRoleId\": \"\"\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=WorkMailService.GetAccessControlEffect")
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 \"OrganizationId\": \"\",\n \"IpAddress\": \"\",\n \"Action\": \"\",\n \"UserId\": \"\",\n \"ImpersonationRoleId\": \"\"\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 \"OrganizationId\": \"\",\n \"IpAddress\": \"\",\n \"Action\": \"\",\n \"UserId\": \"\",\n \"ImpersonationRoleId\": \"\"\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=WorkMailService.GetAccessControlEffect";
let payload = json!({
"OrganizationId": "",
"IpAddress": "",
"Action": "",
"UserId": "",
"ImpersonationRoleId": ""
});
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=WorkMailService.GetAccessControlEffect' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"IpAddress": "",
"Action": "",
"UserId": "",
"ImpersonationRoleId": ""
}'
echo '{
"OrganizationId": "",
"IpAddress": "",
"Action": "",
"UserId": "",
"ImpersonationRoleId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetAccessControlEffect' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "IpAddress": "",\n "Action": "",\n "UserId": "",\n "ImpersonationRoleId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetAccessControlEffect'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"IpAddress": "",
"Action": "",
"UserId": "",
"ImpersonationRoleId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetAccessControlEffect")! 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
GetDefaultRetentionPolicy
{{baseUrl}}/#X-Amz-Target=WorkMailService.GetDefaultRetentionPolicy
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetDefaultRetentionPolicy");
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 \"OrganizationId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetDefaultRetentionPolicy" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetDefaultRetentionPolicy"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\"\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=WorkMailService.GetDefaultRetentionPolicy"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\"\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=WorkMailService.GetDefaultRetentionPolicy");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetDefaultRetentionPolicy"
payload := strings.NewReader("{\n \"OrganizationId\": \"\"\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
{
"OrganizationId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetDefaultRetentionPolicy")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.GetDefaultRetentionPolicy"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\"\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 \"OrganizationId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.GetDefaultRetentionPolicy")
.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=WorkMailService.GetDefaultRetentionPolicy")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: ''
});
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=WorkMailService.GetDefaultRetentionPolicy');
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=WorkMailService.GetDefaultRetentionPolicy',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetDefaultRetentionPolicy';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":""}'
};
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=WorkMailService.GetDefaultRetentionPolicy',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.GetDefaultRetentionPolicy")
.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({OrganizationId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetDefaultRetentionPolicy',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: ''},
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=WorkMailService.GetDefaultRetentionPolicy');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: ''
});
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=WorkMailService.GetDefaultRetentionPolicy',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: ''}
};
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=WorkMailService.GetDefaultRetentionPolicy';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":""}'
};
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 = @{ @"OrganizationId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.GetDefaultRetentionPolicy"]
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=WorkMailService.GetDefaultRetentionPolicy" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.GetDefaultRetentionPolicy",
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([
'OrganizationId' => ''
]),
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=WorkMailService.GetDefaultRetentionPolicy', [
'body' => '{
"OrganizationId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.GetDefaultRetentionPolicy');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.GetDefaultRetentionPolicy');
$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=WorkMailService.GetDefaultRetentionPolicy' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetDefaultRetentionPolicy' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\"\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=WorkMailService.GetDefaultRetentionPolicy"
payload = { "OrganizationId": "" }
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=WorkMailService.GetDefaultRetentionPolicy"
payload <- "{\n \"OrganizationId\": \"\"\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=WorkMailService.GetDefaultRetentionPolicy")
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 \"OrganizationId\": \"\"\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 \"OrganizationId\": \"\"\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=WorkMailService.GetDefaultRetentionPolicy";
let payload = json!({"OrganizationId": ""});
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=WorkMailService.GetDefaultRetentionPolicy' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": ""
}'
echo '{
"OrganizationId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetDefaultRetentionPolicy' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetDefaultRetentionPolicy'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["OrganizationId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetDefaultRetentionPolicy")! 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
GetImpersonationRole
{{baseUrl}}/#X-Amz-Target=WorkMailService.GetImpersonationRole
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"ImpersonationRoleId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetImpersonationRole");
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 \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetImpersonationRole" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:ImpersonationRoleId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetImpersonationRole"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\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=WorkMailService.GetImpersonationRole"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\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=WorkMailService.GetImpersonationRole");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetImpersonationRole"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\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: 55
{
"OrganizationId": "",
"ImpersonationRoleId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetImpersonationRole")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.GetImpersonationRole"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\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 \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.GetImpersonationRole")
.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=WorkMailService.GetImpersonationRole")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
ImpersonationRoleId: ''
});
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=WorkMailService.GetImpersonationRole');
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=WorkMailService.GetImpersonationRole',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', ImpersonationRoleId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetImpersonationRole';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","ImpersonationRoleId":""}'
};
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=WorkMailService.GetImpersonationRole',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "ImpersonationRoleId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.GetImpersonationRole")
.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({OrganizationId: '', ImpersonationRoleId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetImpersonationRole',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', ImpersonationRoleId: ''},
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=WorkMailService.GetImpersonationRole');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
ImpersonationRoleId: ''
});
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=WorkMailService.GetImpersonationRole',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', ImpersonationRoleId: ''}
};
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=WorkMailService.GetImpersonationRole';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","ImpersonationRoleId":""}'
};
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 = @{ @"OrganizationId": @"",
@"ImpersonationRoleId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.GetImpersonationRole"]
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=WorkMailService.GetImpersonationRole" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.GetImpersonationRole",
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([
'OrganizationId' => '',
'ImpersonationRoleId' => ''
]),
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=WorkMailService.GetImpersonationRole', [
'body' => '{
"OrganizationId": "",
"ImpersonationRoleId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.GetImpersonationRole');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'ImpersonationRoleId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'ImpersonationRoleId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.GetImpersonationRole');
$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=WorkMailService.GetImpersonationRole' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"ImpersonationRoleId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetImpersonationRole' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"ImpersonationRoleId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\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=WorkMailService.GetImpersonationRole"
payload = {
"OrganizationId": "",
"ImpersonationRoleId": ""
}
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=WorkMailService.GetImpersonationRole"
payload <- "{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\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=WorkMailService.GetImpersonationRole")
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 \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\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 \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\"\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=WorkMailService.GetImpersonationRole";
let payload = json!({
"OrganizationId": "",
"ImpersonationRoleId": ""
});
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=WorkMailService.GetImpersonationRole' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"ImpersonationRoleId": ""
}'
echo '{
"OrganizationId": "",
"ImpersonationRoleId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetImpersonationRole' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "ImpersonationRoleId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetImpersonationRole'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"ImpersonationRoleId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetImpersonationRole")! 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
GetImpersonationRoleEffect
{{baseUrl}}/#X-Amz-Target=WorkMailService.GetImpersonationRoleEffect
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"ImpersonationRoleId": "",
"TargetUser": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetImpersonationRoleEffect");
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 \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\",\n \"TargetUser\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetImpersonationRoleEffect" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:ImpersonationRoleId ""
:TargetUser ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetImpersonationRoleEffect"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\",\n \"TargetUser\": \"\"\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=WorkMailService.GetImpersonationRoleEffect"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\",\n \"TargetUser\": \"\"\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=WorkMailService.GetImpersonationRoleEffect");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\",\n \"TargetUser\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetImpersonationRoleEffect"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\",\n \"TargetUser\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 75
{
"OrganizationId": "",
"ImpersonationRoleId": "",
"TargetUser": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetImpersonationRoleEffect")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\",\n \"TargetUser\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.GetImpersonationRoleEffect"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\",\n \"TargetUser\": \"\"\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 \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\",\n \"TargetUser\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.GetImpersonationRoleEffect")
.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=WorkMailService.GetImpersonationRoleEffect")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\",\n \"TargetUser\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
ImpersonationRoleId: '',
TargetUser: ''
});
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=WorkMailService.GetImpersonationRoleEffect');
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=WorkMailService.GetImpersonationRoleEffect',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', ImpersonationRoleId: '', TargetUser: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetImpersonationRoleEffect';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","ImpersonationRoleId":"","TargetUser":""}'
};
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=WorkMailService.GetImpersonationRoleEffect',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "ImpersonationRoleId": "",\n "TargetUser": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\",\n \"TargetUser\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.GetImpersonationRoleEffect")
.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({OrganizationId: '', ImpersonationRoleId: '', TargetUser: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetImpersonationRoleEffect',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', ImpersonationRoleId: '', TargetUser: ''},
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=WorkMailService.GetImpersonationRoleEffect');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
ImpersonationRoleId: '',
TargetUser: ''
});
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=WorkMailService.GetImpersonationRoleEffect',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', ImpersonationRoleId: '', TargetUser: ''}
};
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=WorkMailService.GetImpersonationRoleEffect';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","ImpersonationRoleId":"","TargetUser":""}'
};
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 = @{ @"OrganizationId": @"",
@"ImpersonationRoleId": @"",
@"TargetUser": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.GetImpersonationRoleEffect"]
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=WorkMailService.GetImpersonationRoleEffect" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\",\n \"TargetUser\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.GetImpersonationRoleEffect",
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([
'OrganizationId' => '',
'ImpersonationRoleId' => '',
'TargetUser' => ''
]),
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=WorkMailService.GetImpersonationRoleEffect', [
'body' => '{
"OrganizationId": "",
"ImpersonationRoleId": "",
"TargetUser": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.GetImpersonationRoleEffect');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'ImpersonationRoleId' => '',
'TargetUser' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'ImpersonationRoleId' => '',
'TargetUser' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.GetImpersonationRoleEffect');
$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=WorkMailService.GetImpersonationRoleEffect' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"ImpersonationRoleId": "",
"TargetUser": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetImpersonationRoleEffect' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"ImpersonationRoleId": "",
"TargetUser": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\",\n \"TargetUser\": \"\"\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=WorkMailService.GetImpersonationRoleEffect"
payload = {
"OrganizationId": "",
"ImpersonationRoleId": "",
"TargetUser": ""
}
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=WorkMailService.GetImpersonationRoleEffect"
payload <- "{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\",\n \"TargetUser\": \"\"\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=WorkMailService.GetImpersonationRoleEffect")
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 \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\",\n \"TargetUser\": \"\"\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 \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\",\n \"TargetUser\": \"\"\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=WorkMailService.GetImpersonationRoleEffect";
let payload = json!({
"OrganizationId": "",
"ImpersonationRoleId": "",
"TargetUser": ""
});
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=WorkMailService.GetImpersonationRoleEffect' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"ImpersonationRoleId": "",
"TargetUser": ""
}'
echo '{
"OrganizationId": "",
"ImpersonationRoleId": "",
"TargetUser": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetImpersonationRoleEffect' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "ImpersonationRoleId": "",\n "TargetUser": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetImpersonationRoleEffect'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"ImpersonationRoleId": "",
"TargetUser": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetImpersonationRoleEffect")! 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
GetMailDomain
{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMailDomain
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"DomainName": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMailDomain");
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 \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMailDomain" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:DomainName ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMailDomain"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\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=WorkMailService.GetMailDomain"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\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=WorkMailService.GetMailDomain");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMailDomain"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 46
{
"OrganizationId": "",
"DomainName": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMailDomain")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMailDomain"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\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 \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMailDomain")
.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=WorkMailService.GetMailDomain")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
DomainName: ''
});
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=WorkMailService.GetMailDomain');
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=WorkMailService.GetMailDomain',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', DomainName: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMailDomain';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","DomainName":""}'
};
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=WorkMailService.GetMailDomain',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "DomainName": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMailDomain")
.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({OrganizationId: '', DomainName: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMailDomain',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', DomainName: ''},
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=WorkMailService.GetMailDomain');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
DomainName: ''
});
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=WorkMailService.GetMailDomain',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', DomainName: ''}
};
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=WorkMailService.GetMailDomain';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","DomainName":""}'
};
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 = @{ @"OrganizationId": @"",
@"DomainName": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMailDomain"]
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=WorkMailService.GetMailDomain" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMailDomain",
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([
'OrganizationId' => '',
'DomainName' => ''
]),
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=WorkMailService.GetMailDomain', [
'body' => '{
"OrganizationId": "",
"DomainName": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMailDomain');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'DomainName' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'DomainName' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMailDomain');
$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=WorkMailService.GetMailDomain' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"DomainName": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMailDomain' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"DomainName": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\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=WorkMailService.GetMailDomain"
payload = {
"OrganizationId": "",
"DomainName": ""
}
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=WorkMailService.GetMailDomain"
payload <- "{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\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=WorkMailService.GetMailDomain")
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 \"OrganizationId\": \"\",\n \"DomainName\": \"\"\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 \"OrganizationId\": \"\",\n \"DomainName\": \"\"\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=WorkMailService.GetMailDomain";
let payload = json!({
"OrganizationId": "",
"DomainName": ""
});
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=WorkMailService.GetMailDomain' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"DomainName": ""
}'
echo '{
"OrganizationId": "",
"DomainName": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMailDomain' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "DomainName": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMailDomain'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"DomainName": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMailDomain")! 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
GetMailboxDetails
{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMailboxDetails
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"UserId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMailboxDetails");
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 \"OrganizationId\": \"\",\n \"UserId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMailboxDetails" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:UserId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMailboxDetails"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\"\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=WorkMailService.GetMailboxDetails"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\"\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=WorkMailService.GetMailboxDetails");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMailboxDetails"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 42
{
"OrganizationId": "",
"UserId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMailboxDetails")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMailboxDetails"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\"\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 \"OrganizationId\": \"\",\n \"UserId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMailboxDetails")
.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=WorkMailService.GetMailboxDetails")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
UserId: ''
});
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=WorkMailService.GetMailboxDetails');
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=WorkMailService.GetMailboxDetails',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', UserId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMailboxDetails';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","UserId":""}'
};
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=WorkMailService.GetMailboxDetails',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "UserId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMailboxDetails")
.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({OrganizationId: '', UserId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMailboxDetails',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', UserId: ''},
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=WorkMailService.GetMailboxDetails');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
UserId: ''
});
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=WorkMailService.GetMailboxDetails',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', UserId: ''}
};
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=WorkMailService.GetMailboxDetails';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","UserId":""}'
};
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 = @{ @"OrganizationId": @"",
@"UserId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMailboxDetails"]
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=WorkMailService.GetMailboxDetails" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMailboxDetails",
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([
'OrganizationId' => '',
'UserId' => ''
]),
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=WorkMailService.GetMailboxDetails', [
'body' => '{
"OrganizationId": "",
"UserId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMailboxDetails');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'UserId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'UserId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMailboxDetails');
$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=WorkMailService.GetMailboxDetails' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"UserId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMailboxDetails' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"UserId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\"\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=WorkMailService.GetMailboxDetails"
payload = {
"OrganizationId": "",
"UserId": ""
}
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=WorkMailService.GetMailboxDetails"
payload <- "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\"\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=WorkMailService.GetMailboxDetails")
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 \"OrganizationId\": \"\",\n \"UserId\": \"\"\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 \"OrganizationId\": \"\",\n \"UserId\": \"\"\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=WorkMailService.GetMailboxDetails";
let payload = json!({
"OrganizationId": "",
"UserId": ""
});
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=WorkMailService.GetMailboxDetails' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"UserId": ""
}'
echo '{
"OrganizationId": "",
"UserId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMailboxDetails' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "UserId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMailboxDetails'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"UserId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMailboxDetails")! 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
GetMobileDeviceAccessEffect
{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMobileDeviceAccessEffect
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"DeviceType": "",
"DeviceModel": "",
"DeviceOperatingSystem": "",
"DeviceUserAgent": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMobileDeviceAccessEffect");
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 \"OrganizationId\": \"\",\n \"DeviceType\": \"\",\n \"DeviceModel\": \"\",\n \"DeviceOperatingSystem\": \"\",\n \"DeviceUserAgent\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMobileDeviceAccessEffect" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:DeviceType ""
:DeviceModel ""
:DeviceOperatingSystem ""
:DeviceUserAgent ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMobileDeviceAccessEffect"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"DeviceType\": \"\",\n \"DeviceModel\": \"\",\n \"DeviceOperatingSystem\": \"\",\n \"DeviceUserAgent\": \"\"\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=WorkMailService.GetMobileDeviceAccessEffect"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"DeviceType\": \"\",\n \"DeviceModel\": \"\",\n \"DeviceOperatingSystem\": \"\",\n \"DeviceUserAgent\": \"\"\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=WorkMailService.GetMobileDeviceAccessEffect");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"DeviceType\": \"\",\n \"DeviceModel\": \"\",\n \"DeviceOperatingSystem\": \"\",\n \"DeviceUserAgent\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMobileDeviceAccessEffect"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"DeviceType\": \"\",\n \"DeviceModel\": \"\",\n \"DeviceOperatingSystem\": \"\",\n \"DeviceUserAgent\": \"\"\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: 123
{
"OrganizationId": "",
"DeviceType": "",
"DeviceModel": "",
"DeviceOperatingSystem": "",
"DeviceUserAgent": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMobileDeviceAccessEffect")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"DeviceType\": \"\",\n \"DeviceModel\": \"\",\n \"DeviceOperatingSystem\": \"\",\n \"DeviceUserAgent\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMobileDeviceAccessEffect"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"DeviceType\": \"\",\n \"DeviceModel\": \"\",\n \"DeviceOperatingSystem\": \"\",\n \"DeviceUserAgent\": \"\"\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 \"OrganizationId\": \"\",\n \"DeviceType\": \"\",\n \"DeviceModel\": \"\",\n \"DeviceOperatingSystem\": \"\",\n \"DeviceUserAgent\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMobileDeviceAccessEffect")
.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=WorkMailService.GetMobileDeviceAccessEffect")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"DeviceType\": \"\",\n \"DeviceModel\": \"\",\n \"DeviceOperatingSystem\": \"\",\n \"DeviceUserAgent\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
DeviceType: '',
DeviceModel: '',
DeviceOperatingSystem: '',
DeviceUserAgent: ''
});
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=WorkMailService.GetMobileDeviceAccessEffect');
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=WorkMailService.GetMobileDeviceAccessEffect',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
OrganizationId: '',
DeviceType: '',
DeviceModel: '',
DeviceOperatingSystem: '',
DeviceUserAgent: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMobileDeviceAccessEffect';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","DeviceType":"","DeviceModel":"","DeviceOperatingSystem":"","DeviceUserAgent":""}'
};
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=WorkMailService.GetMobileDeviceAccessEffect',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "DeviceType": "",\n "DeviceModel": "",\n "DeviceOperatingSystem": "",\n "DeviceUserAgent": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"DeviceType\": \"\",\n \"DeviceModel\": \"\",\n \"DeviceOperatingSystem\": \"\",\n \"DeviceUserAgent\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMobileDeviceAccessEffect")
.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({
OrganizationId: '',
DeviceType: '',
DeviceModel: '',
DeviceOperatingSystem: '',
DeviceUserAgent: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMobileDeviceAccessEffect',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
OrganizationId: '',
DeviceType: '',
DeviceModel: '',
DeviceOperatingSystem: '',
DeviceUserAgent: ''
},
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=WorkMailService.GetMobileDeviceAccessEffect');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
DeviceType: '',
DeviceModel: '',
DeviceOperatingSystem: '',
DeviceUserAgent: ''
});
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=WorkMailService.GetMobileDeviceAccessEffect',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
OrganizationId: '',
DeviceType: '',
DeviceModel: '',
DeviceOperatingSystem: '',
DeviceUserAgent: ''
}
};
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=WorkMailService.GetMobileDeviceAccessEffect';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","DeviceType":"","DeviceModel":"","DeviceOperatingSystem":"","DeviceUserAgent":""}'
};
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 = @{ @"OrganizationId": @"",
@"DeviceType": @"",
@"DeviceModel": @"",
@"DeviceOperatingSystem": @"",
@"DeviceUserAgent": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMobileDeviceAccessEffect"]
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=WorkMailService.GetMobileDeviceAccessEffect" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"DeviceType\": \"\",\n \"DeviceModel\": \"\",\n \"DeviceOperatingSystem\": \"\",\n \"DeviceUserAgent\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMobileDeviceAccessEffect",
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([
'OrganizationId' => '',
'DeviceType' => '',
'DeviceModel' => '',
'DeviceOperatingSystem' => '',
'DeviceUserAgent' => ''
]),
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=WorkMailService.GetMobileDeviceAccessEffect', [
'body' => '{
"OrganizationId": "",
"DeviceType": "",
"DeviceModel": "",
"DeviceOperatingSystem": "",
"DeviceUserAgent": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMobileDeviceAccessEffect');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'DeviceType' => '',
'DeviceModel' => '',
'DeviceOperatingSystem' => '',
'DeviceUserAgent' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'DeviceType' => '',
'DeviceModel' => '',
'DeviceOperatingSystem' => '',
'DeviceUserAgent' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMobileDeviceAccessEffect');
$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=WorkMailService.GetMobileDeviceAccessEffect' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"DeviceType": "",
"DeviceModel": "",
"DeviceOperatingSystem": "",
"DeviceUserAgent": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMobileDeviceAccessEffect' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"DeviceType": "",
"DeviceModel": "",
"DeviceOperatingSystem": "",
"DeviceUserAgent": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"DeviceType\": \"\",\n \"DeviceModel\": \"\",\n \"DeviceOperatingSystem\": \"\",\n \"DeviceUserAgent\": \"\"\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=WorkMailService.GetMobileDeviceAccessEffect"
payload = {
"OrganizationId": "",
"DeviceType": "",
"DeviceModel": "",
"DeviceOperatingSystem": "",
"DeviceUserAgent": ""
}
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=WorkMailService.GetMobileDeviceAccessEffect"
payload <- "{\n \"OrganizationId\": \"\",\n \"DeviceType\": \"\",\n \"DeviceModel\": \"\",\n \"DeviceOperatingSystem\": \"\",\n \"DeviceUserAgent\": \"\"\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=WorkMailService.GetMobileDeviceAccessEffect")
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 \"OrganizationId\": \"\",\n \"DeviceType\": \"\",\n \"DeviceModel\": \"\",\n \"DeviceOperatingSystem\": \"\",\n \"DeviceUserAgent\": \"\"\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 \"OrganizationId\": \"\",\n \"DeviceType\": \"\",\n \"DeviceModel\": \"\",\n \"DeviceOperatingSystem\": \"\",\n \"DeviceUserAgent\": \"\"\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=WorkMailService.GetMobileDeviceAccessEffect";
let payload = json!({
"OrganizationId": "",
"DeviceType": "",
"DeviceModel": "",
"DeviceOperatingSystem": "",
"DeviceUserAgent": ""
});
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=WorkMailService.GetMobileDeviceAccessEffect' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"DeviceType": "",
"DeviceModel": "",
"DeviceOperatingSystem": "",
"DeviceUserAgent": ""
}'
echo '{
"OrganizationId": "",
"DeviceType": "",
"DeviceModel": "",
"DeviceOperatingSystem": "",
"DeviceUserAgent": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMobileDeviceAccessEffect' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "DeviceType": "",\n "DeviceModel": "",\n "DeviceOperatingSystem": "",\n "DeviceUserAgent": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMobileDeviceAccessEffect'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"DeviceType": "",
"DeviceModel": "",
"DeviceOperatingSystem": "",
"DeviceUserAgent": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMobileDeviceAccessEffect")! 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
GetMobileDeviceAccessOverride
{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMobileDeviceAccessOverride
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"UserId": "",
"DeviceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMobileDeviceAccessOverride");
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 \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMobileDeviceAccessOverride" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:UserId ""
:DeviceId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMobileDeviceAccessOverride"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\"\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=WorkMailService.GetMobileDeviceAccessOverride"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\"\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=WorkMailService.GetMobileDeviceAccessOverride");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMobileDeviceAccessOverride"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\"\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
{
"OrganizationId": "",
"UserId": "",
"DeviceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMobileDeviceAccessOverride")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMobileDeviceAccessOverride"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\"\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 \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMobileDeviceAccessOverride")
.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=WorkMailService.GetMobileDeviceAccessOverride")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
UserId: '',
DeviceId: ''
});
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=WorkMailService.GetMobileDeviceAccessOverride');
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=WorkMailService.GetMobileDeviceAccessOverride',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', UserId: '', DeviceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMobileDeviceAccessOverride';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","UserId":"","DeviceId":""}'
};
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=WorkMailService.GetMobileDeviceAccessOverride',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "UserId": "",\n "DeviceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMobileDeviceAccessOverride")
.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({OrganizationId: '', UserId: '', DeviceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMobileDeviceAccessOverride',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', UserId: '', DeviceId: ''},
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=WorkMailService.GetMobileDeviceAccessOverride');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
UserId: '',
DeviceId: ''
});
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=WorkMailService.GetMobileDeviceAccessOverride',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', UserId: '', DeviceId: ''}
};
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=WorkMailService.GetMobileDeviceAccessOverride';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","UserId":"","DeviceId":""}'
};
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 = @{ @"OrganizationId": @"",
@"UserId": @"",
@"DeviceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMobileDeviceAccessOverride"]
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=WorkMailService.GetMobileDeviceAccessOverride" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMobileDeviceAccessOverride",
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([
'OrganizationId' => '',
'UserId' => '',
'DeviceId' => ''
]),
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=WorkMailService.GetMobileDeviceAccessOverride', [
'body' => '{
"OrganizationId": "",
"UserId": "",
"DeviceId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMobileDeviceAccessOverride');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'UserId' => '',
'DeviceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'UserId' => '',
'DeviceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMobileDeviceAccessOverride');
$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=WorkMailService.GetMobileDeviceAccessOverride' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"UserId": "",
"DeviceId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMobileDeviceAccessOverride' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"UserId": "",
"DeviceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\"\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=WorkMailService.GetMobileDeviceAccessOverride"
payload = {
"OrganizationId": "",
"UserId": "",
"DeviceId": ""
}
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=WorkMailService.GetMobileDeviceAccessOverride"
payload <- "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\"\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=WorkMailService.GetMobileDeviceAccessOverride")
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 \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\"\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 \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\"\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=WorkMailService.GetMobileDeviceAccessOverride";
let payload = json!({
"OrganizationId": "",
"UserId": "",
"DeviceId": ""
});
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=WorkMailService.GetMobileDeviceAccessOverride' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"UserId": "",
"DeviceId": ""
}'
echo '{
"OrganizationId": "",
"UserId": "",
"DeviceId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMobileDeviceAccessOverride' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "UserId": "",\n "DeviceId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMobileDeviceAccessOverride'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"UserId": "",
"DeviceId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.GetMobileDeviceAccessOverride")! 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
ListAccessControlRules
{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAccessControlRules
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAccessControlRules");
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 \"OrganizationId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAccessControlRules" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAccessControlRules"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\"\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=WorkMailService.ListAccessControlRules"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\"\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=WorkMailService.ListAccessControlRules");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAccessControlRules"
payload := strings.NewReader("{\n \"OrganizationId\": \"\"\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
{
"OrganizationId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAccessControlRules")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAccessControlRules"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\"\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 \"OrganizationId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAccessControlRules")
.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=WorkMailService.ListAccessControlRules")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: ''
});
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=WorkMailService.ListAccessControlRules');
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=WorkMailService.ListAccessControlRules',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAccessControlRules';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":""}'
};
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=WorkMailService.ListAccessControlRules',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAccessControlRules")
.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({OrganizationId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAccessControlRules',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: ''},
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=WorkMailService.ListAccessControlRules');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: ''
});
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=WorkMailService.ListAccessControlRules',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: ''}
};
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=WorkMailService.ListAccessControlRules';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":""}'
};
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 = @{ @"OrganizationId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAccessControlRules"]
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=WorkMailService.ListAccessControlRules" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAccessControlRules",
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([
'OrganizationId' => ''
]),
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=WorkMailService.ListAccessControlRules', [
'body' => '{
"OrganizationId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAccessControlRules');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAccessControlRules');
$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=WorkMailService.ListAccessControlRules' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAccessControlRules' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\"\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=WorkMailService.ListAccessControlRules"
payload = { "OrganizationId": "" }
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=WorkMailService.ListAccessControlRules"
payload <- "{\n \"OrganizationId\": \"\"\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=WorkMailService.ListAccessControlRules")
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 \"OrganizationId\": \"\"\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 \"OrganizationId\": \"\"\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=WorkMailService.ListAccessControlRules";
let payload = json!({"OrganizationId": ""});
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=WorkMailService.ListAccessControlRules' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": ""
}'
echo '{
"OrganizationId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAccessControlRules' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAccessControlRules'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["OrganizationId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAccessControlRules")! 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
ListAliases
{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAliases
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"EntityId": "",
"NextToken": "",
"MaxResults": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAliases");
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 \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAliases" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:EntityId ""
:NextToken ""
:MaxResults ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAliases"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAliases"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAliases");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAliases"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 83
{
"OrganizationId": "",
"EntityId": "",
"NextToken": "",
"MaxResults": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAliases")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAliases"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAliases")
.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=WorkMailService.ListAliases")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
EntityId: '',
NextToken: '',
MaxResults: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAliases');
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=WorkMailService.ListAliases',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', EntityId: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAliases';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","EntityId":"","NextToken":"","MaxResults":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAliases',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "EntityId": "",\n "NextToken": "",\n "MaxResults": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAliases")
.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({OrganizationId: '', EntityId: '', NextToken: '', MaxResults: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAliases',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', EntityId: '', NextToken: '', MaxResults: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAliases');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
EntityId: '',
NextToken: '',
MaxResults: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAliases',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', EntityId: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAliases';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","EntityId":"","NextToken":"","MaxResults":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"OrganizationId": @"",
@"EntityId": @"",
@"NextToken": @"",
@"MaxResults": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAliases"]
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=WorkMailService.ListAliases" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAliases",
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([
'OrganizationId' => '',
'EntityId' => '',
'NextToken' => '',
'MaxResults' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAliases', [
'body' => '{
"OrganizationId": "",
"EntityId": "",
"NextToken": "",
"MaxResults": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAliases');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'EntityId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'EntityId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAliases');
$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=WorkMailService.ListAliases' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"EntityId": "",
"NextToken": "",
"MaxResults": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAliases' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"EntityId": "",
"NextToken": "",
"MaxResults": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAliases"
payload = {
"OrganizationId": "",
"EntityId": "",
"NextToken": "",
"MaxResults": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAliases"
payload <- "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAliases")
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 \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAliases";
let payload = json!({
"OrganizationId": "",
"EntityId": "",
"NextToken": "",
"MaxResults": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAliases' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"EntityId": "",
"NextToken": "",
"MaxResults": ""
}'
echo '{
"OrganizationId": "",
"EntityId": "",
"NextToken": "",
"MaxResults": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAliases' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "EntityId": "",\n "NextToken": "",\n "MaxResults": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAliases'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"EntityId": "",
"NextToken": "",
"MaxResults": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAliases")! 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
ListAvailabilityConfigurations
{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAvailabilityConfigurations
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"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=WorkMailService.ListAvailabilityConfigurations");
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 \"OrganizationId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAvailabilityConfigurations" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAvailabilityConfigurations"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\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=WorkMailService.ListAvailabilityConfigurations"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\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=WorkMailService.ListAvailabilityConfigurations");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\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=WorkMailService.ListAvailabilityConfigurations"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\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
{
"OrganizationId": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAvailabilityConfigurations")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\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=WorkMailService.ListAvailabilityConfigurations"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\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 \"OrganizationId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAvailabilityConfigurations")
.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=WorkMailService.ListAvailabilityConfigurations")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
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=WorkMailService.ListAvailabilityConfigurations');
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=WorkMailService.ListAvailabilityConfigurations',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAvailabilityConfigurations';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","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=WorkMailService.ListAvailabilityConfigurations',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\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 \"OrganizationId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAvailabilityConfigurations")
.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({OrganizationId: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAvailabilityConfigurations',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', 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=WorkMailService.ListAvailabilityConfigurations');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
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=WorkMailService.ListAvailabilityConfigurations',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', 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=WorkMailService.ListAvailabilityConfigurations';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","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 = @{ @"OrganizationId": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAvailabilityConfigurations"]
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=WorkMailService.ListAvailabilityConfigurations" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\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=WorkMailService.ListAvailabilityConfigurations",
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([
'OrganizationId' => '',
'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=WorkMailService.ListAvailabilityConfigurations', [
'body' => '{
"OrganizationId": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAvailabilityConfigurations');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAvailabilityConfigurations');
$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=WorkMailService.ListAvailabilityConfigurations' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAvailabilityConfigurations' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\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=WorkMailService.ListAvailabilityConfigurations"
payload = {
"OrganizationId": "",
"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=WorkMailService.ListAvailabilityConfigurations"
payload <- "{\n \"OrganizationId\": \"\",\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=WorkMailService.ListAvailabilityConfigurations")
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 \"OrganizationId\": \"\",\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 \"OrganizationId\": \"\",\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=WorkMailService.ListAvailabilityConfigurations";
let payload = json!({
"OrganizationId": "",
"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=WorkMailService.ListAvailabilityConfigurations' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"OrganizationId": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAvailabilityConfigurations' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAvailabilityConfigurations'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListAvailabilityConfigurations")! 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
ListGroupMembers
{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroupMembers
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"GroupId": "",
"NextToken": "",
"MaxResults": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroupMembers");
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 \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroupMembers" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:GroupId ""
:NextToken ""
:MaxResults ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroupMembers"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroupMembers"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroupMembers");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroupMembers"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 82
{
"OrganizationId": "",
"GroupId": "",
"NextToken": "",
"MaxResults": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroupMembers")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroupMembers"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroupMembers")
.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=WorkMailService.ListGroupMembers")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
GroupId: '',
NextToken: '',
MaxResults: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroupMembers');
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=WorkMailService.ListGroupMembers',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', GroupId: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroupMembers';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","GroupId":"","NextToken":"","MaxResults":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroupMembers',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "GroupId": "",\n "NextToken": "",\n "MaxResults": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroupMembers")
.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({OrganizationId: '', GroupId: '', NextToken: '', MaxResults: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroupMembers',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', GroupId: '', NextToken: '', MaxResults: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroupMembers');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
GroupId: '',
NextToken: '',
MaxResults: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroupMembers',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', GroupId: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroupMembers';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","GroupId":"","NextToken":"","MaxResults":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"OrganizationId": @"",
@"GroupId": @"",
@"NextToken": @"",
@"MaxResults": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroupMembers"]
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=WorkMailService.ListGroupMembers" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroupMembers",
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([
'OrganizationId' => '',
'GroupId' => '',
'NextToken' => '',
'MaxResults' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroupMembers', [
'body' => '{
"OrganizationId": "",
"GroupId": "",
"NextToken": "",
"MaxResults": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroupMembers');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'GroupId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'GroupId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroupMembers');
$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=WorkMailService.ListGroupMembers' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"GroupId": "",
"NextToken": "",
"MaxResults": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroupMembers' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"GroupId": "",
"NextToken": "",
"MaxResults": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroupMembers"
payload = {
"OrganizationId": "",
"GroupId": "",
"NextToken": "",
"MaxResults": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroupMembers"
payload <- "{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroupMembers")
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 \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"OrganizationId\": \"\",\n \"GroupId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroupMembers";
let payload = json!({
"OrganizationId": "",
"GroupId": "",
"NextToken": "",
"MaxResults": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroupMembers' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"GroupId": "",
"NextToken": "",
"MaxResults": ""
}'
echo '{
"OrganizationId": "",
"GroupId": "",
"NextToken": "",
"MaxResults": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroupMembers' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "GroupId": "",\n "NextToken": "",\n "MaxResults": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroupMembers'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"GroupId": "",
"NextToken": "",
"MaxResults": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroupMembers")! 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
ListGroups
{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroups
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroups");
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 \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroups" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:NextToken ""
:MaxResults ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroups"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroups"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroups");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroups"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 65
{
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroups")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroups"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroups")
.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=WorkMailService.ListGroups")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
NextToken: '',
MaxResults: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroups');
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=WorkMailService.ListGroups',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroups';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","NextToken":"","MaxResults":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroups',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "NextToken": "",\n "MaxResults": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroups")
.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({OrganizationId: '', NextToken: '', MaxResults: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroups',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', NextToken: '', MaxResults: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroups');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
NextToken: '',
MaxResults: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroups',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroups';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","NextToken":"","MaxResults":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"OrganizationId": @"",
@"NextToken": @"",
@"MaxResults": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroups"]
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=WorkMailService.ListGroups" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroups",
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([
'OrganizationId' => '',
'NextToken' => '',
'MaxResults' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroups', [
'body' => '{
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroups');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroups');
$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=WorkMailService.ListGroups' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroups' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroups"
payload = {
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroups"
payload <- "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroups")
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 \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroups";
let payload = json!({
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroups' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}'
echo '{
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroups' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "NextToken": "",\n "MaxResults": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroups'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListGroups")! 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
ListImpersonationRoles
{{baseUrl}}/#X-Amz-Target=WorkMailService.ListImpersonationRoles
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListImpersonationRoles");
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 \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListImpersonationRoles" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:NextToken ""
:MaxResults ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListImpersonationRoles"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListImpersonationRoles"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListImpersonationRoles");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListImpersonationRoles"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 65
{
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListImpersonationRoles")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListImpersonationRoles"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListImpersonationRoles")
.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=WorkMailService.ListImpersonationRoles")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
NextToken: '',
MaxResults: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListImpersonationRoles');
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=WorkMailService.ListImpersonationRoles',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListImpersonationRoles';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","NextToken":"","MaxResults":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListImpersonationRoles',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "NextToken": "",\n "MaxResults": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListImpersonationRoles")
.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({OrganizationId: '', NextToken: '', MaxResults: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListImpersonationRoles',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', NextToken: '', MaxResults: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListImpersonationRoles');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
NextToken: '',
MaxResults: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListImpersonationRoles',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListImpersonationRoles';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","NextToken":"","MaxResults":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"OrganizationId": @"",
@"NextToken": @"",
@"MaxResults": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.ListImpersonationRoles"]
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=WorkMailService.ListImpersonationRoles" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.ListImpersonationRoles",
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([
'OrganizationId' => '',
'NextToken' => '',
'MaxResults' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListImpersonationRoles', [
'body' => '{
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.ListImpersonationRoles');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.ListImpersonationRoles');
$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=WorkMailService.ListImpersonationRoles' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListImpersonationRoles' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListImpersonationRoles"
payload = {
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListImpersonationRoles"
payload <- "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListImpersonationRoles")
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 \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListImpersonationRoles";
let payload = json!({
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListImpersonationRoles' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}'
echo '{
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListImpersonationRoles' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "NextToken": "",\n "MaxResults": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListImpersonationRoles'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListImpersonationRoles")! 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
ListMailDomains
{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailDomains
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"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=WorkMailService.ListMailDomains");
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 \"OrganizationId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailDomains" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:MaxResults ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailDomains"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\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=WorkMailService.ListMailDomains"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\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=WorkMailService.ListMailDomains");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\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=WorkMailService.ListMailDomains"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\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
{
"OrganizationId": "",
"MaxResults": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailDomains")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\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=WorkMailService.ListMailDomains"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\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 \"OrganizationId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailDomains")
.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=WorkMailService.ListMailDomains")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
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=WorkMailService.ListMailDomains');
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=WorkMailService.ListMailDomains',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', MaxResults: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailDomains';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","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=WorkMailService.ListMailDomains',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\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 \"OrganizationId\": \"\",\n \"MaxResults\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailDomains")
.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({OrganizationId: '', MaxResults: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailDomains',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', 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=WorkMailService.ListMailDomains');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
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=WorkMailService.ListMailDomains',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', 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=WorkMailService.ListMailDomains';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","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 = @{ @"OrganizationId": @"",
@"MaxResults": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailDomains"]
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=WorkMailService.ListMailDomains" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\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=WorkMailService.ListMailDomains",
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([
'OrganizationId' => '',
'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=WorkMailService.ListMailDomains', [
'body' => '{
"OrganizationId": "",
"MaxResults": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailDomains');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'MaxResults' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'MaxResults' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailDomains');
$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=WorkMailService.ListMailDomains' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"MaxResults": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailDomains' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"MaxResults": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\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=WorkMailService.ListMailDomains"
payload = {
"OrganizationId": "",
"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=WorkMailService.ListMailDomains"
payload <- "{\n \"OrganizationId\": \"\",\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=WorkMailService.ListMailDomains")
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 \"OrganizationId\": \"\",\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 \"OrganizationId\": \"\",\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=WorkMailService.ListMailDomains";
let payload = json!({
"OrganizationId": "",
"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=WorkMailService.ListMailDomains' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"MaxResults": "",
"NextToken": ""
}'
echo '{
"OrganizationId": "",
"MaxResults": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailDomains' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "MaxResults": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailDomains'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"MaxResults": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailDomains")! 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
ListMailboxExportJobs
{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxExportJobs
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxExportJobs");
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 \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxExportJobs" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:NextToken ""
:MaxResults ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxExportJobs"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxExportJobs"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxExportJobs");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxExportJobs"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 65
{
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxExportJobs")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxExportJobs"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxExportJobs")
.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=WorkMailService.ListMailboxExportJobs")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
NextToken: '',
MaxResults: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxExportJobs');
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=WorkMailService.ListMailboxExportJobs',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxExportJobs';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","NextToken":"","MaxResults":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxExportJobs',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "NextToken": "",\n "MaxResults": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxExportJobs")
.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({OrganizationId: '', NextToken: '', MaxResults: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxExportJobs',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', NextToken: '', MaxResults: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxExportJobs');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
NextToken: '',
MaxResults: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxExportJobs',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxExportJobs';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","NextToken":"","MaxResults":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"OrganizationId": @"",
@"NextToken": @"",
@"MaxResults": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxExportJobs"]
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=WorkMailService.ListMailboxExportJobs" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxExportJobs",
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([
'OrganizationId' => '',
'NextToken' => '',
'MaxResults' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxExportJobs', [
'body' => '{
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxExportJobs');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxExportJobs');
$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=WorkMailService.ListMailboxExportJobs' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxExportJobs' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxExportJobs"
payload = {
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxExportJobs"
payload <- "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxExportJobs")
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 \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxExportJobs";
let payload = json!({
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxExportJobs' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}'
echo '{
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxExportJobs' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "NextToken": "",\n "MaxResults": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxExportJobs'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxExportJobs")! 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
ListMailboxPermissions
{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxPermissions
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"EntityId": "",
"NextToken": "",
"MaxResults": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxPermissions");
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 \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxPermissions" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:EntityId ""
:NextToken ""
:MaxResults ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxPermissions"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxPermissions"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxPermissions");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxPermissions"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 83
{
"OrganizationId": "",
"EntityId": "",
"NextToken": "",
"MaxResults": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxPermissions")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxPermissions"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxPermissions")
.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=WorkMailService.ListMailboxPermissions")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
EntityId: '',
NextToken: '',
MaxResults: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxPermissions');
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=WorkMailService.ListMailboxPermissions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', EntityId: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxPermissions';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","EntityId":"","NextToken":"","MaxResults":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxPermissions',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "EntityId": "",\n "NextToken": "",\n "MaxResults": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxPermissions")
.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({OrganizationId: '', EntityId: '', NextToken: '', MaxResults: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxPermissions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', EntityId: '', NextToken: '', MaxResults: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxPermissions');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
EntityId: '',
NextToken: '',
MaxResults: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxPermissions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', EntityId: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxPermissions';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","EntityId":"","NextToken":"","MaxResults":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"OrganizationId": @"",
@"EntityId": @"",
@"NextToken": @"",
@"MaxResults": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxPermissions"]
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=WorkMailService.ListMailboxPermissions" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxPermissions",
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([
'OrganizationId' => '',
'EntityId' => '',
'NextToken' => '',
'MaxResults' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxPermissions', [
'body' => '{
"OrganizationId": "",
"EntityId": "",
"NextToken": "",
"MaxResults": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxPermissions');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'EntityId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'EntityId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxPermissions');
$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=WorkMailService.ListMailboxPermissions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"EntityId": "",
"NextToken": "",
"MaxResults": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxPermissions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"EntityId": "",
"NextToken": "",
"MaxResults": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxPermissions"
payload = {
"OrganizationId": "",
"EntityId": "",
"NextToken": "",
"MaxResults": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxPermissions"
payload <- "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxPermissions")
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 \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxPermissions";
let payload = json!({
"OrganizationId": "",
"EntityId": "",
"NextToken": "",
"MaxResults": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxPermissions' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"EntityId": "",
"NextToken": "",
"MaxResults": ""
}'
echo '{
"OrganizationId": "",
"EntityId": "",
"NextToken": "",
"MaxResults": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxPermissions' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "EntityId": "",\n "NextToken": "",\n "MaxResults": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxPermissions'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"EntityId": "",
"NextToken": "",
"MaxResults": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMailboxPermissions")! 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
ListMobileDeviceAccessOverrides
{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessOverrides
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"UserId": "",
"DeviceId": "",
"NextToken": "",
"MaxResults": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessOverrides");
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 \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessOverrides" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:UserId ""
:DeviceId ""
:NextToken ""
:MaxResults ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessOverrides"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessOverrides"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessOverrides");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessOverrides"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 99
{
"OrganizationId": "",
"UserId": "",
"DeviceId": "",
"NextToken": "",
"MaxResults": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessOverrides")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessOverrides"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessOverrides")
.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=WorkMailService.ListMobileDeviceAccessOverrides")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
UserId: '',
DeviceId: '',
NextToken: '',
MaxResults: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessOverrides');
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=WorkMailService.ListMobileDeviceAccessOverrides',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', UserId: '', DeviceId: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessOverrides';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","UserId":"","DeviceId":"","NextToken":"","MaxResults":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessOverrides',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "UserId": "",\n "DeviceId": "",\n "NextToken": "",\n "MaxResults": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessOverrides")
.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({OrganizationId: '', UserId: '', DeviceId: '', NextToken: '', MaxResults: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessOverrides',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', UserId: '', DeviceId: '', NextToken: '', MaxResults: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessOverrides');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
UserId: '',
DeviceId: '',
NextToken: '',
MaxResults: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessOverrides',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', UserId: '', DeviceId: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessOverrides';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","UserId":"","DeviceId":"","NextToken":"","MaxResults":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"OrganizationId": @"",
@"UserId": @"",
@"DeviceId": @"",
@"NextToken": @"",
@"MaxResults": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessOverrides"]
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=WorkMailService.ListMobileDeviceAccessOverrides" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessOverrides",
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([
'OrganizationId' => '',
'UserId' => '',
'DeviceId' => '',
'NextToken' => '',
'MaxResults' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessOverrides', [
'body' => '{
"OrganizationId": "",
"UserId": "",
"DeviceId": "",
"NextToken": "",
"MaxResults": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessOverrides');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'UserId' => '',
'DeviceId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'UserId' => '',
'DeviceId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessOverrides');
$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=WorkMailService.ListMobileDeviceAccessOverrides' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"UserId": "",
"DeviceId": "",
"NextToken": "",
"MaxResults": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessOverrides' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"UserId": "",
"DeviceId": "",
"NextToken": "",
"MaxResults": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessOverrides"
payload = {
"OrganizationId": "",
"UserId": "",
"DeviceId": "",
"NextToken": "",
"MaxResults": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessOverrides"
payload <- "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessOverrides")
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 \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessOverrides";
let payload = json!({
"OrganizationId": "",
"UserId": "",
"DeviceId": "",
"NextToken": "",
"MaxResults": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessOverrides' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"UserId": "",
"DeviceId": "",
"NextToken": "",
"MaxResults": ""
}'
echo '{
"OrganizationId": "",
"UserId": "",
"DeviceId": "",
"NextToken": "",
"MaxResults": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessOverrides' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "UserId": "",\n "DeviceId": "",\n "NextToken": "",\n "MaxResults": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessOverrides'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"UserId": "",
"DeviceId": "",
"NextToken": "",
"MaxResults": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessOverrides")! 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
ListMobileDeviceAccessRules
{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessRules
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessRules");
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 \"OrganizationId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessRules" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessRules"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\"\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=WorkMailService.ListMobileDeviceAccessRules"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\"\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=WorkMailService.ListMobileDeviceAccessRules");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessRules"
payload := strings.NewReader("{\n \"OrganizationId\": \"\"\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
{
"OrganizationId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessRules")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessRules"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\"\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 \"OrganizationId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessRules")
.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=WorkMailService.ListMobileDeviceAccessRules")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: ''
});
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=WorkMailService.ListMobileDeviceAccessRules');
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=WorkMailService.ListMobileDeviceAccessRules',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessRules';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":""}'
};
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=WorkMailService.ListMobileDeviceAccessRules',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessRules")
.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({OrganizationId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessRules',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: ''},
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=WorkMailService.ListMobileDeviceAccessRules');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: ''
});
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=WorkMailService.ListMobileDeviceAccessRules',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: ''}
};
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=WorkMailService.ListMobileDeviceAccessRules';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":""}'
};
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 = @{ @"OrganizationId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessRules"]
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=WorkMailService.ListMobileDeviceAccessRules" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessRules",
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([
'OrganizationId' => ''
]),
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=WorkMailService.ListMobileDeviceAccessRules', [
'body' => '{
"OrganizationId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessRules');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessRules');
$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=WorkMailService.ListMobileDeviceAccessRules' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessRules' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\"\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=WorkMailService.ListMobileDeviceAccessRules"
payload = { "OrganizationId": "" }
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=WorkMailService.ListMobileDeviceAccessRules"
payload <- "{\n \"OrganizationId\": \"\"\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=WorkMailService.ListMobileDeviceAccessRules")
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 \"OrganizationId\": \"\"\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 \"OrganizationId\": \"\"\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=WorkMailService.ListMobileDeviceAccessRules";
let payload = json!({"OrganizationId": ""});
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=WorkMailService.ListMobileDeviceAccessRules' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": ""
}'
echo '{
"OrganizationId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessRules' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessRules'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["OrganizationId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListMobileDeviceAccessRules")! 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
ListOrganizations
{{baseUrl}}/#X-Amz-Target=WorkMailService.ListOrganizations
HEADERS
X-Amz-Target
BODY json
{
"NextToken": "",
"MaxResults": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListOrganizations");
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 \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListOrganizations" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:NextToken ""
:MaxResults ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListOrganizations"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListOrganizations"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListOrganizations");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListOrganizations"
payload := strings.NewReader("{\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 41
{
"NextToken": "",
"MaxResults": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListOrganizations")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListOrganizations"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListOrganizations")
.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=WorkMailService.ListOrganizations")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.asString();
const data = JSON.stringify({
NextToken: '',
MaxResults: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListOrganizations');
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=WorkMailService.ListOrganizations',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListOrganizations';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"NextToken":"","MaxResults":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListOrganizations',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "NextToken": "",\n "MaxResults": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListOrganizations")
.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({NextToken: '', MaxResults: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListOrganizations',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {NextToken: '', MaxResults: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListOrganizations');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
NextToken: '',
MaxResults: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListOrganizations',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListOrganizations';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"NextToken":"","MaxResults":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"NextToken": @"",
@"MaxResults": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.ListOrganizations"]
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=WorkMailService.ListOrganizations" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.ListOrganizations",
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([
'NextToken' => '',
'MaxResults' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListOrganizations', [
'body' => '{
"NextToken": "",
"MaxResults": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.ListOrganizations');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'NextToken' => '',
'MaxResults' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'NextToken' => '',
'MaxResults' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.ListOrganizations');
$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=WorkMailService.ListOrganizations' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"NextToken": "",
"MaxResults": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListOrganizations' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"NextToken": "",
"MaxResults": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListOrganizations"
payload = {
"NextToken": "",
"MaxResults": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListOrganizations"
payload <- "{\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListOrganizations")
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 \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListOrganizations";
let payload = json!({
"NextToken": "",
"MaxResults": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListOrganizations' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"NextToken": "",
"MaxResults": ""
}'
echo '{
"NextToken": "",
"MaxResults": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListOrganizations' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "NextToken": "",\n "MaxResults": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListOrganizations'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"NextToken": "",
"MaxResults": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListOrganizations")! 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
ListResourceDelegates
{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResourceDelegates
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"ResourceId": "",
"NextToken": "",
"MaxResults": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResourceDelegates");
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 \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResourceDelegates" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:ResourceId ""
:NextToken ""
:MaxResults ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResourceDelegates"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResourceDelegates"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResourceDelegates");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResourceDelegates"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 85
{
"OrganizationId": "",
"ResourceId": "",
"NextToken": "",
"MaxResults": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResourceDelegates")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResourceDelegates"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResourceDelegates")
.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=WorkMailService.ListResourceDelegates")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
ResourceId: '',
NextToken: '',
MaxResults: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResourceDelegates');
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=WorkMailService.ListResourceDelegates',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', ResourceId: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResourceDelegates';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","ResourceId":"","NextToken":"","MaxResults":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResourceDelegates',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "ResourceId": "",\n "NextToken": "",\n "MaxResults": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResourceDelegates")
.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({OrganizationId: '', ResourceId: '', NextToken: '', MaxResults: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResourceDelegates',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', ResourceId: '', NextToken: '', MaxResults: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResourceDelegates');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
ResourceId: '',
NextToken: '',
MaxResults: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResourceDelegates',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', ResourceId: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResourceDelegates';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","ResourceId":"","NextToken":"","MaxResults":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"OrganizationId": @"",
@"ResourceId": @"",
@"NextToken": @"",
@"MaxResults": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResourceDelegates"]
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=WorkMailService.ListResourceDelegates" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResourceDelegates",
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([
'OrganizationId' => '',
'ResourceId' => '',
'NextToken' => '',
'MaxResults' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResourceDelegates', [
'body' => '{
"OrganizationId": "",
"ResourceId": "",
"NextToken": "",
"MaxResults": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResourceDelegates');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'ResourceId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'ResourceId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResourceDelegates');
$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=WorkMailService.ListResourceDelegates' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"ResourceId": "",
"NextToken": "",
"MaxResults": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResourceDelegates' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"ResourceId": "",
"NextToken": "",
"MaxResults": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResourceDelegates"
payload = {
"OrganizationId": "",
"ResourceId": "",
"NextToken": "",
"MaxResults": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResourceDelegates"
payload <- "{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResourceDelegates")
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 \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResourceDelegates";
let payload = json!({
"OrganizationId": "",
"ResourceId": "",
"NextToken": "",
"MaxResults": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResourceDelegates' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"ResourceId": "",
"NextToken": "",
"MaxResults": ""
}'
echo '{
"OrganizationId": "",
"ResourceId": "",
"NextToken": "",
"MaxResults": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResourceDelegates' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "ResourceId": "",\n "NextToken": "",\n "MaxResults": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResourceDelegates'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"ResourceId": "",
"NextToken": "",
"MaxResults": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResourceDelegates")! 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
ListResources
{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResources
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResources");
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 \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResources" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:NextToken ""
:MaxResults ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResources"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResources"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResources");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResources"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 65
{
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResources")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResources"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResources")
.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=WorkMailService.ListResources")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
NextToken: '',
MaxResults: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResources');
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=WorkMailService.ListResources',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResources';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","NextToken":"","MaxResults":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResources',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "NextToken": "",\n "MaxResults": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResources")
.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({OrganizationId: '', NextToken: '', MaxResults: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResources',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', NextToken: '', MaxResults: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResources');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
NextToken: '',
MaxResults: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResources',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResources';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","NextToken":"","MaxResults":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"OrganizationId": @"",
@"NextToken": @"",
@"MaxResults": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResources"]
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=WorkMailService.ListResources" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResources",
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([
'OrganizationId' => '',
'NextToken' => '',
'MaxResults' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResources', [
'body' => '{
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResources');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResources');
$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=WorkMailService.ListResources' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResources' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResources"
payload = {
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResources"
payload <- "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResources")
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 \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResources";
let payload = json!({
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResources' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}'
echo '{
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResources' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "NextToken": "",\n "MaxResults": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResources'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListResources")! 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=WorkMailService.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=WorkMailService.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=WorkMailService.ListTagsForResource" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ResourceARN ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.ListTagsForResource', [
'body' => '{
"ResourceARN": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.ListTagsForResource' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ResourceARN": ""
}'
echo '{
"ResourceARN": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.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=WorkMailService.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=WorkMailService.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
ListUsers
{{baseUrl}}/#X-Amz-Target=WorkMailService.ListUsers
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListUsers");
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 \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListUsers" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:NextToken ""
:MaxResults ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListUsers"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListUsers"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListUsers");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListUsers"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 65
{
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListUsers")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListUsers"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListUsers")
.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=WorkMailService.ListUsers")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
NextToken: '',
MaxResults: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListUsers');
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=WorkMailService.ListUsers',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListUsers';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","NextToken":"","MaxResults":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListUsers',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "NextToken": "",\n "MaxResults": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListUsers")
.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({OrganizationId: '', NextToken: '', MaxResults: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListUsers',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', NextToken: '', MaxResults: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListUsers');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
NextToken: '',
MaxResults: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListUsers',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListUsers';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","NextToken":"","MaxResults":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"OrganizationId": @"",
@"NextToken": @"",
@"MaxResults": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.ListUsers"]
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=WorkMailService.ListUsers" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.ListUsers",
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([
'OrganizationId' => '',
'NextToken' => '',
'MaxResults' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListUsers', [
'body' => '{
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.ListUsers');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.ListUsers');
$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=WorkMailService.ListUsers' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListUsers' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListUsers"
payload = {
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListUsers"
payload <- "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=WorkMailService.ListUsers")
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 \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"OrganizationId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListUsers";
let payload = json!({
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListUsers' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}'
echo '{
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListUsers' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "NextToken": "",\n "MaxResults": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.ListUsers'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"NextToken": "",
"MaxResults": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.ListUsers")! 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
PutAccessControlRule
{{baseUrl}}/#X-Amz-Target=WorkMailService.PutAccessControlRule
HEADERS
X-Amz-Target
BODY json
{
"Name": "",
"Effect": "",
"Description": "",
"IpRanges": "",
"NotIpRanges": "",
"Actions": "",
"NotActions": "",
"UserIds": "",
"NotUserIds": "",
"OrganizationId": "",
"ImpersonationRoleIds": "",
"NotImpersonationRoleIds": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.PutAccessControlRule");
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 \"Effect\": \"\",\n \"Description\": \"\",\n \"IpRanges\": \"\",\n \"NotIpRanges\": \"\",\n \"Actions\": \"\",\n \"NotActions\": \"\",\n \"UserIds\": \"\",\n \"NotUserIds\": \"\",\n \"OrganizationId\": \"\",\n \"ImpersonationRoleIds\": \"\",\n \"NotImpersonationRoleIds\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.PutAccessControlRule" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Name ""
:Effect ""
:Description ""
:IpRanges ""
:NotIpRanges ""
:Actions ""
:NotActions ""
:UserIds ""
:NotUserIds ""
:OrganizationId ""
:ImpersonationRoleIds ""
:NotImpersonationRoleIds ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.PutAccessControlRule"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Name\": \"\",\n \"Effect\": \"\",\n \"Description\": \"\",\n \"IpRanges\": \"\",\n \"NotIpRanges\": \"\",\n \"Actions\": \"\",\n \"NotActions\": \"\",\n \"UserIds\": \"\",\n \"NotUserIds\": \"\",\n \"OrganizationId\": \"\",\n \"ImpersonationRoleIds\": \"\",\n \"NotImpersonationRoleIds\": \"\"\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=WorkMailService.PutAccessControlRule"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Name\": \"\",\n \"Effect\": \"\",\n \"Description\": \"\",\n \"IpRanges\": \"\",\n \"NotIpRanges\": \"\",\n \"Actions\": \"\",\n \"NotActions\": \"\",\n \"UserIds\": \"\",\n \"NotUserIds\": \"\",\n \"OrganizationId\": \"\",\n \"ImpersonationRoleIds\": \"\",\n \"NotImpersonationRoleIds\": \"\"\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=WorkMailService.PutAccessControlRule");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Name\": \"\",\n \"Effect\": \"\",\n \"Description\": \"\",\n \"IpRanges\": \"\",\n \"NotIpRanges\": \"\",\n \"Actions\": \"\",\n \"NotActions\": \"\",\n \"UserIds\": \"\",\n \"NotUserIds\": \"\",\n \"OrganizationId\": \"\",\n \"ImpersonationRoleIds\": \"\",\n \"NotImpersonationRoleIds\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.PutAccessControlRule"
payload := strings.NewReader("{\n \"Name\": \"\",\n \"Effect\": \"\",\n \"Description\": \"\",\n \"IpRanges\": \"\",\n \"NotIpRanges\": \"\",\n \"Actions\": \"\",\n \"NotActions\": \"\",\n \"UserIds\": \"\",\n \"NotUserIds\": \"\",\n \"OrganizationId\": \"\",\n \"ImpersonationRoleIds\": \"\",\n \"NotImpersonationRoleIds\": \"\"\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
{
"Name": "",
"Effect": "",
"Description": "",
"IpRanges": "",
"NotIpRanges": "",
"Actions": "",
"NotActions": "",
"UserIds": "",
"NotUserIds": "",
"OrganizationId": "",
"ImpersonationRoleIds": "",
"NotImpersonationRoleIds": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.PutAccessControlRule")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Name\": \"\",\n \"Effect\": \"\",\n \"Description\": \"\",\n \"IpRanges\": \"\",\n \"NotIpRanges\": \"\",\n \"Actions\": \"\",\n \"NotActions\": \"\",\n \"UserIds\": \"\",\n \"NotUserIds\": \"\",\n \"OrganizationId\": \"\",\n \"ImpersonationRoleIds\": \"\",\n \"NotImpersonationRoleIds\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.PutAccessControlRule"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Name\": \"\",\n \"Effect\": \"\",\n \"Description\": \"\",\n \"IpRanges\": \"\",\n \"NotIpRanges\": \"\",\n \"Actions\": \"\",\n \"NotActions\": \"\",\n \"UserIds\": \"\",\n \"NotUserIds\": \"\",\n \"OrganizationId\": \"\",\n \"ImpersonationRoleIds\": \"\",\n \"NotImpersonationRoleIds\": \"\"\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 \"Effect\": \"\",\n \"Description\": \"\",\n \"IpRanges\": \"\",\n \"NotIpRanges\": \"\",\n \"Actions\": \"\",\n \"NotActions\": \"\",\n \"UserIds\": \"\",\n \"NotUserIds\": \"\",\n \"OrganizationId\": \"\",\n \"ImpersonationRoleIds\": \"\",\n \"NotImpersonationRoleIds\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.PutAccessControlRule")
.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=WorkMailService.PutAccessControlRule")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Name\": \"\",\n \"Effect\": \"\",\n \"Description\": \"\",\n \"IpRanges\": \"\",\n \"NotIpRanges\": \"\",\n \"Actions\": \"\",\n \"NotActions\": \"\",\n \"UserIds\": \"\",\n \"NotUserIds\": \"\",\n \"OrganizationId\": \"\",\n \"ImpersonationRoleIds\": \"\",\n \"NotImpersonationRoleIds\": \"\"\n}")
.asString();
const data = JSON.stringify({
Name: '',
Effect: '',
Description: '',
IpRanges: '',
NotIpRanges: '',
Actions: '',
NotActions: '',
UserIds: '',
NotUserIds: '',
OrganizationId: '',
ImpersonationRoleIds: '',
NotImpersonationRoleIds: ''
});
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=WorkMailService.PutAccessControlRule');
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=WorkMailService.PutAccessControlRule',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Name: '',
Effect: '',
Description: '',
IpRanges: '',
NotIpRanges: '',
Actions: '',
NotActions: '',
UserIds: '',
NotUserIds: '',
OrganizationId: '',
ImpersonationRoleIds: '',
NotImpersonationRoleIds: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.PutAccessControlRule';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","Effect":"","Description":"","IpRanges":"","NotIpRanges":"","Actions":"","NotActions":"","UserIds":"","NotUserIds":"","OrganizationId":"","ImpersonationRoleIds":"","NotImpersonationRoleIds":""}'
};
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=WorkMailService.PutAccessControlRule',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Name": "",\n "Effect": "",\n "Description": "",\n "IpRanges": "",\n "NotIpRanges": "",\n "Actions": "",\n "NotActions": "",\n "UserIds": "",\n "NotUserIds": "",\n "OrganizationId": "",\n "ImpersonationRoleIds": "",\n "NotImpersonationRoleIds": ""\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 \"Effect\": \"\",\n \"Description\": \"\",\n \"IpRanges\": \"\",\n \"NotIpRanges\": \"\",\n \"Actions\": \"\",\n \"NotActions\": \"\",\n \"UserIds\": \"\",\n \"NotUserIds\": \"\",\n \"OrganizationId\": \"\",\n \"ImpersonationRoleIds\": \"\",\n \"NotImpersonationRoleIds\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.PutAccessControlRule")
.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: '',
Effect: '',
Description: '',
IpRanges: '',
NotIpRanges: '',
Actions: '',
NotActions: '',
UserIds: '',
NotUserIds: '',
OrganizationId: '',
ImpersonationRoleIds: '',
NotImpersonationRoleIds: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.PutAccessControlRule',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
Name: '',
Effect: '',
Description: '',
IpRanges: '',
NotIpRanges: '',
Actions: '',
NotActions: '',
UserIds: '',
NotUserIds: '',
OrganizationId: '',
ImpersonationRoleIds: '',
NotImpersonationRoleIds: ''
},
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=WorkMailService.PutAccessControlRule');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Name: '',
Effect: '',
Description: '',
IpRanges: '',
NotIpRanges: '',
Actions: '',
NotActions: '',
UserIds: '',
NotUserIds: '',
OrganizationId: '',
ImpersonationRoleIds: '',
NotImpersonationRoleIds: ''
});
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=WorkMailService.PutAccessControlRule',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Name: '',
Effect: '',
Description: '',
IpRanges: '',
NotIpRanges: '',
Actions: '',
NotActions: '',
UserIds: '',
NotUserIds: '',
OrganizationId: '',
ImpersonationRoleIds: '',
NotImpersonationRoleIds: ''
}
};
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=WorkMailService.PutAccessControlRule';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","Effect":"","Description":"","IpRanges":"","NotIpRanges":"","Actions":"","NotActions":"","UserIds":"","NotUserIds":"","OrganizationId":"","ImpersonationRoleIds":"","NotImpersonationRoleIds":""}'
};
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": @"",
@"Effect": @"",
@"Description": @"",
@"IpRanges": @"",
@"NotIpRanges": @"",
@"Actions": @"",
@"NotActions": @"",
@"UserIds": @"",
@"NotUserIds": @"",
@"OrganizationId": @"",
@"ImpersonationRoleIds": @"",
@"NotImpersonationRoleIds": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.PutAccessControlRule"]
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=WorkMailService.PutAccessControlRule" 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 \"Effect\": \"\",\n \"Description\": \"\",\n \"IpRanges\": \"\",\n \"NotIpRanges\": \"\",\n \"Actions\": \"\",\n \"NotActions\": \"\",\n \"UserIds\": \"\",\n \"NotUserIds\": \"\",\n \"OrganizationId\": \"\",\n \"ImpersonationRoleIds\": \"\",\n \"NotImpersonationRoleIds\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.PutAccessControlRule",
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' => '',
'Effect' => '',
'Description' => '',
'IpRanges' => '',
'NotIpRanges' => '',
'Actions' => '',
'NotActions' => '',
'UserIds' => '',
'NotUserIds' => '',
'OrganizationId' => '',
'ImpersonationRoleIds' => '',
'NotImpersonationRoleIds' => ''
]),
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=WorkMailService.PutAccessControlRule', [
'body' => '{
"Name": "",
"Effect": "",
"Description": "",
"IpRanges": "",
"NotIpRanges": "",
"Actions": "",
"NotActions": "",
"UserIds": "",
"NotUserIds": "",
"OrganizationId": "",
"ImpersonationRoleIds": "",
"NotImpersonationRoleIds": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.PutAccessControlRule');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Name' => '',
'Effect' => '',
'Description' => '',
'IpRanges' => '',
'NotIpRanges' => '',
'Actions' => '',
'NotActions' => '',
'UserIds' => '',
'NotUserIds' => '',
'OrganizationId' => '',
'ImpersonationRoleIds' => '',
'NotImpersonationRoleIds' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Name' => '',
'Effect' => '',
'Description' => '',
'IpRanges' => '',
'NotIpRanges' => '',
'Actions' => '',
'NotActions' => '',
'UserIds' => '',
'NotUserIds' => '',
'OrganizationId' => '',
'ImpersonationRoleIds' => '',
'NotImpersonationRoleIds' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.PutAccessControlRule');
$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=WorkMailService.PutAccessControlRule' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"Effect": "",
"Description": "",
"IpRanges": "",
"NotIpRanges": "",
"Actions": "",
"NotActions": "",
"UserIds": "",
"NotUserIds": "",
"OrganizationId": "",
"ImpersonationRoleIds": "",
"NotImpersonationRoleIds": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.PutAccessControlRule' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"Effect": "",
"Description": "",
"IpRanges": "",
"NotIpRanges": "",
"Actions": "",
"NotActions": "",
"UserIds": "",
"NotUserIds": "",
"OrganizationId": "",
"ImpersonationRoleIds": "",
"NotImpersonationRoleIds": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Name\": \"\",\n \"Effect\": \"\",\n \"Description\": \"\",\n \"IpRanges\": \"\",\n \"NotIpRanges\": \"\",\n \"Actions\": \"\",\n \"NotActions\": \"\",\n \"UserIds\": \"\",\n \"NotUserIds\": \"\",\n \"OrganizationId\": \"\",\n \"ImpersonationRoleIds\": \"\",\n \"NotImpersonationRoleIds\": \"\"\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=WorkMailService.PutAccessControlRule"
payload = {
"Name": "",
"Effect": "",
"Description": "",
"IpRanges": "",
"NotIpRanges": "",
"Actions": "",
"NotActions": "",
"UserIds": "",
"NotUserIds": "",
"OrganizationId": "",
"ImpersonationRoleIds": "",
"NotImpersonationRoleIds": ""
}
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=WorkMailService.PutAccessControlRule"
payload <- "{\n \"Name\": \"\",\n \"Effect\": \"\",\n \"Description\": \"\",\n \"IpRanges\": \"\",\n \"NotIpRanges\": \"\",\n \"Actions\": \"\",\n \"NotActions\": \"\",\n \"UserIds\": \"\",\n \"NotUserIds\": \"\",\n \"OrganizationId\": \"\",\n \"ImpersonationRoleIds\": \"\",\n \"NotImpersonationRoleIds\": \"\"\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=WorkMailService.PutAccessControlRule")
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 \"Effect\": \"\",\n \"Description\": \"\",\n \"IpRanges\": \"\",\n \"NotIpRanges\": \"\",\n \"Actions\": \"\",\n \"NotActions\": \"\",\n \"UserIds\": \"\",\n \"NotUserIds\": \"\",\n \"OrganizationId\": \"\",\n \"ImpersonationRoleIds\": \"\",\n \"NotImpersonationRoleIds\": \"\"\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 \"Effect\": \"\",\n \"Description\": \"\",\n \"IpRanges\": \"\",\n \"NotIpRanges\": \"\",\n \"Actions\": \"\",\n \"NotActions\": \"\",\n \"UserIds\": \"\",\n \"NotUserIds\": \"\",\n \"OrganizationId\": \"\",\n \"ImpersonationRoleIds\": \"\",\n \"NotImpersonationRoleIds\": \"\"\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=WorkMailService.PutAccessControlRule";
let payload = json!({
"Name": "",
"Effect": "",
"Description": "",
"IpRanges": "",
"NotIpRanges": "",
"Actions": "",
"NotActions": "",
"UserIds": "",
"NotUserIds": "",
"OrganizationId": "",
"ImpersonationRoleIds": "",
"NotImpersonationRoleIds": ""
});
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=WorkMailService.PutAccessControlRule' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Name": "",
"Effect": "",
"Description": "",
"IpRanges": "",
"NotIpRanges": "",
"Actions": "",
"NotActions": "",
"UserIds": "",
"NotUserIds": "",
"OrganizationId": "",
"ImpersonationRoleIds": "",
"NotImpersonationRoleIds": ""
}'
echo '{
"Name": "",
"Effect": "",
"Description": "",
"IpRanges": "",
"NotIpRanges": "",
"Actions": "",
"NotActions": "",
"UserIds": "",
"NotUserIds": "",
"OrganizationId": "",
"ImpersonationRoleIds": "",
"NotImpersonationRoleIds": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.PutAccessControlRule' \
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 "Effect": "",\n "Description": "",\n "IpRanges": "",\n "NotIpRanges": "",\n "Actions": "",\n "NotActions": "",\n "UserIds": "",\n "NotUserIds": "",\n "OrganizationId": "",\n "ImpersonationRoleIds": "",\n "NotImpersonationRoleIds": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.PutAccessControlRule'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Name": "",
"Effect": "",
"Description": "",
"IpRanges": "",
"NotIpRanges": "",
"Actions": "",
"NotActions": "",
"UserIds": "",
"NotUserIds": "",
"OrganizationId": "",
"ImpersonationRoleIds": "",
"NotImpersonationRoleIds": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.PutAccessControlRule")! 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
PutEmailMonitoringConfiguration
{{baseUrl}}/#X-Amz-Target=WorkMailService.PutEmailMonitoringConfiguration
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"RoleArn": "",
"LogGroupArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.PutEmailMonitoringConfiguration");
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 \"OrganizationId\": \"\",\n \"RoleArn\": \"\",\n \"LogGroupArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.PutEmailMonitoringConfiguration" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:RoleArn ""
:LogGroupArn ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.PutEmailMonitoringConfiguration"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"RoleArn\": \"\",\n \"LogGroupArn\": \"\"\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=WorkMailService.PutEmailMonitoringConfiguration"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"RoleArn\": \"\",\n \"LogGroupArn\": \"\"\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=WorkMailService.PutEmailMonitoringConfiguration");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"RoleArn\": \"\",\n \"LogGroupArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.PutEmailMonitoringConfiguration"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"RoleArn\": \"\",\n \"LogGroupArn\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 64
{
"OrganizationId": "",
"RoleArn": "",
"LogGroupArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.PutEmailMonitoringConfiguration")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"RoleArn\": \"\",\n \"LogGroupArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.PutEmailMonitoringConfiguration"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"RoleArn\": \"\",\n \"LogGroupArn\": \"\"\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 \"OrganizationId\": \"\",\n \"RoleArn\": \"\",\n \"LogGroupArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.PutEmailMonitoringConfiguration")
.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=WorkMailService.PutEmailMonitoringConfiguration")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"RoleArn\": \"\",\n \"LogGroupArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
RoleArn: '',
LogGroupArn: ''
});
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=WorkMailService.PutEmailMonitoringConfiguration');
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=WorkMailService.PutEmailMonitoringConfiguration',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', RoleArn: '', LogGroupArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.PutEmailMonitoringConfiguration';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","RoleArn":"","LogGroupArn":""}'
};
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=WorkMailService.PutEmailMonitoringConfiguration',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "RoleArn": "",\n "LogGroupArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"RoleArn\": \"\",\n \"LogGroupArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.PutEmailMonitoringConfiguration")
.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({OrganizationId: '', RoleArn: '', LogGroupArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.PutEmailMonitoringConfiguration',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', RoleArn: '', LogGroupArn: ''},
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=WorkMailService.PutEmailMonitoringConfiguration');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
RoleArn: '',
LogGroupArn: ''
});
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=WorkMailService.PutEmailMonitoringConfiguration',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', RoleArn: '', LogGroupArn: ''}
};
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=WorkMailService.PutEmailMonitoringConfiguration';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","RoleArn":"","LogGroupArn":""}'
};
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 = @{ @"OrganizationId": @"",
@"RoleArn": @"",
@"LogGroupArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.PutEmailMonitoringConfiguration"]
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=WorkMailService.PutEmailMonitoringConfiguration" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"RoleArn\": \"\",\n \"LogGroupArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.PutEmailMonitoringConfiguration",
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([
'OrganizationId' => '',
'RoleArn' => '',
'LogGroupArn' => ''
]),
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=WorkMailService.PutEmailMonitoringConfiguration', [
'body' => '{
"OrganizationId": "",
"RoleArn": "",
"LogGroupArn": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.PutEmailMonitoringConfiguration');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'RoleArn' => '',
'LogGroupArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'RoleArn' => '',
'LogGroupArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.PutEmailMonitoringConfiguration');
$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=WorkMailService.PutEmailMonitoringConfiguration' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"RoleArn": "",
"LogGroupArn": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.PutEmailMonitoringConfiguration' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"RoleArn": "",
"LogGroupArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"RoleArn\": \"\",\n \"LogGroupArn\": \"\"\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=WorkMailService.PutEmailMonitoringConfiguration"
payload = {
"OrganizationId": "",
"RoleArn": "",
"LogGroupArn": ""
}
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=WorkMailService.PutEmailMonitoringConfiguration"
payload <- "{\n \"OrganizationId\": \"\",\n \"RoleArn\": \"\",\n \"LogGroupArn\": \"\"\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=WorkMailService.PutEmailMonitoringConfiguration")
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 \"OrganizationId\": \"\",\n \"RoleArn\": \"\",\n \"LogGroupArn\": \"\"\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 \"OrganizationId\": \"\",\n \"RoleArn\": \"\",\n \"LogGroupArn\": \"\"\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=WorkMailService.PutEmailMonitoringConfiguration";
let payload = json!({
"OrganizationId": "",
"RoleArn": "",
"LogGroupArn": ""
});
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=WorkMailService.PutEmailMonitoringConfiguration' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"RoleArn": "",
"LogGroupArn": ""
}'
echo '{
"OrganizationId": "",
"RoleArn": "",
"LogGroupArn": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.PutEmailMonitoringConfiguration' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "RoleArn": "",\n "LogGroupArn": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.PutEmailMonitoringConfiguration'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"RoleArn": "",
"LogGroupArn": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.PutEmailMonitoringConfiguration")! 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
PutInboundDmarcSettings
{{baseUrl}}/#X-Amz-Target=WorkMailService.PutInboundDmarcSettings
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"Enforced": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.PutInboundDmarcSettings");
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 \"OrganizationId\": \"\",\n \"Enforced\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.PutInboundDmarcSettings" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:Enforced ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.PutInboundDmarcSettings"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"Enforced\": \"\"\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=WorkMailService.PutInboundDmarcSettings"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"Enforced\": \"\"\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=WorkMailService.PutInboundDmarcSettings");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"Enforced\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.PutInboundDmarcSettings"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"Enforced\": \"\"\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: 44
{
"OrganizationId": "",
"Enforced": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.PutInboundDmarcSettings")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"Enforced\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.PutInboundDmarcSettings"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"Enforced\": \"\"\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 \"OrganizationId\": \"\",\n \"Enforced\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.PutInboundDmarcSettings")
.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=WorkMailService.PutInboundDmarcSettings")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"Enforced\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
Enforced: ''
});
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=WorkMailService.PutInboundDmarcSettings');
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=WorkMailService.PutInboundDmarcSettings',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', Enforced: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.PutInboundDmarcSettings';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","Enforced":""}'
};
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=WorkMailService.PutInboundDmarcSettings',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "Enforced": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"Enforced\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.PutInboundDmarcSettings")
.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({OrganizationId: '', Enforced: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.PutInboundDmarcSettings',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', Enforced: ''},
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=WorkMailService.PutInboundDmarcSettings');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
Enforced: ''
});
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=WorkMailService.PutInboundDmarcSettings',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', Enforced: ''}
};
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=WorkMailService.PutInboundDmarcSettings';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","Enforced":""}'
};
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 = @{ @"OrganizationId": @"",
@"Enforced": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.PutInboundDmarcSettings"]
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=WorkMailService.PutInboundDmarcSettings" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"Enforced\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.PutInboundDmarcSettings",
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([
'OrganizationId' => '',
'Enforced' => ''
]),
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=WorkMailService.PutInboundDmarcSettings', [
'body' => '{
"OrganizationId": "",
"Enforced": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.PutInboundDmarcSettings');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'Enforced' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'Enforced' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.PutInboundDmarcSettings');
$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=WorkMailService.PutInboundDmarcSettings' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"Enforced": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.PutInboundDmarcSettings' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"Enforced": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"Enforced\": \"\"\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=WorkMailService.PutInboundDmarcSettings"
payload = {
"OrganizationId": "",
"Enforced": ""
}
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=WorkMailService.PutInboundDmarcSettings"
payload <- "{\n \"OrganizationId\": \"\",\n \"Enforced\": \"\"\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=WorkMailService.PutInboundDmarcSettings")
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 \"OrganizationId\": \"\",\n \"Enforced\": \"\"\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 \"OrganizationId\": \"\",\n \"Enforced\": \"\"\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=WorkMailService.PutInboundDmarcSettings";
let payload = json!({
"OrganizationId": "",
"Enforced": ""
});
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=WorkMailService.PutInboundDmarcSettings' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"Enforced": ""
}'
echo '{
"OrganizationId": "",
"Enforced": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.PutInboundDmarcSettings' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "Enforced": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.PutInboundDmarcSettings'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"Enforced": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.PutInboundDmarcSettings")! 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
PutMailboxPermissions
{{baseUrl}}/#X-Amz-Target=WorkMailService.PutMailboxPermissions
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"EntityId": "",
"GranteeId": "",
"PermissionValues": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.PutMailboxPermissions");
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 \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"GranteeId\": \"\",\n \"PermissionValues\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.PutMailboxPermissions" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:EntityId ""
:GranteeId ""
:PermissionValues ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.PutMailboxPermissions"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"GranteeId\": \"\",\n \"PermissionValues\": \"\"\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=WorkMailService.PutMailboxPermissions"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"GranteeId\": \"\",\n \"PermissionValues\": \"\"\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=WorkMailService.PutMailboxPermissions");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"GranteeId\": \"\",\n \"PermissionValues\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.PutMailboxPermissions"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"GranteeId\": \"\",\n \"PermissionValues\": \"\"\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
{
"OrganizationId": "",
"EntityId": "",
"GranteeId": "",
"PermissionValues": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.PutMailboxPermissions")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"GranteeId\": \"\",\n \"PermissionValues\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.PutMailboxPermissions"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"GranteeId\": \"\",\n \"PermissionValues\": \"\"\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 \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"GranteeId\": \"\",\n \"PermissionValues\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.PutMailboxPermissions")
.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=WorkMailService.PutMailboxPermissions")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"GranteeId\": \"\",\n \"PermissionValues\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
EntityId: '',
GranteeId: '',
PermissionValues: ''
});
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=WorkMailService.PutMailboxPermissions');
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=WorkMailService.PutMailboxPermissions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', EntityId: '', GranteeId: '', PermissionValues: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.PutMailboxPermissions';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","EntityId":"","GranteeId":"","PermissionValues":""}'
};
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=WorkMailService.PutMailboxPermissions',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "EntityId": "",\n "GranteeId": "",\n "PermissionValues": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"GranteeId\": \"\",\n \"PermissionValues\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.PutMailboxPermissions")
.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({OrganizationId: '', EntityId: '', GranteeId: '', PermissionValues: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.PutMailboxPermissions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', EntityId: '', GranteeId: '', PermissionValues: ''},
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=WorkMailService.PutMailboxPermissions');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
EntityId: '',
GranteeId: '',
PermissionValues: ''
});
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=WorkMailService.PutMailboxPermissions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', EntityId: '', GranteeId: '', PermissionValues: ''}
};
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=WorkMailService.PutMailboxPermissions';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","EntityId":"","GranteeId":"","PermissionValues":""}'
};
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 = @{ @"OrganizationId": @"",
@"EntityId": @"",
@"GranteeId": @"",
@"PermissionValues": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.PutMailboxPermissions"]
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=WorkMailService.PutMailboxPermissions" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"GranteeId\": \"\",\n \"PermissionValues\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.PutMailboxPermissions",
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([
'OrganizationId' => '',
'EntityId' => '',
'GranteeId' => '',
'PermissionValues' => ''
]),
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=WorkMailService.PutMailboxPermissions', [
'body' => '{
"OrganizationId": "",
"EntityId": "",
"GranteeId": "",
"PermissionValues": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.PutMailboxPermissions');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'EntityId' => '',
'GranteeId' => '',
'PermissionValues' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'EntityId' => '',
'GranteeId' => '',
'PermissionValues' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.PutMailboxPermissions');
$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=WorkMailService.PutMailboxPermissions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"EntityId": "",
"GranteeId": "",
"PermissionValues": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.PutMailboxPermissions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"EntityId": "",
"GranteeId": "",
"PermissionValues": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"GranteeId\": \"\",\n \"PermissionValues\": \"\"\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=WorkMailService.PutMailboxPermissions"
payload = {
"OrganizationId": "",
"EntityId": "",
"GranteeId": "",
"PermissionValues": ""
}
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=WorkMailService.PutMailboxPermissions"
payload <- "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"GranteeId\": \"\",\n \"PermissionValues\": \"\"\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=WorkMailService.PutMailboxPermissions")
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 \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"GranteeId\": \"\",\n \"PermissionValues\": \"\"\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 \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"GranteeId\": \"\",\n \"PermissionValues\": \"\"\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=WorkMailService.PutMailboxPermissions";
let payload = json!({
"OrganizationId": "",
"EntityId": "",
"GranteeId": "",
"PermissionValues": ""
});
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=WorkMailService.PutMailboxPermissions' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"EntityId": "",
"GranteeId": "",
"PermissionValues": ""
}'
echo '{
"OrganizationId": "",
"EntityId": "",
"GranteeId": "",
"PermissionValues": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.PutMailboxPermissions' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "EntityId": "",\n "GranteeId": "",\n "PermissionValues": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.PutMailboxPermissions'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"EntityId": "",
"GranteeId": "",
"PermissionValues": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.PutMailboxPermissions")! 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
PutMobileDeviceAccessOverride
{{baseUrl}}/#X-Amz-Target=WorkMailService.PutMobileDeviceAccessOverride
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"UserId": "",
"DeviceId": "",
"Effect": "",
"Description": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.PutMobileDeviceAccessOverride");
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 \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\",\n \"Effect\": \"\",\n \"Description\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.PutMobileDeviceAccessOverride" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:UserId ""
:DeviceId ""
:Effect ""
:Description ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.PutMobileDeviceAccessOverride"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\",\n \"Effect\": \"\",\n \"Description\": \"\"\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=WorkMailService.PutMobileDeviceAccessOverride"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\",\n \"Effect\": \"\",\n \"Description\": \"\"\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=WorkMailService.PutMobileDeviceAccessOverride");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\",\n \"Effect\": \"\",\n \"Description\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.PutMobileDeviceAccessOverride"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\",\n \"Effect\": \"\",\n \"Description\": \"\"\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: 97
{
"OrganizationId": "",
"UserId": "",
"DeviceId": "",
"Effect": "",
"Description": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.PutMobileDeviceAccessOverride")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\",\n \"Effect\": \"\",\n \"Description\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.PutMobileDeviceAccessOverride"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\",\n \"Effect\": \"\",\n \"Description\": \"\"\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 \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\",\n \"Effect\": \"\",\n \"Description\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.PutMobileDeviceAccessOverride")
.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=WorkMailService.PutMobileDeviceAccessOverride")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\",\n \"Effect\": \"\",\n \"Description\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
UserId: '',
DeviceId: '',
Effect: '',
Description: ''
});
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=WorkMailService.PutMobileDeviceAccessOverride');
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=WorkMailService.PutMobileDeviceAccessOverride',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', UserId: '', DeviceId: '', Effect: '', Description: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.PutMobileDeviceAccessOverride';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","UserId":"","DeviceId":"","Effect":"","Description":""}'
};
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=WorkMailService.PutMobileDeviceAccessOverride',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "UserId": "",\n "DeviceId": "",\n "Effect": "",\n "Description": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\",\n \"Effect\": \"\",\n \"Description\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.PutMobileDeviceAccessOverride")
.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({OrganizationId: '', UserId: '', DeviceId: '', Effect: '', Description: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.PutMobileDeviceAccessOverride',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', UserId: '', DeviceId: '', Effect: '', Description: ''},
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=WorkMailService.PutMobileDeviceAccessOverride');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
UserId: '',
DeviceId: '',
Effect: '',
Description: ''
});
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=WorkMailService.PutMobileDeviceAccessOverride',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', UserId: '', DeviceId: '', Effect: '', Description: ''}
};
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=WorkMailService.PutMobileDeviceAccessOverride';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","UserId":"","DeviceId":"","Effect":"","Description":""}'
};
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 = @{ @"OrganizationId": @"",
@"UserId": @"",
@"DeviceId": @"",
@"Effect": @"",
@"Description": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.PutMobileDeviceAccessOverride"]
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=WorkMailService.PutMobileDeviceAccessOverride" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\",\n \"Effect\": \"\",\n \"Description\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.PutMobileDeviceAccessOverride",
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([
'OrganizationId' => '',
'UserId' => '',
'DeviceId' => '',
'Effect' => '',
'Description' => ''
]),
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=WorkMailService.PutMobileDeviceAccessOverride', [
'body' => '{
"OrganizationId": "",
"UserId": "",
"DeviceId": "",
"Effect": "",
"Description": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.PutMobileDeviceAccessOverride');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'UserId' => '',
'DeviceId' => '',
'Effect' => '',
'Description' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'UserId' => '',
'DeviceId' => '',
'Effect' => '',
'Description' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.PutMobileDeviceAccessOverride');
$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=WorkMailService.PutMobileDeviceAccessOverride' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"UserId": "",
"DeviceId": "",
"Effect": "",
"Description": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.PutMobileDeviceAccessOverride' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"UserId": "",
"DeviceId": "",
"Effect": "",
"Description": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\",\n \"Effect\": \"\",\n \"Description\": \"\"\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=WorkMailService.PutMobileDeviceAccessOverride"
payload = {
"OrganizationId": "",
"UserId": "",
"DeviceId": "",
"Effect": "",
"Description": ""
}
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=WorkMailService.PutMobileDeviceAccessOverride"
payload <- "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\",\n \"Effect\": \"\",\n \"Description\": \"\"\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=WorkMailService.PutMobileDeviceAccessOverride")
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 \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\",\n \"Effect\": \"\",\n \"Description\": \"\"\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 \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"DeviceId\": \"\",\n \"Effect\": \"\",\n \"Description\": \"\"\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=WorkMailService.PutMobileDeviceAccessOverride";
let payload = json!({
"OrganizationId": "",
"UserId": "",
"DeviceId": "",
"Effect": "",
"Description": ""
});
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=WorkMailService.PutMobileDeviceAccessOverride' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"UserId": "",
"DeviceId": "",
"Effect": "",
"Description": ""
}'
echo '{
"OrganizationId": "",
"UserId": "",
"DeviceId": "",
"Effect": "",
"Description": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.PutMobileDeviceAccessOverride' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "UserId": "",\n "DeviceId": "",\n "Effect": "",\n "Description": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.PutMobileDeviceAccessOverride'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"UserId": "",
"DeviceId": "",
"Effect": "",
"Description": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.PutMobileDeviceAccessOverride")! 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
PutRetentionPolicy
{{baseUrl}}/#X-Amz-Target=WorkMailService.PutRetentionPolicy
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"Id": "",
"Name": "",
"Description": "",
"FolderConfigurations": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.PutRetentionPolicy");
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 \"OrganizationId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"FolderConfigurations\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.PutRetentionPolicy" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:Id ""
:Name ""
:Description ""
:FolderConfigurations ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.PutRetentionPolicy"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"FolderConfigurations\": \"\"\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=WorkMailService.PutRetentionPolicy"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"FolderConfigurations\": \"\"\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=WorkMailService.PutRetentionPolicy");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"FolderConfigurations\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.PutRetentionPolicy"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"FolderConfigurations\": \"\"\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
{
"OrganizationId": "",
"Id": "",
"Name": "",
"Description": "",
"FolderConfigurations": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.PutRetentionPolicy")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"FolderConfigurations\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.PutRetentionPolicy"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"FolderConfigurations\": \"\"\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 \"OrganizationId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"FolderConfigurations\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.PutRetentionPolicy")
.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=WorkMailService.PutRetentionPolicy")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"FolderConfigurations\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
Id: '',
Name: '',
Description: '',
FolderConfigurations: ''
});
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=WorkMailService.PutRetentionPolicy');
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=WorkMailService.PutRetentionPolicy',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
OrganizationId: '',
Id: '',
Name: '',
Description: '',
FolderConfigurations: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.PutRetentionPolicy';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","Id":"","Name":"","Description":"","FolderConfigurations":""}'
};
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=WorkMailService.PutRetentionPolicy',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "Id": "",\n "Name": "",\n "Description": "",\n "FolderConfigurations": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"FolderConfigurations\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.PutRetentionPolicy")
.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({
OrganizationId: '',
Id: '',
Name: '',
Description: '',
FolderConfigurations: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.PutRetentionPolicy',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
OrganizationId: '',
Id: '',
Name: '',
Description: '',
FolderConfigurations: ''
},
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=WorkMailService.PutRetentionPolicy');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
Id: '',
Name: '',
Description: '',
FolderConfigurations: ''
});
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=WorkMailService.PutRetentionPolicy',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
OrganizationId: '',
Id: '',
Name: '',
Description: '',
FolderConfigurations: ''
}
};
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=WorkMailService.PutRetentionPolicy';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","Id":"","Name":"","Description":"","FolderConfigurations":""}'
};
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 = @{ @"OrganizationId": @"",
@"Id": @"",
@"Name": @"",
@"Description": @"",
@"FolderConfigurations": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.PutRetentionPolicy"]
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=WorkMailService.PutRetentionPolicy" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"FolderConfigurations\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.PutRetentionPolicy",
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([
'OrganizationId' => '',
'Id' => '',
'Name' => '',
'Description' => '',
'FolderConfigurations' => ''
]),
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=WorkMailService.PutRetentionPolicy', [
'body' => '{
"OrganizationId": "",
"Id": "",
"Name": "",
"Description": "",
"FolderConfigurations": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.PutRetentionPolicy');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'Id' => '',
'Name' => '',
'Description' => '',
'FolderConfigurations' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'Id' => '',
'Name' => '',
'Description' => '',
'FolderConfigurations' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.PutRetentionPolicy');
$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=WorkMailService.PutRetentionPolicy' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"Id": "",
"Name": "",
"Description": "",
"FolderConfigurations": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.PutRetentionPolicy' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"Id": "",
"Name": "",
"Description": "",
"FolderConfigurations": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"FolderConfigurations\": \"\"\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=WorkMailService.PutRetentionPolicy"
payload = {
"OrganizationId": "",
"Id": "",
"Name": "",
"Description": "",
"FolderConfigurations": ""
}
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=WorkMailService.PutRetentionPolicy"
payload <- "{\n \"OrganizationId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"FolderConfigurations\": \"\"\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=WorkMailService.PutRetentionPolicy")
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 \"OrganizationId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"FolderConfigurations\": \"\"\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 \"OrganizationId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"FolderConfigurations\": \"\"\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=WorkMailService.PutRetentionPolicy";
let payload = json!({
"OrganizationId": "",
"Id": "",
"Name": "",
"Description": "",
"FolderConfigurations": ""
});
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=WorkMailService.PutRetentionPolicy' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"Id": "",
"Name": "",
"Description": "",
"FolderConfigurations": ""
}'
echo '{
"OrganizationId": "",
"Id": "",
"Name": "",
"Description": "",
"FolderConfigurations": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.PutRetentionPolicy' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "Id": "",\n "Name": "",\n "Description": "",\n "FolderConfigurations": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.PutRetentionPolicy'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"Id": "",
"Name": "",
"Description": "",
"FolderConfigurations": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.PutRetentionPolicy")! 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
RegisterMailDomain
{{baseUrl}}/#X-Amz-Target=WorkMailService.RegisterMailDomain
HEADERS
X-Amz-Target
BODY json
{
"ClientToken": "",
"OrganizationId": "",
"DomainName": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.RegisterMailDomain");
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 \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.RegisterMailDomain" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ClientToken ""
:OrganizationId ""
:DomainName ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.RegisterMailDomain"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\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=WorkMailService.RegisterMailDomain"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\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=WorkMailService.RegisterMailDomain");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.RegisterMailDomain"
payload := strings.NewReader("{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\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: 67
{
"ClientToken": "",
"OrganizationId": "",
"DomainName": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.RegisterMailDomain")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.RegisterMailDomain"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.RegisterMailDomain")
.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=WorkMailService.RegisterMailDomain")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}")
.asString();
const data = JSON.stringify({
ClientToken: '',
OrganizationId: '',
DomainName: ''
});
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=WorkMailService.RegisterMailDomain');
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=WorkMailService.RegisterMailDomain',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ClientToken: '', OrganizationId: '', DomainName: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.RegisterMailDomain';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ClientToken":"","OrganizationId":"","DomainName":""}'
};
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=WorkMailService.RegisterMailDomain',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ClientToken": "",\n "OrganizationId": "",\n "DomainName": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.RegisterMailDomain")
.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({ClientToken: '', OrganizationId: '', DomainName: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.RegisterMailDomain',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {ClientToken: '', OrganizationId: '', DomainName: ''},
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=WorkMailService.RegisterMailDomain');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ClientToken: '',
OrganizationId: '',
DomainName: ''
});
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=WorkMailService.RegisterMailDomain',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ClientToken: '', OrganizationId: '', DomainName: ''}
};
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=WorkMailService.RegisterMailDomain';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ClientToken":"","OrganizationId":"","DomainName":""}'
};
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 = @{ @"ClientToken": @"",
@"OrganizationId": @"",
@"DomainName": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.RegisterMailDomain"]
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=WorkMailService.RegisterMailDomain" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.RegisterMailDomain",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ClientToken' => '',
'OrganizationId' => '',
'DomainName' => ''
]),
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=WorkMailService.RegisterMailDomain', [
'body' => '{
"ClientToken": "",
"OrganizationId": "",
"DomainName": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.RegisterMailDomain');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ClientToken' => '',
'OrganizationId' => '',
'DomainName' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ClientToken' => '',
'OrganizationId' => '',
'DomainName' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.RegisterMailDomain');
$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=WorkMailService.RegisterMailDomain' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ClientToken": "",
"OrganizationId": "",
"DomainName": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.RegisterMailDomain' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ClientToken": "",
"OrganizationId": "",
"DomainName": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\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=WorkMailService.RegisterMailDomain"
payload = {
"ClientToken": "",
"OrganizationId": "",
"DomainName": ""
}
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=WorkMailService.RegisterMailDomain"
payload <- "{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\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=WorkMailService.RegisterMailDomain")
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 \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\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 \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\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=WorkMailService.RegisterMailDomain";
let payload = json!({
"ClientToken": "",
"OrganizationId": "",
"DomainName": ""
});
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=WorkMailService.RegisterMailDomain' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ClientToken": "",
"OrganizationId": "",
"DomainName": ""
}'
echo '{
"ClientToken": "",
"OrganizationId": "",
"DomainName": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.RegisterMailDomain' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ClientToken": "",\n "OrganizationId": "",\n "DomainName": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.RegisterMailDomain'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"ClientToken": "",
"OrganizationId": "",
"DomainName": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.RegisterMailDomain")! 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
RegisterToWorkMail
{{baseUrl}}/#X-Amz-Target=WorkMailService.RegisterToWorkMail
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"EntityId": "",
"Email": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.RegisterToWorkMail");
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 \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Email\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.RegisterToWorkMail" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:EntityId ""
:Email ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.RegisterToWorkMail"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Email\": \"\"\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=WorkMailService.RegisterToWorkMail"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Email\": \"\"\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=WorkMailService.RegisterToWorkMail");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Email\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.RegisterToWorkMail"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Email\": \"\"\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: 59
{
"OrganizationId": "",
"EntityId": "",
"Email": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.RegisterToWorkMail")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Email\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.RegisterToWorkMail"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Email\": \"\"\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 \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Email\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.RegisterToWorkMail")
.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=WorkMailService.RegisterToWorkMail")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Email\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
EntityId: '',
Email: ''
});
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=WorkMailService.RegisterToWorkMail');
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=WorkMailService.RegisterToWorkMail',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', EntityId: '', Email: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.RegisterToWorkMail';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","EntityId":"","Email":""}'
};
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=WorkMailService.RegisterToWorkMail',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "EntityId": "",\n "Email": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Email\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.RegisterToWorkMail")
.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({OrganizationId: '', EntityId: '', Email: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.RegisterToWorkMail',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', EntityId: '', Email: ''},
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=WorkMailService.RegisterToWorkMail');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
EntityId: '',
Email: ''
});
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=WorkMailService.RegisterToWorkMail',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', EntityId: '', Email: ''}
};
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=WorkMailService.RegisterToWorkMail';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","EntityId":"","Email":""}'
};
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 = @{ @"OrganizationId": @"",
@"EntityId": @"",
@"Email": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.RegisterToWorkMail"]
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=WorkMailService.RegisterToWorkMail" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Email\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.RegisterToWorkMail",
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([
'OrganizationId' => '',
'EntityId' => '',
'Email' => ''
]),
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=WorkMailService.RegisterToWorkMail', [
'body' => '{
"OrganizationId": "",
"EntityId": "",
"Email": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.RegisterToWorkMail');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'EntityId' => '',
'Email' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'EntityId' => '',
'Email' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.RegisterToWorkMail');
$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=WorkMailService.RegisterToWorkMail' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"EntityId": "",
"Email": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.RegisterToWorkMail' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"EntityId": "",
"Email": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Email\": \"\"\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=WorkMailService.RegisterToWorkMail"
payload = {
"OrganizationId": "",
"EntityId": "",
"Email": ""
}
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=WorkMailService.RegisterToWorkMail"
payload <- "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Email\": \"\"\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=WorkMailService.RegisterToWorkMail")
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 \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Email\": \"\"\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 \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Email\": \"\"\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=WorkMailService.RegisterToWorkMail";
let payload = json!({
"OrganizationId": "",
"EntityId": "",
"Email": ""
});
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=WorkMailService.RegisterToWorkMail' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"EntityId": "",
"Email": ""
}'
echo '{
"OrganizationId": "",
"EntityId": "",
"Email": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.RegisterToWorkMail' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "EntityId": "",\n "Email": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.RegisterToWorkMail'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"EntityId": "",
"Email": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.RegisterToWorkMail")! 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
ResetPassword
{{baseUrl}}/#X-Amz-Target=WorkMailService.ResetPassword
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"UserId": "",
"Password": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.ResetPassword");
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 \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"Password\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.ResetPassword" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:UserId ""
:Password ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.ResetPassword"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"Password\": \"\"\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=WorkMailService.ResetPassword"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"Password\": \"\"\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=WorkMailService.ResetPassword");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"Password\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.ResetPassword"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"Password\": \"\"\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
{
"OrganizationId": "",
"UserId": "",
"Password": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.ResetPassword")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"Password\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.ResetPassword"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"Password\": \"\"\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 \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"Password\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.ResetPassword")
.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=WorkMailService.ResetPassword")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"Password\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
UserId: '',
Password: ''
});
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=WorkMailService.ResetPassword');
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=WorkMailService.ResetPassword',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', UserId: '', Password: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.ResetPassword';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","UserId":"","Password":""}'
};
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=WorkMailService.ResetPassword',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "UserId": "",\n "Password": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"Password\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.ResetPassword")
.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({OrganizationId: '', UserId: '', Password: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.ResetPassword',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', UserId: '', Password: ''},
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=WorkMailService.ResetPassword');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
UserId: '',
Password: ''
});
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=WorkMailService.ResetPassword',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', UserId: '', Password: ''}
};
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=WorkMailService.ResetPassword';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","UserId":"","Password":""}'
};
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 = @{ @"OrganizationId": @"",
@"UserId": @"",
@"Password": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.ResetPassword"]
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=WorkMailService.ResetPassword" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"Password\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.ResetPassword",
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([
'OrganizationId' => '',
'UserId' => '',
'Password' => ''
]),
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=WorkMailService.ResetPassword', [
'body' => '{
"OrganizationId": "",
"UserId": "",
"Password": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.ResetPassword');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'UserId' => '',
'Password' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'UserId' => '',
'Password' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.ResetPassword');
$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=WorkMailService.ResetPassword' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"UserId": "",
"Password": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.ResetPassword' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"UserId": "",
"Password": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"Password\": \"\"\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=WorkMailService.ResetPassword"
payload = {
"OrganizationId": "",
"UserId": "",
"Password": ""
}
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=WorkMailService.ResetPassword"
payload <- "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"Password\": \"\"\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=WorkMailService.ResetPassword")
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 \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"Password\": \"\"\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 \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"Password\": \"\"\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=WorkMailService.ResetPassword";
let payload = json!({
"OrganizationId": "",
"UserId": "",
"Password": ""
});
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=WorkMailService.ResetPassword' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"UserId": "",
"Password": ""
}'
echo '{
"OrganizationId": "",
"UserId": "",
"Password": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.ResetPassword' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "UserId": "",\n "Password": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.ResetPassword'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"UserId": "",
"Password": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.ResetPassword")! 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
StartMailboxExportJob
{{baseUrl}}/#X-Amz-Target=WorkMailService.StartMailboxExportJob
HEADERS
X-Amz-Target
BODY json
{
"ClientToken": "",
"OrganizationId": "",
"EntityId": "",
"Description": "",
"RoleArn": "",
"KmsKeyArn": "",
"S3BucketName": "",
"S3Prefix": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.StartMailboxExportJob");
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 \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"KmsKeyArn\": \"\",\n \"S3BucketName\": \"\",\n \"S3Prefix\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.StartMailboxExportJob" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ClientToken ""
:OrganizationId ""
:EntityId ""
:Description ""
:RoleArn ""
:KmsKeyArn ""
:S3BucketName ""
:S3Prefix ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.StartMailboxExportJob"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"KmsKeyArn\": \"\",\n \"S3BucketName\": \"\",\n \"S3Prefix\": \"\"\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=WorkMailService.StartMailboxExportJob"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"KmsKeyArn\": \"\",\n \"S3BucketName\": \"\",\n \"S3Prefix\": \"\"\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=WorkMailService.StartMailboxExportJob");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"KmsKeyArn\": \"\",\n \"S3BucketName\": \"\",\n \"S3Prefix\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.StartMailboxExportJob"
payload := strings.NewReader("{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"KmsKeyArn\": \"\",\n \"S3BucketName\": \"\",\n \"S3Prefix\": \"\"\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: 162
{
"ClientToken": "",
"OrganizationId": "",
"EntityId": "",
"Description": "",
"RoleArn": "",
"KmsKeyArn": "",
"S3BucketName": "",
"S3Prefix": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.StartMailboxExportJob")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"KmsKeyArn\": \"\",\n \"S3BucketName\": \"\",\n \"S3Prefix\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.StartMailboxExportJob"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"KmsKeyArn\": \"\",\n \"S3BucketName\": \"\",\n \"S3Prefix\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"KmsKeyArn\": \"\",\n \"S3BucketName\": \"\",\n \"S3Prefix\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.StartMailboxExportJob")
.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=WorkMailService.StartMailboxExportJob")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"KmsKeyArn\": \"\",\n \"S3BucketName\": \"\",\n \"S3Prefix\": \"\"\n}")
.asString();
const data = JSON.stringify({
ClientToken: '',
OrganizationId: '',
EntityId: '',
Description: '',
RoleArn: '',
KmsKeyArn: '',
S3BucketName: '',
S3Prefix: ''
});
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=WorkMailService.StartMailboxExportJob');
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=WorkMailService.StartMailboxExportJob',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
ClientToken: '',
OrganizationId: '',
EntityId: '',
Description: '',
RoleArn: '',
KmsKeyArn: '',
S3BucketName: '',
S3Prefix: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.StartMailboxExportJob';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ClientToken":"","OrganizationId":"","EntityId":"","Description":"","RoleArn":"","KmsKeyArn":"","S3BucketName":"","S3Prefix":""}'
};
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=WorkMailService.StartMailboxExportJob',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ClientToken": "",\n "OrganizationId": "",\n "EntityId": "",\n "Description": "",\n "RoleArn": "",\n "KmsKeyArn": "",\n "S3BucketName": "",\n "S3Prefix": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"KmsKeyArn\": \"\",\n \"S3BucketName\": \"\",\n \"S3Prefix\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.StartMailboxExportJob")
.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({
ClientToken: '',
OrganizationId: '',
EntityId: '',
Description: '',
RoleArn: '',
KmsKeyArn: '',
S3BucketName: '',
S3Prefix: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.StartMailboxExportJob',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
ClientToken: '',
OrganizationId: '',
EntityId: '',
Description: '',
RoleArn: '',
KmsKeyArn: '',
S3BucketName: '',
S3Prefix: ''
},
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=WorkMailService.StartMailboxExportJob');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ClientToken: '',
OrganizationId: '',
EntityId: '',
Description: '',
RoleArn: '',
KmsKeyArn: '',
S3BucketName: '',
S3Prefix: ''
});
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=WorkMailService.StartMailboxExportJob',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
ClientToken: '',
OrganizationId: '',
EntityId: '',
Description: '',
RoleArn: '',
KmsKeyArn: '',
S3BucketName: '',
S3Prefix: ''
}
};
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=WorkMailService.StartMailboxExportJob';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ClientToken":"","OrganizationId":"","EntityId":"","Description":"","RoleArn":"","KmsKeyArn":"","S3BucketName":"","S3Prefix":""}'
};
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 = @{ @"ClientToken": @"",
@"OrganizationId": @"",
@"EntityId": @"",
@"Description": @"",
@"RoleArn": @"",
@"KmsKeyArn": @"",
@"S3BucketName": @"",
@"S3Prefix": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.StartMailboxExportJob"]
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=WorkMailService.StartMailboxExportJob" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"KmsKeyArn\": \"\",\n \"S3BucketName\": \"\",\n \"S3Prefix\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.StartMailboxExportJob",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ClientToken' => '',
'OrganizationId' => '',
'EntityId' => '',
'Description' => '',
'RoleArn' => '',
'KmsKeyArn' => '',
'S3BucketName' => '',
'S3Prefix' => ''
]),
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=WorkMailService.StartMailboxExportJob', [
'body' => '{
"ClientToken": "",
"OrganizationId": "",
"EntityId": "",
"Description": "",
"RoleArn": "",
"KmsKeyArn": "",
"S3BucketName": "",
"S3Prefix": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.StartMailboxExportJob');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ClientToken' => '',
'OrganizationId' => '',
'EntityId' => '',
'Description' => '',
'RoleArn' => '',
'KmsKeyArn' => '',
'S3BucketName' => '',
'S3Prefix' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ClientToken' => '',
'OrganizationId' => '',
'EntityId' => '',
'Description' => '',
'RoleArn' => '',
'KmsKeyArn' => '',
'S3BucketName' => '',
'S3Prefix' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.StartMailboxExportJob');
$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=WorkMailService.StartMailboxExportJob' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ClientToken": "",
"OrganizationId": "",
"EntityId": "",
"Description": "",
"RoleArn": "",
"KmsKeyArn": "",
"S3BucketName": "",
"S3Prefix": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.StartMailboxExportJob' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ClientToken": "",
"OrganizationId": "",
"EntityId": "",
"Description": "",
"RoleArn": "",
"KmsKeyArn": "",
"S3BucketName": "",
"S3Prefix": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"KmsKeyArn\": \"\",\n \"S3BucketName\": \"\",\n \"S3Prefix\": \"\"\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=WorkMailService.StartMailboxExportJob"
payload = {
"ClientToken": "",
"OrganizationId": "",
"EntityId": "",
"Description": "",
"RoleArn": "",
"KmsKeyArn": "",
"S3BucketName": "",
"S3Prefix": ""
}
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=WorkMailService.StartMailboxExportJob"
payload <- "{\n \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"KmsKeyArn\": \"\",\n \"S3BucketName\": \"\",\n \"S3Prefix\": \"\"\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=WorkMailService.StartMailboxExportJob")
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 \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"KmsKeyArn\": \"\",\n \"S3BucketName\": \"\",\n \"S3Prefix\": \"\"\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 \"ClientToken\": \"\",\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"KmsKeyArn\": \"\",\n \"S3BucketName\": \"\",\n \"S3Prefix\": \"\"\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=WorkMailService.StartMailboxExportJob";
let payload = json!({
"ClientToken": "",
"OrganizationId": "",
"EntityId": "",
"Description": "",
"RoleArn": "",
"KmsKeyArn": "",
"S3BucketName": "",
"S3Prefix": ""
});
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=WorkMailService.StartMailboxExportJob' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ClientToken": "",
"OrganizationId": "",
"EntityId": "",
"Description": "",
"RoleArn": "",
"KmsKeyArn": "",
"S3BucketName": "",
"S3Prefix": ""
}'
echo '{
"ClientToken": "",
"OrganizationId": "",
"EntityId": "",
"Description": "",
"RoleArn": "",
"KmsKeyArn": "",
"S3BucketName": "",
"S3Prefix": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.StartMailboxExportJob' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ClientToken": "",\n "OrganizationId": "",\n "EntityId": "",\n "Description": "",\n "RoleArn": "",\n "KmsKeyArn": "",\n "S3BucketName": "",\n "S3Prefix": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.StartMailboxExportJob'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"ClientToken": "",
"OrganizationId": "",
"EntityId": "",
"Description": "",
"RoleArn": "",
"KmsKeyArn": "",
"S3BucketName": "",
"S3Prefix": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.StartMailboxExportJob")! 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=WorkMailService.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=WorkMailService.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=WorkMailService.TagResource" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ResourceARN ""
:Tags ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.TagResource', [
'body' => '{
"ResourceARN": "",
"Tags": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.TagResource' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ResourceARN": "",
"Tags": ""
}'
echo '{
"ResourceARN": "",
"Tags": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.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=WorkMailService.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=WorkMailService.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
TestAvailabilityConfiguration
{{baseUrl}}/#X-Amz-Target=WorkMailService.TestAvailabilityConfiguration
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"DomainName": "",
"EwsProvider": {
"EwsEndpoint": "",
"EwsUsername": "",
"EwsPassword": ""
},
"LambdaProvider": {
"LambdaArn": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.TestAvailabilityConfiguration");
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 \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": {\n \"EwsEndpoint\": \"\",\n \"EwsUsername\": \"\",\n \"EwsPassword\": \"\"\n },\n \"LambdaProvider\": {\n \"LambdaArn\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.TestAvailabilityConfiguration" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:DomainName ""
:EwsProvider {:EwsEndpoint ""
:EwsUsername ""
:EwsPassword ""}
:LambdaProvider {:LambdaArn ""}}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.TestAvailabilityConfiguration"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": {\n \"EwsEndpoint\": \"\",\n \"EwsUsername\": \"\",\n \"EwsPassword\": \"\"\n },\n \"LambdaProvider\": {\n \"LambdaArn\": \"\"\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=WorkMailService.TestAvailabilityConfiguration"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": {\n \"EwsEndpoint\": \"\",\n \"EwsUsername\": \"\",\n \"EwsPassword\": \"\"\n },\n \"LambdaProvider\": {\n \"LambdaArn\": \"\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=WorkMailService.TestAvailabilityConfiguration");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": {\n \"EwsEndpoint\": \"\",\n \"EwsUsername\": \"\",\n \"EwsPassword\": \"\"\n },\n \"LambdaProvider\": {\n \"LambdaArn\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.TestAvailabilityConfiguration"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": {\n \"EwsEndpoint\": \"\",\n \"EwsUsername\": \"\",\n \"EwsPassword\": \"\"\n },\n \"LambdaProvider\": {\n \"LambdaArn\": \"\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 185
{
"OrganizationId": "",
"DomainName": "",
"EwsProvider": {
"EwsEndpoint": "",
"EwsUsername": "",
"EwsPassword": ""
},
"LambdaProvider": {
"LambdaArn": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.TestAvailabilityConfiguration")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": {\n \"EwsEndpoint\": \"\",\n \"EwsUsername\": \"\",\n \"EwsPassword\": \"\"\n },\n \"LambdaProvider\": {\n \"LambdaArn\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.TestAvailabilityConfiguration"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": {\n \"EwsEndpoint\": \"\",\n \"EwsUsername\": \"\",\n \"EwsPassword\": \"\"\n },\n \"LambdaProvider\": {\n \"LambdaArn\": \"\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": {\n \"EwsEndpoint\": \"\",\n \"EwsUsername\": \"\",\n \"EwsPassword\": \"\"\n },\n \"LambdaProvider\": {\n \"LambdaArn\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.TestAvailabilityConfiguration")
.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=WorkMailService.TestAvailabilityConfiguration")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": {\n \"EwsEndpoint\": \"\",\n \"EwsUsername\": \"\",\n \"EwsPassword\": \"\"\n },\n \"LambdaProvider\": {\n \"LambdaArn\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
DomainName: '',
EwsProvider: {
EwsEndpoint: '',
EwsUsername: '',
EwsPassword: ''
},
LambdaProvider: {
LambdaArn: ''
}
});
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=WorkMailService.TestAvailabilityConfiguration');
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=WorkMailService.TestAvailabilityConfiguration',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
OrganizationId: '',
DomainName: '',
EwsProvider: {EwsEndpoint: '', EwsUsername: '', EwsPassword: ''},
LambdaProvider: {LambdaArn: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.TestAvailabilityConfiguration';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","DomainName":"","EwsProvider":{"EwsEndpoint":"","EwsUsername":"","EwsPassword":""},"LambdaProvider":{"LambdaArn":""}}'
};
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=WorkMailService.TestAvailabilityConfiguration',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "DomainName": "",\n "EwsProvider": {\n "EwsEndpoint": "",\n "EwsUsername": "",\n "EwsPassword": ""\n },\n "LambdaProvider": {\n "LambdaArn": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": {\n \"EwsEndpoint\": \"\",\n \"EwsUsername\": \"\",\n \"EwsPassword\": \"\"\n },\n \"LambdaProvider\": {\n \"LambdaArn\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.TestAvailabilityConfiguration")
.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({
OrganizationId: '',
DomainName: '',
EwsProvider: {EwsEndpoint: '', EwsUsername: '', EwsPassword: ''},
LambdaProvider: {LambdaArn: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.TestAvailabilityConfiguration',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
OrganizationId: '',
DomainName: '',
EwsProvider: {EwsEndpoint: '', EwsUsername: '', EwsPassword: ''},
LambdaProvider: {LambdaArn: ''}
},
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=WorkMailService.TestAvailabilityConfiguration');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
DomainName: '',
EwsProvider: {
EwsEndpoint: '',
EwsUsername: '',
EwsPassword: ''
},
LambdaProvider: {
LambdaArn: ''
}
});
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=WorkMailService.TestAvailabilityConfiguration',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
OrganizationId: '',
DomainName: '',
EwsProvider: {EwsEndpoint: '', EwsUsername: '', EwsPassword: ''},
LambdaProvider: {LambdaArn: ''}
}
};
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=WorkMailService.TestAvailabilityConfiguration';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","DomainName":"","EwsProvider":{"EwsEndpoint":"","EwsUsername":"","EwsPassword":""},"LambdaProvider":{"LambdaArn":""}}'
};
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 = @{ @"OrganizationId": @"",
@"DomainName": @"",
@"EwsProvider": @{ @"EwsEndpoint": @"", @"EwsUsername": @"", @"EwsPassword": @"" },
@"LambdaProvider": @{ @"LambdaArn": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.TestAvailabilityConfiguration"]
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=WorkMailService.TestAvailabilityConfiguration" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": {\n \"EwsEndpoint\": \"\",\n \"EwsUsername\": \"\",\n \"EwsPassword\": \"\"\n },\n \"LambdaProvider\": {\n \"LambdaArn\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.TestAvailabilityConfiguration",
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([
'OrganizationId' => '',
'DomainName' => '',
'EwsProvider' => [
'EwsEndpoint' => '',
'EwsUsername' => '',
'EwsPassword' => ''
],
'LambdaProvider' => [
'LambdaArn' => ''
]
]),
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=WorkMailService.TestAvailabilityConfiguration', [
'body' => '{
"OrganizationId": "",
"DomainName": "",
"EwsProvider": {
"EwsEndpoint": "",
"EwsUsername": "",
"EwsPassword": ""
},
"LambdaProvider": {
"LambdaArn": ""
}
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.TestAvailabilityConfiguration');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'DomainName' => '',
'EwsProvider' => [
'EwsEndpoint' => '',
'EwsUsername' => '',
'EwsPassword' => ''
],
'LambdaProvider' => [
'LambdaArn' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'DomainName' => '',
'EwsProvider' => [
'EwsEndpoint' => '',
'EwsUsername' => '',
'EwsPassword' => ''
],
'LambdaProvider' => [
'LambdaArn' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.TestAvailabilityConfiguration');
$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=WorkMailService.TestAvailabilityConfiguration' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"DomainName": "",
"EwsProvider": {
"EwsEndpoint": "",
"EwsUsername": "",
"EwsPassword": ""
},
"LambdaProvider": {
"LambdaArn": ""
}
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.TestAvailabilityConfiguration' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"DomainName": "",
"EwsProvider": {
"EwsEndpoint": "",
"EwsUsername": "",
"EwsPassword": ""
},
"LambdaProvider": {
"LambdaArn": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": {\n \"EwsEndpoint\": \"\",\n \"EwsUsername\": \"\",\n \"EwsPassword\": \"\"\n },\n \"LambdaProvider\": {\n \"LambdaArn\": \"\"\n }\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.TestAvailabilityConfiguration"
payload = {
"OrganizationId": "",
"DomainName": "",
"EwsProvider": {
"EwsEndpoint": "",
"EwsUsername": "",
"EwsPassword": ""
},
"LambdaProvider": { "LambdaArn": "" }
}
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=WorkMailService.TestAvailabilityConfiguration"
payload <- "{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": {\n \"EwsEndpoint\": \"\",\n \"EwsUsername\": \"\",\n \"EwsPassword\": \"\"\n },\n \"LambdaProvider\": {\n \"LambdaArn\": \"\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=WorkMailService.TestAvailabilityConfiguration")
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 \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": {\n \"EwsEndpoint\": \"\",\n \"EwsUsername\": \"\",\n \"EwsPassword\": \"\"\n },\n \"LambdaProvider\": {\n \"LambdaArn\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": {\n \"EwsEndpoint\": \"\",\n \"EwsUsername\": \"\",\n \"EwsPassword\": \"\"\n },\n \"LambdaProvider\": {\n \"LambdaArn\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.TestAvailabilityConfiguration";
let payload = json!({
"OrganizationId": "",
"DomainName": "",
"EwsProvider": json!({
"EwsEndpoint": "",
"EwsUsername": "",
"EwsPassword": ""
}),
"LambdaProvider": json!({"LambdaArn": ""})
});
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=WorkMailService.TestAvailabilityConfiguration' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"DomainName": "",
"EwsProvider": {
"EwsEndpoint": "",
"EwsUsername": "",
"EwsPassword": ""
},
"LambdaProvider": {
"LambdaArn": ""
}
}'
echo '{
"OrganizationId": "",
"DomainName": "",
"EwsProvider": {
"EwsEndpoint": "",
"EwsUsername": "",
"EwsPassword": ""
},
"LambdaProvider": {
"LambdaArn": ""
}
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.TestAvailabilityConfiguration' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "DomainName": "",\n "EwsProvider": {\n "EwsEndpoint": "",\n "EwsUsername": "",\n "EwsPassword": ""\n },\n "LambdaProvider": {\n "LambdaArn": ""\n }\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.TestAvailabilityConfiguration'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"DomainName": "",
"EwsProvider": [
"EwsEndpoint": "",
"EwsUsername": "",
"EwsPassword": ""
],
"LambdaProvider": ["LambdaArn": ""]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.TestAvailabilityConfiguration")! 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=WorkMailService.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=WorkMailService.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=WorkMailService.UntagResource" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ResourceARN ""
:TagKeys ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.UntagResource', [
'body' => '{
"ResourceARN": "",
"TagKeys": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.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=WorkMailService.UntagResource' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ResourceARN": "",
"TagKeys": ""
}'
echo '{
"ResourceARN": "",
"TagKeys": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.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=WorkMailService.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=WorkMailService.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
UpdateAvailabilityConfiguration
{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateAvailabilityConfiguration
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"DomainName": "",
"EwsProvider": "",
"LambdaProvider": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateAvailabilityConfiguration");
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 \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": \"\",\n \"LambdaProvider\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateAvailabilityConfiguration" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:DomainName ""
:EwsProvider ""
:LambdaProvider ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateAvailabilityConfiguration"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": \"\",\n \"LambdaProvider\": \"\"\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=WorkMailService.UpdateAvailabilityConfiguration"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": \"\",\n \"LambdaProvider\": \"\"\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=WorkMailService.UpdateAvailabilityConfiguration");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": \"\",\n \"LambdaProvider\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateAvailabilityConfiguration"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": \"\",\n \"LambdaProvider\": \"\"\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
{
"OrganizationId": "",
"DomainName": "",
"EwsProvider": "",
"LambdaProvider": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateAvailabilityConfiguration")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": \"\",\n \"LambdaProvider\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateAvailabilityConfiguration"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": \"\",\n \"LambdaProvider\": \"\"\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 \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": \"\",\n \"LambdaProvider\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateAvailabilityConfiguration")
.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=WorkMailService.UpdateAvailabilityConfiguration")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": \"\",\n \"LambdaProvider\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
DomainName: '',
EwsProvider: '',
LambdaProvider: ''
});
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=WorkMailService.UpdateAvailabilityConfiguration');
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=WorkMailService.UpdateAvailabilityConfiguration',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', DomainName: '', EwsProvider: '', LambdaProvider: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateAvailabilityConfiguration';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","DomainName":"","EwsProvider":"","LambdaProvider":""}'
};
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=WorkMailService.UpdateAvailabilityConfiguration',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "DomainName": "",\n "EwsProvider": "",\n "LambdaProvider": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": \"\",\n \"LambdaProvider\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateAvailabilityConfiguration")
.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({OrganizationId: '', DomainName: '', EwsProvider: '', LambdaProvider: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateAvailabilityConfiguration',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', DomainName: '', EwsProvider: '', LambdaProvider: ''},
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=WorkMailService.UpdateAvailabilityConfiguration');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
DomainName: '',
EwsProvider: '',
LambdaProvider: ''
});
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=WorkMailService.UpdateAvailabilityConfiguration',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', DomainName: '', EwsProvider: '', LambdaProvider: ''}
};
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=WorkMailService.UpdateAvailabilityConfiguration';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","DomainName":"","EwsProvider":"","LambdaProvider":""}'
};
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 = @{ @"OrganizationId": @"",
@"DomainName": @"",
@"EwsProvider": @"",
@"LambdaProvider": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateAvailabilityConfiguration"]
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=WorkMailService.UpdateAvailabilityConfiguration" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": \"\",\n \"LambdaProvider\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateAvailabilityConfiguration",
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([
'OrganizationId' => '',
'DomainName' => '',
'EwsProvider' => '',
'LambdaProvider' => ''
]),
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=WorkMailService.UpdateAvailabilityConfiguration', [
'body' => '{
"OrganizationId": "",
"DomainName": "",
"EwsProvider": "",
"LambdaProvider": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateAvailabilityConfiguration');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'DomainName' => '',
'EwsProvider' => '',
'LambdaProvider' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'DomainName' => '',
'EwsProvider' => '',
'LambdaProvider' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateAvailabilityConfiguration');
$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=WorkMailService.UpdateAvailabilityConfiguration' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"DomainName": "",
"EwsProvider": "",
"LambdaProvider": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateAvailabilityConfiguration' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"DomainName": "",
"EwsProvider": "",
"LambdaProvider": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": \"\",\n \"LambdaProvider\": \"\"\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=WorkMailService.UpdateAvailabilityConfiguration"
payload = {
"OrganizationId": "",
"DomainName": "",
"EwsProvider": "",
"LambdaProvider": ""
}
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=WorkMailService.UpdateAvailabilityConfiguration"
payload <- "{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": \"\",\n \"LambdaProvider\": \"\"\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=WorkMailService.UpdateAvailabilityConfiguration")
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 \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": \"\",\n \"LambdaProvider\": \"\"\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 \"OrganizationId\": \"\",\n \"DomainName\": \"\",\n \"EwsProvider\": \"\",\n \"LambdaProvider\": \"\"\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=WorkMailService.UpdateAvailabilityConfiguration";
let payload = json!({
"OrganizationId": "",
"DomainName": "",
"EwsProvider": "",
"LambdaProvider": ""
});
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=WorkMailService.UpdateAvailabilityConfiguration' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"DomainName": "",
"EwsProvider": "",
"LambdaProvider": ""
}'
echo '{
"OrganizationId": "",
"DomainName": "",
"EwsProvider": "",
"LambdaProvider": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateAvailabilityConfiguration' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "DomainName": "",\n "EwsProvider": "",\n "LambdaProvider": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateAvailabilityConfiguration'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"DomainName": "",
"EwsProvider": "",
"LambdaProvider": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateAvailabilityConfiguration")! 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
UpdateDefaultMailDomain
{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateDefaultMailDomain
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"DomainName": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateDefaultMailDomain");
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 \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateDefaultMailDomain" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:DomainName ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateDefaultMailDomain"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\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=WorkMailService.UpdateDefaultMailDomain"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\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=WorkMailService.UpdateDefaultMailDomain");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateDefaultMailDomain"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 46
{
"OrganizationId": "",
"DomainName": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateDefaultMailDomain")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateDefaultMailDomain"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\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 \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateDefaultMailDomain")
.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=WorkMailService.UpdateDefaultMailDomain")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
DomainName: ''
});
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=WorkMailService.UpdateDefaultMailDomain');
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=WorkMailService.UpdateDefaultMailDomain',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', DomainName: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateDefaultMailDomain';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","DomainName":""}'
};
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=WorkMailService.UpdateDefaultMailDomain',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "DomainName": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateDefaultMailDomain")
.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({OrganizationId: '', DomainName: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateDefaultMailDomain',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', DomainName: ''},
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=WorkMailService.UpdateDefaultMailDomain');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
DomainName: ''
});
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=WorkMailService.UpdateDefaultMailDomain',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', DomainName: ''}
};
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=WorkMailService.UpdateDefaultMailDomain';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","DomainName":""}'
};
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 = @{ @"OrganizationId": @"",
@"DomainName": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateDefaultMailDomain"]
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=WorkMailService.UpdateDefaultMailDomain" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateDefaultMailDomain",
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([
'OrganizationId' => '',
'DomainName' => ''
]),
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=WorkMailService.UpdateDefaultMailDomain', [
'body' => '{
"OrganizationId": "",
"DomainName": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateDefaultMailDomain');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'DomainName' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'DomainName' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateDefaultMailDomain');
$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=WorkMailService.UpdateDefaultMailDomain' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"DomainName": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateDefaultMailDomain' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"DomainName": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\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=WorkMailService.UpdateDefaultMailDomain"
payload = {
"OrganizationId": "",
"DomainName": ""
}
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=WorkMailService.UpdateDefaultMailDomain"
payload <- "{\n \"OrganizationId\": \"\",\n \"DomainName\": \"\"\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=WorkMailService.UpdateDefaultMailDomain")
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 \"OrganizationId\": \"\",\n \"DomainName\": \"\"\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 \"OrganizationId\": \"\",\n \"DomainName\": \"\"\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=WorkMailService.UpdateDefaultMailDomain";
let payload = json!({
"OrganizationId": "",
"DomainName": ""
});
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=WorkMailService.UpdateDefaultMailDomain' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"DomainName": ""
}'
echo '{
"OrganizationId": "",
"DomainName": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateDefaultMailDomain' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "DomainName": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateDefaultMailDomain'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"DomainName": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateDefaultMailDomain")! 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
UpdateImpersonationRole
{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateImpersonationRole
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"ImpersonationRoleId": "",
"Name": "",
"Type": "",
"Description": "",
"Rules": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateImpersonationRole");
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 \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\",\n \"Description\": \"\",\n \"Rules\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateImpersonationRole" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:ImpersonationRoleId ""
:Name ""
:Type ""
:Description ""
:Rules ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateImpersonationRole"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\",\n \"Description\": \"\",\n \"Rules\": \"\"\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=WorkMailService.UpdateImpersonationRole"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\",\n \"Description\": \"\",\n \"Rules\": \"\"\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=WorkMailService.UpdateImpersonationRole");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\",\n \"Description\": \"\",\n \"Rules\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateImpersonationRole"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\",\n \"Description\": \"\",\n \"Rules\": \"\"\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: 119
{
"OrganizationId": "",
"ImpersonationRoleId": "",
"Name": "",
"Type": "",
"Description": "",
"Rules": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateImpersonationRole")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\",\n \"Description\": \"\",\n \"Rules\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateImpersonationRole"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\",\n \"Description\": \"\",\n \"Rules\": \"\"\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 \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\",\n \"Description\": \"\",\n \"Rules\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateImpersonationRole")
.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=WorkMailService.UpdateImpersonationRole")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\",\n \"Description\": \"\",\n \"Rules\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
ImpersonationRoleId: '',
Name: '',
Type: '',
Description: '',
Rules: ''
});
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=WorkMailService.UpdateImpersonationRole');
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=WorkMailService.UpdateImpersonationRole',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
OrganizationId: '',
ImpersonationRoleId: '',
Name: '',
Type: '',
Description: '',
Rules: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateImpersonationRole';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","ImpersonationRoleId":"","Name":"","Type":"","Description":"","Rules":""}'
};
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=WorkMailService.UpdateImpersonationRole',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "ImpersonationRoleId": "",\n "Name": "",\n "Type": "",\n "Description": "",\n "Rules": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\",\n \"Description\": \"\",\n \"Rules\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateImpersonationRole")
.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({
OrganizationId: '',
ImpersonationRoleId: '',
Name: '',
Type: '',
Description: '',
Rules: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateImpersonationRole',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
OrganizationId: '',
ImpersonationRoleId: '',
Name: '',
Type: '',
Description: '',
Rules: ''
},
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=WorkMailService.UpdateImpersonationRole');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
ImpersonationRoleId: '',
Name: '',
Type: '',
Description: '',
Rules: ''
});
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=WorkMailService.UpdateImpersonationRole',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
OrganizationId: '',
ImpersonationRoleId: '',
Name: '',
Type: '',
Description: '',
Rules: ''
}
};
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=WorkMailService.UpdateImpersonationRole';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","ImpersonationRoleId":"","Name":"","Type":"","Description":"","Rules":""}'
};
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 = @{ @"OrganizationId": @"",
@"ImpersonationRoleId": @"",
@"Name": @"",
@"Type": @"",
@"Description": @"",
@"Rules": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateImpersonationRole"]
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=WorkMailService.UpdateImpersonationRole" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\",\n \"Description\": \"\",\n \"Rules\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateImpersonationRole",
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([
'OrganizationId' => '',
'ImpersonationRoleId' => '',
'Name' => '',
'Type' => '',
'Description' => '',
'Rules' => ''
]),
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=WorkMailService.UpdateImpersonationRole', [
'body' => '{
"OrganizationId": "",
"ImpersonationRoleId": "",
"Name": "",
"Type": "",
"Description": "",
"Rules": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateImpersonationRole');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'ImpersonationRoleId' => '',
'Name' => '',
'Type' => '',
'Description' => '',
'Rules' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'ImpersonationRoleId' => '',
'Name' => '',
'Type' => '',
'Description' => '',
'Rules' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateImpersonationRole');
$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=WorkMailService.UpdateImpersonationRole' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"ImpersonationRoleId": "",
"Name": "",
"Type": "",
"Description": "",
"Rules": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateImpersonationRole' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"ImpersonationRoleId": "",
"Name": "",
"Type": "",
"Description": "",
"Rules": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\",\n \"Description\": \"\",\n \"Rules\": \"\"\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=WorkMailService.UpdateImpersonationRole"
payload = {
"OrganizationId": "",
"ImpersonationRoleId": "",
"Name": "",
"Type": "",
"Description": "",
"Rules": ""
}
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=WorkMailService.UpdateImpersonationRole"
payload <- "{\n \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\",\n \"Description\": \"\",\n \"Rules\": \"\"\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=WorkMailService.UpdateImpersonationRole")
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 \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\",\n \"Description\": \"\",\n \"Rules\": \"\"\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 \"OrganizationId\": \"\",\n \"ImpersonationRoleId\": \"\",\n \"Name\": \"\",\n \"Type\": \"\",\n \"Description\": \"\",\n \"Rules\": \"\"\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=WorkMailService.UpdateImpersonationRole";
let payload = json!({
"OrganizationId": "",
"ImpersonationRoleId": "",
"Name": "",
"Type": "",
"Description": "",
"Rules": ""
});
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=WorkMailService.UpdateImpersonationRole' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"ImpersonationRoleId": "",
"Name": "",
"Type": "",
"Description": "",
"Rules": ""
}'
echo '{
"OrganizationId": "",
"ImpersonationRoleId": "",
"Name": "",
"Type": "",
"Description": "",
"Rules": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateImpersonationRole' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "ImpersonationRoleId": "",\n "Name": "",\n "Type": "",\n "Description": "",\n "Rules": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateImpersonationRole'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"ImpersonationRoleId": "",
"Name": "",
"Type": "",
"Description": "",
"Rules": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateImpersonationRole")! 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
UpdateMailboxQuota
{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateMailboxQuota
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"UserId": "",
"MailboxQuota": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateMailboxQuota");
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 \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"MailboxQuota\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateMailboxQuota" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:UserId ""
:MailboxQuota ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateMailboxQuota"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"MailboxQuota\": \"\"\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=WorkMailService.UpdateMailboxQuota"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"MailboxQuota\": \"\"\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=WorkMailService.UpdateMailboxQuota");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"MailboxQuota\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateMailboxQuota"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"MailboxQuota\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 64
{
"OrganizationId": "",
"UserId": "",
"MailboxQuota": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateMailboxQuota")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"MailboxQuota\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateMailboxQuota"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"MailboxQuota\": \"\"\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 \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"MailboxQuota\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateMailboxQuota")
.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=WorkMailService.UpdateMailboxQuota")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"MailboxQuota\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
UserId: '',
MailboxQuota: ''
});
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=WorkMailService.UpdateMailboxQuota');
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=WorkMailService.UpdateMailboxQuota',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', UserId: '', MailboxQuota: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateMailboxQuota';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","UserId":"","MailboxQuota":""}'
};
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=WorkMailService.UpdateMailboxQuota',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "UserId": "",\n "MailboxQuota": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"MailboxQuota\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateMailboxQuota")
.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({OrganizationId: '', UserId: '', MailboxQuota: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateMailboxQuota',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', UserId: '', MailboxQuota: ''},
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=WorkMailService.UpdateMailboxQuota');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
UserId: '',
MailboxQuota: ''
});
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=WorkMailService.UpdateMailboxQuota',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', UserId: '', MailboxQuota: ''}
};
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=WorkMailService.UpdateMailboxQuota';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","UserId":"","MailboxQuota":""}'
};
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 = @{ @"OrganizationId": @"",
@"UserId": @"",
@"MailboxQuota": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateMailboxQuota"]
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=WorkMailService.UpdateMailboxQuota" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"MailboxQuota\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateMailboxQuota",
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([
'OrganizationId' => '',
'UserId' => '',
'MailboxQuota' => ''
]),
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=WorkMailService.UpdateMailboxQuota', [
'body' => '{
"OrganizationId": "",
"UserId": "",
"MailboxQuota": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateMailboxQuota');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'UserId' => '',
'MailboxQuota' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'UserId' => '',
'MailboxQuota' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateMailboxQuota');
$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=WorkMailService.UpdateMailboxQuota' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"UserId": "",
"MailboxQuota": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateMailboxQuota' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"UserId": "",
"MailboxQuota": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"MailboxQuota\": \"\"\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=WorkMailService.UpdateMailboxQuota"
payload = {
"OrganizationId": "",
"UserId": "",
"MailboxQuota": ""
}
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=WorkMailService.UpdateMailboxQuota"
payload <- "{\n \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"MailboxQuota\": \"\"\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=WorkMailService.UpdateMailboxQuota")
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 \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"MailboxQuota\": \"\"\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 \"OrganizationId\": \"\",\n \"UserId\": \"\",\n \"MailboxQuota\": \"\"\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=WorkMailService.UpdateMailboxQuota";
let payload = json!({
"OrganizationId": "",
"UserId": "",
"MailboxQuota": ""
});
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=WorkMailService.UpdateMailboxQuota' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"UserId": "",
"MailboxQuota": ""
}'
echo '{
"OrganizationId": "",
"UserId": "",
"MailboxQuota": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateMailboxQuota' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "UserId": "",\n "MailboxQuota": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateMailboxQuota'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"UserId": "",
"MailboxQuota": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateMailboxQuota")! 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
UpdateMobileDeviceAccessRule
{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateMobileDeviceAccessRule
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"MobileDeviceAccessRuleId": "",
"Name": "",
"Description": "",
"Effect": "",
"DeviceTypes": "",
"NotDeviceTypes": "",
"DeviceModels": "",
"NotDeviceModels": "",
"DeviceOperatingSystems": "",
"NotDeviceOperatingSystems": "",
"DeviceUserAgents": "",
"NotDeviceUserAgents": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateMobileDeviceAccessRule");
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 \"OrganizationId\": \"\",\n \"MobileDeviceAccessRuleId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Effect\": \"\",\n \"DeviceTypes\": \"\",\n \"NotDeviceTypes\": \"\",\n \"DeviceModels\": \"\",\n \"NotDeviceModels\": \"\",\n \"DeviceOperatingSystems\": \"\",\n \"NotDeviceOperatingSystems\": \"\",\n \"DeviceUserAgents\": \"\",\n \"NotDeviceUserAgents\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateMobileDeviceAccessRule" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:MobileDeviceAccessRuleId ""
:Name ""
:Description ""
:Effect ""
:DeviceTypes ""
:NotDeviceTypes ""
:DeviceModels ""
:NotDeviceModels ""
:DeviceOperatingSystems ""
:NotDeviceOperatingSystems ""
:DeviceUserAgents ""
:NotDeviceUserAgents ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateMobileDeviceAccessRule"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"MobileDeviceAccessRuleId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Effect\": \"\",\n \"DeviceTypes\": \"\",\n \"NotDeviceTypes\": \"\",\n \"DeviceModels\": \"\",\n \"NotDeviceModels\": \"\",\n \"DeviceOperatingSystems\": \"\",\n \"NotDeviceOperatingSystems\": \"\",\n \"DeviceUserAgents\": \"\",\n \"NotDeviceUserAgents\": \"\"\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=WorkMailService.UpdateMobileDeviceAccessRule"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"MobileDeviceAccessRuleId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Effect\": \"\",\n \"DeviceTypes\": \"\",\n \"NotDeviceTypes\": \"\",\n \"DeviceModels\": \"\",\n \"NotDeviceModels\": \"\",\n \"DeviceOperatingSystems\": \"\",\n \"NotDeviceOperatingSystems\": \"\",\n \"DeviceUserAgents\": \"\",\n \"NotDeviceUserAgents\": \"\"\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=WorkMailService.UpdateMobileDeviceAccessRule");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"MobileDeviceAccessRuleId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Effect\": \"\",\n \"DeviceTypes\": \"\",\n \"NotDeviceTypes\": \"\",\n \"DeviceModels\": \"\",\n \"NotDeviceModels\": \"\",\n \"DeviceOperatingSystems\": \"\",\n \"NotDeviceOperatingSystems\": \"\",\n \"DeviceUserAgents\": \"\",\n \"NotDeviceUserAgents\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateMobileDeviceAccessRule"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"MobileDeviceAccessRuleId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Effect\": \"\",\n \"DeviceTypes\": \"\",\n \"NotDeviceTypes\": \"\",\n \"DeviceModels\": \"\",\n \"NotDeviceModels\": \"\",\n \"DeviceOperatingSystems\": \"\",\n \"NotDeviceOperatingSystems\": \"\",\n \"DeviceUserAgents\": \"\",\n \"NotDeviceUserAgents\": \"\"\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: 325
{
"OrganizationId": "",
"MobileDeviceAccessRuleId": "",
"Name": "",
"Description": "",
"Effect": "",
"DeviceTypes": "",
"NotDeviceTypes": "",
"DeviceModels": "",
"NotDeviceModels": "",
"DeviceOperatingSystems": "",
"NotDeviceOperatingSystems": "",
"DeviceUserAgents": "",
"NotDeviceUserAgents": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateMobileDeviceAccessRule")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"MobileDeviceAccessRuleId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Effect\": \"\",\n \"DeviceTypes\": \"\",\n \"NotDeviceTypes\": \"\",\n \"DeviceModels\": \"\",\n \"NotDeviceModels\": \"\",\n \"DeviceOperatingSystems\": \"\",\n \"NotDeviceOperatingSystems\": \"\",\n \"DeviceUserAgents\": \"\",\n \"NotDeviceUserAgents\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateMobileDeviceAccessRule"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"MobileDeviceAccessRuleId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Effect\": \"\",\n \"DeviceTypes\": \"\",\n \"NotDeviceTypes\": \"\",\n \"DeviceModels\": \"\",\n \"NotDeviceModels\": \"\",\n \"DeviceOperatingSystems\": \"\",\n \"NotDeviceOperatingSystems\": \"\",\n \"DeviceUserAgents\": \"\",\n \"NotDeviceUserAgents\": \"\"\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 \"OrganizationId\": \"\",\n \"MobileDeviceAccessRuleId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Effect\": \"\",\n \"DeviceTypes\": \"\",\n \"NotDeviceTypes\": \"\",\n \"DeviceModels\": \"\",\n \"NotDeviceModels\": \"\",\n \"DeviceOperatingSystems\": \"\",\n \"NotDeviceOperatingSystems\": \"\",\n \"DeviceUserAgents\": \"\",\n \"NotDeviceUserAgents\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateMobileDeviceAccessRule")
.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=WorkMailService.UpdateMobileDeviceAccessRule")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"MobileDeviceAccessRuleId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Effect\": \"\",\n \"DeviceTypes\": \"\",\n \"NotDeviceTypes\": \"\",\n \"DeviceModels\": \"\",\n \"NotDeviceModels\": \"\",\n \"DeviceOperatingSystems\": \"\",\n \"NotDeviceOperatingSystems\": \"\",\n \"DeviceUserAgents\": \"\",\n \"NotDeviceUserAgents\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
MobileDeviceAccessRuleId: '',
Name: '',
Description: '',
Effect: '',
DeviceTypes: '',
NotDeviceTypes: '',
DeviceModels: '',
NotDeviceModels: '',
DeviceOperatingSystems: '',
NotDeviceOperatingSystems: '',
DeviceUserAgents: '',
NotDeviceUserAgents: ''
});
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=WorkMailService.UpdateMobileDeviceAccessRule');
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=WorkMailService.UpdateMobileDeviceAccessRule',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
OrganizationId: '',
MobileDeviceAccessRuleId: '',
Name: '',
Description: '',
Effect: '',
DeviceTypes: '',
NotDeviceTypes: '',
DeviceModels: '',
NotDeviceModels: '',
DeviceOperatingSystems: '',
NotDeviceOperatingSystems: '',
DeviceUserAgents: '',
NotDeviceUserAgents: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateMobileDeviceAccessRule';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","MobileDeviceAccessRuleId":"","Name":"","Description":"","Effect":"","DeviceTypes":"","NotDeviceTypes":"","DeviceModels":"","NotDeviceModels":"","DeviceOperatingSystems":"","NotDeviceOperatingSystems":"","DeviceUserAgents":"","NotDeviceUserAgents":""}'
};
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=WorkMailService.UpdateMobileDeviceAccessRule',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "MobileDeviceAccessRuleId": "",\n "Name": "",\n "Description": "",\n "Effect": "",\n "DeviceTypes": "",\n "NotDeviceTypes": "",\n "DeviceModels": "",\n "NotDeviceModels": "",\n "DeviceOperatingSystems": "",\n "NotDeviceOperatingSystems": "",\n "DeviceUserAgents": "",\n "NotDeviceUserAgents": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"MobileDeviceAccessRuleId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Effect\": \"\",\n \"DeviceTypes\": \"\",\n \"NotDeviceTypes\": \"\",\n \"DeviceModels\": \"\",\n \"NotDeviceModels\": \"\",\n \"DeviceOperatingSystems\": \"\",\n \"NotDeviceOperatingSystems\": \"\",\n \"DeviceUserAgents\": \"\",\n \"NotDeviceUserAgents\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateMobileDeviceAccessRule")
.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({
OrganizationId: '',
MobileDeviceAccessRuleId: '',
Name: '',
Description: '',
Effect: '',
DeviceTypes: '',
NotDeviceTypes: '',
DeviceModels: '',
NotDeviceModels: '',
DeviceOperatingSystems: '',
NotDeviceOperatingSystems: '',
DeviceUserAgents: '',
NotDeviceUserAgents: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateMobileDeviceAccessRule',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
OrganizationId: '',
MobileDeviceAccessRuleId: '',
Name: '',
Description: '',
Effect: '',
DeviceTypes: '',
NotDeviceTypes: '',
DeviceModels: '',
NotDeviceModels: '',
DeviceOperatingSystems: '',
NotDeviceOperatingSystems: '',
DeviceUserAgents: '',
NotDeviceUserAgents: ''
},
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=WorkMailService.UpdateMobileDeviceAccessRule');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
MobileDeviceAccessRuleId: '',
Name: '',
Description: '',
Effect: '',
DeviceTypes: '',
NotDeviceTypes: '',
DeviceModels: '',
NotDeviceModels: '',
DeviceOperatingSystems: '',
NotDeviceOperatingSystems: '',
DeviceUserAgents: '',
NotDeviceUserAgents: ''
});
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=WorkMailService.UpdateMobileDeviceAccessRule',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
OrganizationId: '',
MobileDeviceAccessRuleId: '',
Name: '',
Description: '',
Effect: '',
DeviceTypes: '',
NotDeviceTypes: '',
DeviceModels: '',
NotDeviceModels: '',
DeviceOperatingSystems: '',
NotDeviceOperatingSystems: '',
DeviceUserAgents: '',
NotDeviceUserAgents: ''
}
};
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=WorkMailService.UpdateMobileDeviceAccessRule';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","MobileDeviceAccessRuleId":"","Name":"","Description":"","Effect":"","DeviceTypes":"","NotDeviceTypes":"","DeviceModels":"","NotDeviceModels":"","DeviceOperatingSystems":"","NotDeviceOperatingSystems":"","DeviceUserAgents":"","NotDeviceUserAgents":""}'
};
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 = @{ @"OrganizationId": @"",
@"MobileDeviceAccessRuleId": @"",
@"Name": @"",
@"Description": @"",
@"Effect": @"",
@"DeviceTypes": @"",
@"NotDeviceTypes": @"",
@"DeviceModels": @"",
@"NotDeviceModels": @"",
@"DeviceOperatingSystems": @"",
@"NotDeviceOperatingSystems": @"",
@"DeviceUserAgents": @"",
@"NotDeviceUserAgents": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateMobileDeviceAccessRule"]
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=WorkMailService.UpdateMobileDeviceAccessRule" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"MobileDeviceAccessRuleId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Effect\": \"\",\n \"DeviceTypes\": \"\",\n \"NotDeviceTypes\": \"\",\n \"DeviceModels\": \"\",\n \"NotDeviceModels\": \"\",\n \"DeviceOperatingSystems\": \"\",\n \"NotDeviceOperatingSystems\": \"\",\n \"DeviceUserAgents\": \"\",\n \"NotDeviceUserAgents\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateMobileDeviceAccessRule",
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([
'OrganizationId' => '',
'MobileDeviceAccessRuleId' => '',
'Name' => '',
'Description' => '',
'Effect' => '',
'DeviceTypes' => '',
'NotDeviceTypes' => '',
'DeviceModels' => '',
'NotDeviceModels' => '',
'DeviceOperatingSystems' => '',
'NotDeviceOperatingSystems' => '',
'DeviceUserAgents' => '',
'NotDeviceUserAgents' => ''
]),
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=WorkMailService.UpdateMobileDeviceAccessRule', [
'body' => '{
"OrganizationId": "",
"MobileDeviceAccessRuleId": "",
"Name": "",
"Description": "",
"Effect": "",
"DeviceTypes": "",
"NotDeviceTypes": "",
"DeviceModels": "",
"NotDeviceModels": "",
"DeviceOperatingSystems": "",
"NotDeviceOperatingSystems": "",
"DeviceUserAgents": "",
"NotDeviceUserAgents": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateMobileDeviceAccessRule');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'MobileDeviceAccessRuleId' => '',
'Name' => '',
'Description' => '',
'Effect' => '',
'DeviceTypes' => '',
'NotDeviceTypes' => '',
'DeviceModels' => '',
'NotDeviceModels' => '',
'DeviceOperatingSystems' => '',
'NotDeviceOperatingSystems' => '',
'DeviceUserAgents' => '',
'NotDeviceUserAgents' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'MobileDeviceAccessRuleId' => '',
'Name' => '',
'Description' => '',
'Effect' => '',
'DeviceTypes' => '',
'NotDeviceTypes' => '',
'DeviceModels' => '',
'NotDeviceModels' => '',
'DeviceOperatingSystems' => '',
'NotDeviceOperatingSystems' => '',
'DeviceUserAgents' => '',
'NotDeviceUserAgents' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateMobileDeviceAccessRule');
$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=WorkMailService.UpdateMobileDeviceAccessRule' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"MobileDeviceAccessRuleId": "",
"Name": "",
"Description": "",
"Effect": "",
"DeviceTypes": "",
"NotDeviceTypes": "",
"DeviceModels": "",
"NotDeviceModels": "",
"DeviceOperatingSystems": "",
"NotDeviceOperatingSystems": "",
"DeviceUserAgents": "",
"NotDeviceUserAgents": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateMobileDeviceAccessRule' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"MobileDeviceAccessRuleId": "",
"Name": "",
"Description": "",
"Effect": "",
"DeviceTypes": "",
"NotDeviceTypes": "",
"DeviceModels": "",
"NotDeviceModels": "",
"DeviceOperatingSystems": "",
"NotDeviceOperatingSystems": "",
"DeviceUserAgents": "",
"NotDeviceUserAgents": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"MobileDeviceAccessRuleId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Effect\": \"\",\n \"DeviceTypes\": \"\",\n \"NotDeviceTypes\": \"\",\n \"DeviceModels\": \"\",\n \"NotDeviceModels\": \"\",\n \"DeviceOperatingSystems\": \"\",\n \"NotDeviceOperatingSystems\": \"\",\n \"DeviceUserAgents\": \"\",\n \"NotDeviceUserAgents\": \"\"\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=WorkMailService.UpdateMobileDeviceAccessRule"
payload = {
"OrganizationId": "",
"MobileDeviceAccessRuleId": "",
"Name": "",
"Description": "",
"Effect": "",
"DeviceTypes": "",
"NotDeviceTypes": "",
"DeviceModels": "",
"NotDeviceModels": "",
"DeviceOperatingSystems": "",
"NotDeviceOperatingSystems": "",
"DeviceUserAgents": "",
"NotDeviceUserAgents": ""
}
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=WorkMailService.UpdateMobileDeviceAccessRule"
payload <- "{\n \"OrganizationId\": \"\",\n \"MobileDeviceAccessRuleId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Effect\": \"\",\n \"DeviceTypes\": \"\",\n \"NotDeviceTypes\": \"\",\n \"DeviceModels\": \"\",\n \"NotDeviceModels\": \"\",\n \"DeviceOperatingSystems\": \"\",\n \"NotDeviceOperatingSystems\": \"\",\n \"DeviceUserAgents\": \"\",\n \"NotDeviceUserAgents\": \"\"\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=WorkMailService.UpdateMobileDeviceAccessRule")
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 \"OrganizationId\": \"\",\n \"MobileDeviceAccessRuleId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Effect\": \"\",\n \"DeviceTypes\": \"\",\n \"NotDeviceTypes\": \"\",\n \"DeviceModels\": \"\",\n \"NotDeviceModels\": \"\",\n \"DeviceOperatingSystems\": \"\",\n \"NotDeviceOperatingSystems\": \"\",\n \"DeviceUserAgents\": \"\",\n \"NotDeviceUserAgents\": \"\"\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 \"OrganizationId\": \"\",\n \"MobileDeviceAccessRuleId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"Effect\": \"\",\n \"DeviceTypes\": \"\",\n \"NotDeviceTypes\": \"\",\n \"DeviceModels\": \"\",\n \"NotDeviceModels\": \"\",\n \"DeviceOperatingSystems\": \"\",\n \"NotDeviceOperatingSystems\": \"\",\n \"DeviceUserAgents\": \"\",\n \"NotDeviceUserAgents\": \"\"\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=WorkMailService.UpdateMobileDeviceAccessRule";
let payload = json!({
"OrganizationId": "",
"MobileDeviceAccessRuleId": "",
"Name": "",
"Description": "",
"Effect": "",
"DeviceTypes": "",
"NotDeviceTypes": "",
"DeviceModels": "",
"NotDeviceModels": "",
"DeviceOperatingSystems": "",
"NotDeviceOperatingSystems": "",
"DeviceUserAgents": "",
"NotDeviceUserAgents": ""
});
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=WorkMailService.UpdateMobileDeviceAccessRule' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"MobileDeviceAccessRuleId": "",
"Name": "",
"Description": "",
"Effect": "",
"DeviceTypes": "",
"NotDeviceTypes": "",
"DeviceModels": "",
"NotDeviceModels": "",
"DeviceOperatingSystems": "",
"NotDeviceOperatingSystems": "",
"DeviceUserAgents": "",
"NotDeviceUserAgents": ""
}'
echo '{
"OrganizationId": "",
"MobileDeviceAccessRuleId": "",
"Name": "",
"Description": "",
"Effect": "",
"DeviceTypes": "",
"NotDeviceTypes": "",
"DeviceModels": "",
"NotDeviceModels": "",
"DeviceOperatingSystems": "",
"NotDeviceOperatingSystems": "",
"DeviceUserAgents": "",
"NotDeviceUserAgents": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateMobileDeviceAccessRule' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "MobileDeviceAccessRuleId": "",\n "Name": "",\n "Description": "",\n "Effect": "",\n "DeviceTypes": "",\n "NotDeviceTypes": "",\n "DeviceModels": "",\n "NotDeviceModels": "",\n "DeviceOperatingSystems": "",\n "NotDeviceOperatingSystems": "",\n "DeviceUserAgents": "",\n "NotDeviceUserAgents": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateMobileDeviceAccessRule'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"MobileDeviceAccessRuleId": "",
"Name": "",
"Description": "",
"Effect": "",
"DeviceTypes": "",
"NotDeviceTypes": "",
"DeviceModels": "",
"NotDeviceModels": "",
"DeviceOperatingSystems": "",
"NotDeviceOperatingSystems": "",
"DeviceUserAgents": "",
"NotDeviceUserAgents": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateMobileDeviceAccessRule")! 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
UpdatePrimaryEmailAddress
{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdatePrimaryEmailAddress
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"EntityId": "",
"Email": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdatePrimaryEmailAddress");
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 \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Email\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdatePrimaryEmailAddress" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:EntityId ""
:Email ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdatePrimaryEmailAddress"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Email\": \"\"\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=WorkMailService.UpdatePrimaryEmailAddress"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Email\": \"\"\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=WorkMailService.UpdatePrimaryEmailAddress");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Email\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdatePrimaryEmailAddress"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Email\": \"\"\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: 59
{
"OrganizationId": "",
"EntityId": "",
"Email": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdatePrimaryEmailAddress")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Email\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdatePrimaryEmailAddress"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Email\": \"\"\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 \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Email\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdatePrimaryEmailAddress")
.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=WorkMailService.UpdatePrimaryEmailAddress")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Email\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
EntityId: '',
Email: ''
});
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=WorkMailService.UpdatePrimaryEmailAddress');
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=WorkMailService.UpdatePrimaryEmailAddress',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', EntityId: '', Email: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdatePrimaryEmailAddress';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","EntityId":"","Email":""}'
};
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=WorkMailService.UpdatePrimaryEmailAddress',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "EntityId": "",\n "Email": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Email\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdatePrimaryEmailAddress")
.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({OrganizationId: '', EntityId: '', Email: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdatePrimaryEmailAddress',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', EntityId: '', Email: ''},
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=WorkMailService.UpdatePrimaryEmailAddress');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
EntityId: '',
Email: ''
});
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=WorkMailService.UpdatePrimaryEmailAddress',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', EntityId: '', Email: ''}
};
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=WorkMailService.UpdatePrimaryEmailAddress';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","EntityId":"","Email":""}'
};
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 = @{ @"OrganizationId": @"",
@"EntityId": @"",
@"Email": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdatePrimaryEmailAddress"]
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=WorkMailService.UpdatePrimaryEmailAddress" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Email\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdatePrimaryEmailAddress",
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([
'OrganizationId' => '',
'EntityId' => '',
'Email' => ''
]),
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=WorkMailService.UpdatePrimaryEmailAddress', [
'body' => '{
"OrganizationId": "",
"EntityId": "",
"Email": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdatePrimaryEmailAddress');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'EntityId' => '',
'Email' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'EntityId' => '',
'Email' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdatePrimaryEmailAddress');
$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=WorkMailService.UpdatePrimaryEmailAddress' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"EntityId": "",
"Email": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdatePrimaryEmailAddress' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"EntityId": "",
"Email": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Email\": \"\"\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=WorkMailService.UpdatePrimaryEmailAddress"
payload = {
"OrganizationId": "",
"EntityId": "",
"Email": ""
}
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=WorkMailService.UpdatePrimaryEmailAddress"
payload <- "{\n \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Email\": \"\"\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=WorkMailService.UpdatePrimaryEmailAddress")
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 \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Email\": \"\"\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 \"OrganizationId\": \"\",\n \"EntityId\": \"\",\n \"Email\": \"\"\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=WorkMailService.UpdatePrimaryEmailAddress";
let payload = json!({
"OrganizationId": "",
"EntityId": "",
"Email": ""
});
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=WorkMailService.UpdatePrimaryEmailAddress' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"EntityId": "",
"Email": ""
}'
echo '{
"OrganizationId": "",
"EntityId": "",
"Email": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdatePrimaryEmailAddress' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "EntityId": "",\n "Email": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdatePrimaryEmailAddress'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"EntityId": "",
"Email": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdatePrimaryEmailAddress")! 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
UpdateResource
{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateResource
HEADERS
X-Amz-Target
BODY json
{
"OrganizationId": "",
"ResourceId": "",
"Name": "",
"BookingOptions": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateResource");
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 \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"Name\": \"\",\n \"BookingOptions\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateResource" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:OrganizationId ""
:ResourceId ""
:Name ""
:BookingOptions ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateResource"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"Name\": \"\",\n \"BookingOptions\": \"\"\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=WorkMailService.UpdateResource"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"Name\": \"\",\n \"BookingOptions\": \"\"\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=WorkMailService.UpdateResource");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"Name\": \"\",\n \"BookingOptions\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateResource"
payload := strings.NewReader("{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"Name\": \"\",\n \"BookingOptions\": \"\"\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: 84
{
"OrganizationId": "",
"ResourceId": "",
"Name": "",
"BookingOptions": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateResource")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"Name\": \"\",\n \"BookingOptions\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateResource"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"Name\": \"\",\n \"BookingOptions\": \"\"\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 \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"Name\": \"\",\n \"BookingOptions\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateResource")
.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=WorkMailService.UpdateResource")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"Name\": \"\",\n \"BookingOptions\": \"\"\n}")
.asString();
const data = JSON.stringify({
OrganizationId: '',
ResourceId: '',
Name: '',
BookingOptions: ''
});
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=WorkMailService.UpdateResource');
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=WorkMailService.UpdateResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', ResourceId: '', Name: '', BookingOptions: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateResource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","ResourceId":"","Name":"","BookingOptions":""}'
};
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=WorkMailService.UpdateResource',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "OrganizationId": "",\n "ResourceId": "",\n "Name": "",\n "BookingOptions": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"Name\": \"\",\n \"BookingOptions\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateResource")
.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({OrganizationId: '', ResourceId: '', Name: '', BookingOptions: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {OrganizationId: '', ResourceId: '', Name: '', BookingOptions: ''},
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=WorkMailService.UpdateResource');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
OrganizationId: '',
ResourceId: '',
Name: '',
BookingOptions: ''
});
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=WorkMailService.UpdateResource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {OrganizationId: '', ResourceId: '', Name: '', BookingOptions: ''}
};
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=WorkMailService.UpdateResource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"OrganizationId":"","ResourceId":"","Name":"","BookingOptions":""}'
};
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 = @{ @"OrganizationId": @"",
@"ResourceId": @"",
@"Name": @"",
@"BookingOptions": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateResource"]
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=WorkMailService.UpdateResource" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"Name\": \"\",\n \"BookingOptions\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateResource",
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([
'OrganizationId' => '',
'ResourceId' => '',
'Name' => '',
'BookingOptions' => ''
]),
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=WorkMailService.UpdateResource', [
'body' => '{
"OrganizationId": "",
"ResourceId": "",
"Name": "",
"BookingOptions": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateResource');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'OrganizationId' => '',
'ResourceId' => '',
'Name' => '',
'BookingOptions' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'OrganizationId' => '',
'ResourceId' => '',
'Name' => '',
'BookingOptions' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateResource');
$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=WorkMailService.UpdateResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"ResourceId": "",
"Name": "",
"BookingOptions": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateResource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"OrganizationId": "",
"ResourceId": "",
"Name": "",
"BookingOptions": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"Name\": \"\",\n \"BookingOptions\": \"\"\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=WorkMailService.UpdateResource"
payload = {
"OrganizationId": "",
"ResourceId": "",
"Name": "",
"BookingOptions": ""
}
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=WorkMailService.UpdateResource"
payload <- "{\n \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"Name\": \"\",\n \"BookingOptions\": \"\"\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=WorkMailService.UpdateResource")
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 \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"Name\": \"\",\n \"BookingOptions\": \"\"\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 \"OrganizationId\": \"\",\n \"ResourceId\": \"\",\n \"Name\": \"\",\n \"BookingOptions\": \"\"\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=WorkMailService.UpdateResource";
let payload = json!({
"OrganizationId": "",
"ResourceId": "",
"Name": "",
"BookingOptions": ""
});
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=WorkMailService.UpdateResource' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"OrganizationId": "",
"ResourceId": "",
"Name": "",
"BookingOptions": ""
}'
echo '{
"OrganizationId": "",
"ResourceId": "",
"Name": "",
"BookingOptions": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateResource' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "OrganizationId": "",\n "ResourceId": "",\n "Name": "",\n "BookingOptions": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateResource'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"OrganizationId": "",
"ResourceId": "",
"Name": "",
"BookingOptions": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=WorkMailService.UpdateResource")! 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()