AWSKendraFrontendService
POST
AssociateEntitiesToExperience
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.AssociateEntitiesToExperience
HEADERS
X-Amz-Target
BODY json
{
"Id": "",
"IndexId": "",
"EntityList": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.AssociateEntitiesToExperience");
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 \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityList\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.AssociateEntitiesToExperience" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Id ""
:IndexId ""
:EntityList ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.AssociateEntitiesToExperience"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityList\": \"\"\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=AWSKendraFrontendService.AssociateEntitiesToExperience"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityList\": \"\"\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=AWSKendraFrontendService.AssociateEntitiesToExperience");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityList\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.AssociateEntitiesToExperience"
payload := strings.NewReader("{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityList\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 51
{
"Id": "",
"IndexId": "",
"EntityList": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.AssociateEntitiesToExperience")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityList\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.AssociateEntitiesToExperience"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityList\": \"\"\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 \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityList\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.AssociateEntitiesToExperience")
.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=AWSKendraFrontendService.AssociateEntitiesToExperience")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityList\": \"\"\n}")
.asString();
const data = JSON.stringify({
Id: '',
IndexId: '',
EntityList: ''
});
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=AWSKendraFrontendService.AssociateEntitiesToExperience');
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=AWSKendraFrontendService.AssociateEntitiesToExperience',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Id: '', IndexId: '', EntityList: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.AssociateEntitiesToExperience';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","IndexId":"","EntityList":""}'
};
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=AWSKendraFrontendService.AssociateEntitiesToExperience',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Id": "",\n "IndexId": "",\n "EntityList": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityList\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.AssociateEntitiesToExperience")
.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({Id: '', IndexId: '', EntityList: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.AssociateEntitiesToExperience',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Id: '', IndexId: '', EntityList: ''},
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=AWSKendraFrontendService.AssociateEntitiesToExperience');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Id: '',
IndexId: '',
EntityList: ''
});
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=AWSKendraFrontendService.AssociateEntitiesToExperience',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Id: '', IndexId: '', EntityList: ''}
};
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=AWSKendraFrontendService.AssociateEntitiesToExperience';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","IndexId":"","EntityList":""}'
};
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 = @{ @"Id": @"",
@"IndexId": @"",
@"EntityList": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.AssociateEntitiesToExperience"]
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=AWSKendraFrontendService.AssociateEntitiesToExperience" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityList\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.AssociateEntitiesToExperience",
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([
'Id' => '',
'IndexId' => '',
'EntityList' => ''
]),
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=AWSKendraFrontendService.AssociateEntitiesToExperience', [
'body' => '{
"Id": "",
"IndexId": "",
"EntityList": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.AssociateEntitiesToExperience');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Id' => '',
'IndexId' => '',
'EntityList' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Id' => '',
'IndexId' => '',
'EntityList' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.AssociateEntitiesToExperience');
$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=AWSKendraFrontendService.AssociateEntitiesToExperience' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"IndexId": "",
"EntityList": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.AssociateEntitiesToExperience' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"IndexId": "",
"EntityList": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityList\": \"\"\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=AWSKendraFrontendService.AssociateEntitiesToExperience"
payload = {
"Id": "",
"IndexId": "",
"EntityList": ""
}
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=AWSKendraFrontendService.AssociateEntitiesToExperience"
payload <- "{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityList\": \"\"\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=AWSKendraFrontendService.AssociateEntitiesToExperience")
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 \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityList\": \"\"\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 \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityList\": \"\"\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=AWSKendraFrontendService.AssociateEntitiesToExperience";
let payload = json!({
"Id": "",
"IndexId": "",
"EntityList": ""
});
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=AWSKendraFrontendService.AssociateEntitiesToExperience' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Id": "",
"IndexId": "",
"EntityList": ""
}'
echo '{
"Id": "",
"IndexId": "",
"EntityList": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.AssociateEntitiesToExperience' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Id": "",\n "IndexId": "",\n "EntityList": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.AssociateEntitiesToExperience'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Id": "",
"IndexId": "",
"EntityList": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.AssociateEntitiesToExperience")! 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
AssociatePersonasToEntities
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.AssociatePersonasToEntities
HEADERS
X-Amz-Target
BODY json
{
"Id": "",
"IndexId": "",
"Personas": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.AssociatePersonasToEntities");
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 \"Id\": \"\",\n \"IndexId\": \"\",\n \"Personas\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.AssociatePersonasToEntities" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Id ""
:IndexId ""
:Personas ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.AssociatePersonasToEntities"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"Personas\": \"\"\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=AWSKendraFrontendService.AssociatePersonasToEntities"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"Personas\": \"\"\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=AWSKendraFrontendService.AssociatePersonasToEntities");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"Personas\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.AssociatePersonasToEntities"
payload := strings.NewReader("{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"Personas\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 49
{
"Id": "",
"IndexId": "",
"Personas": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.AssociatePersonasToEntities")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"Personas\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.AssociatePersonasToEntities"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"Personas\": \"\"\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 \"Id\": \"\",\n \"IndexId\": \"\",\n \"Personas\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.AssociatePersonasToEntities")
.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=AWSKendraFrontendService.AssociatePersonasToEntities")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"Personas\": \"\"\n}")
.asString();
const data = JSON.stringify({
Id: '',
IndexId: '',
Personas: ''
});
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=AWSKendraFrontendService.AssociatePersonasToEntities');
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=AWSKendraFrontendService.AssociatePersonasToEntities',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Id: '', IndexId: '', Personas: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.AssociatePersonasToEntities';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","IndexId":"","Personas":""}'
};
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=AWSKendraFrontendService.AssociatePersonasToEntities',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Id": "",\n "IndexId": "",\n "Personas": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"Personas\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.AssociatePersonasToEntities")
.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({Id: '', IndexId: '', Personas: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.AssociatePersonasToEntities',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Id: '', IndexId: '', Personas: ''},
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=AWSKendraFrontendService.AssociatePersonasToEntities');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Id: '',
IndexId: '',
Personas: ''
});
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=AWSKendraFrontendService.AssociatePersonasToEntities',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Id: '', IndexId: '', Personas: ''}
};
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=AWSKendraFrontendService.AssociatePersonasToEntities';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","IndexId":"","Personas":""}'
};
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 = @{ @"Id": @"",
@"IndexId": @"",
@"Personas": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.AssociatePersonasToEntities"]
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=AWSKendraFrontendService.AssociatePersonasToEntities" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"Personas\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.AssociatePersonasToEntities",
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([
'Id' => '',
'IndexId' => '',
'Personas' => ''
]),
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=AWSKendraFrontendService.AssociatePersonasToEntities', [
'body' => '{
"Id": "",
"IndexId": "",
"Personas": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.AssociatePersonasToEntities');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Id' => '',
'IndexId' => '',
'Personas' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Id' => '',
'IndexId' => '',
'Personas' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.AssociatePersonasToEntities');
$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=AWSKendraFrontendService.AssociatePersonasToEntities' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"IndexId": "",
"Personas": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.AssociatePersonasToEntities' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"IndexId": "",
"Personas": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"Personas\": \"\"\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=AWSKendraFrontendService.AssociatePersonasToEntities"
payload = {
"Id": "",
"IndexId": "",
"Personas": ""
}
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=AWSKendraFrontendService.AssociatePersonasToEntities"
payload <- "{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"Personas\": \"\"\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=AWSKendraFrontendService.AssociatePersonasToEntities")
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 \"Id\": \"\",\n \"IndexId\": \"\",\n \"Personas\": \"\"\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 \"Id\": \"\",\n \"IndexId\": \"\",\n \"Personas\": \"\"\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=AWSKendraFrontendService.AssociatePersonasToEntities";
let payload = json!({
"Id": "",
"IndexId": "",
"Personas": ""
});
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=AWSKendraFrontendService.AssociatePersonasToEntities' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Id": "",
"IndexId": "",
"Personas": ""
}'
echo '{
"Id": "",
"IndexId": "",
"Personas": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.AssociatePersonasToEntities' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Id": "",\n "IndexId": "",\n "Personas": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.AssociatePersonasToEntities'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Id": "",
"IndexId": "",
"Personas": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.AssociatePersonasToEntities")! 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
BatchDeleteDocument
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchDeleteDocument
HEADERS
X-Amz-Target
BODY json
{
"IndexId": "",
"DocumentIdList": "",
"DataSourceSyncJobMetricTarget": {
"DataSourceId": "",
"DataSourceSyncJobId": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchDeleteDocument");
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 \"IndexId\": \"\",\n \"DocumentIdList\": \"\",\n \"DataSourceSyncJobMetricTarget\": {\n \"DataSourceId\": \"\",\n \"DataSourceSyncJobId\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchDeleteDocument" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IndexId ""
:DocumentIdList ""
:DataSourceSyncJobMetricTarget {:DataSourceId ""
:DataSourceSyncJobId ""}}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchDeleteDocument"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IndexId\": \"\",\n \"DocumentIdList\": \"\",\n \"DataSourceSyncJobMetricTarget\": {\n \"DataSourceId\": \"\",\n \"DataSourceSyncJobId\": \"\"\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=AWSKendraFrontendService.BatchDeleteDocument"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IndexId\": \"\",\n \"DocumentIdList\": \"\",\n \"DataSourceSyncJobMetricTarget\": {\n \"DataSourceId\": \"\",\n \"DataSourceSyncJobId\": \"\"\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=AWSKendraFrontendService.BatchDeleteDocument");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IndexId\": \"\",\n \"DocumentIdList\": \"\",\n \"DataSourceSyncJobMetricTarget\": {\n \"DataSourceId\": \"\",\n \"DataSourceSyncJobId\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchDeleteDocument"
payload := strings.NewReader("{\n \"IndexId\": \"\",\n \"DocumentIdList\": \"\",\n \"DataSourceSyncJobMetricTarget\": {\n \"DataSourceId\": \"\",\n \"DataSourceSyncJobId\": \"\"\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: 139
{
"IndexId": "",
"DocumentIdList": "",
"DataSourceSyncJobMetricTarget": {
"DataSourceId": "",
"DataSourceSyncJobId": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchDeleteDocument")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IndexId\": \"\",\n \"DocumentIdList\": \"\",\n \"DataSourceSyncJobMetricTarget\": {\n \"DataSourceId\": \"\",\n \"DataSourceSyncJobId\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchDeleteDocument"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IndexId\": \"\",\n \"DocumentIdList\": \"\",\n \"DataSourceSyncJobMetricTarget\": {\n \"DataSourceId\": \"\",\n \"DataSourceSyncJobId\": \"\"\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 \"IndexId\": \"\",\n \"DocumentIdList\": \"\",\n \"DataSourceSyncJobMetricTarget\": {\n \"DataSourceId\": \"\",\n \"DataSourceSyncJobId\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchDeleteDocument")
.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=AWSKendraFrontendService.BatchDeleteDocument")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IndexId\": \"\",\n \"DocumentIdList\": \"\",\n \"DataSourceSyncJobMetricTarget\": {\n \"DataSourceId\": \"\",\n \"DataSourceSyncJobId\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
IndexId: '',
DocumentIdList: '',
DataSourceSyncJobMetricTarget: {
DataSourceId: '',
DataSourceSyncJobId: ''
}
});
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=AWSKendraFrontendService.BatchDeleteDocument');
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=AWSKendraFrontendService.BatchDeleteDocument',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
IndexId: '',
DocumentIdList: '',
DataSourceSyncJobMetricTarget: {DataSourceId: '', DataSourceSyncJobId: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchDeleteDocument';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","DocumentIdList":"","DataSourceSyncJobMetricTarget":{"DataSourceId":"","DataSourceSyncJobId":""}}'
};
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=AWSKendraFrontendService.BatchDeleteDocument',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IndexId": "",\n "DocumentIdList": "",\n "DataSourceSyncJobMetricTarget": {\n "DataSourceId": "",\n "DataSourceSyncJobId": ""\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 \"IndexId\": \"\",\n \"DocumentIdList\": \"\",\n \"DataSourceSyncJobMetricTarget\": {\n \"DataSourceId\": \"\",\n \"DataSourceSyncJobId\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchDeleteDocument")
.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({
IndexId: '',
DocumentIdList: '',
DataSourceSyncJobMetricTarget: {DataSourceId: '', DataSourceSyncJobId: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchDeleteDocument',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
IndexId: '',
DocumentIdList: '',
DataSourceSyncJobMetricTarget: {DataSourceId: '', DataSourceSyncJobId: ''}
},
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=AWSKendraFrontendService.BatchDeleteDocument');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IndexId: '',
DocumentIdList: '',
DataSourceSyncJobMetricTarget: {
DataSourceId: '',
DataSourceSyncJobId: ''
}
});
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=AWSKendraFrontendService.BatchDeleteDocument',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
IndexId: '',
DocumentIdList: '',
DataSourceSyncJobMetricTarget: {DataSourceId: '', DataSourceSyncJobId: ''}
}
};
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=AWSKendraFrontendService.BatchDeleteDocument';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","DocumentIdList":"","DataSourceSyncJobMetricTarget":{"DataSourceId":"","DataSourceSyncJobId":""}}'
};
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 = @{ @"IndexId": @"",
@"DocumentIdList": @"",
@"DataSourceSyncJobMetricTarget": @{ @"DataSourceId": @"", @"DataSourceSyncJobId": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchDeleteDocument"]
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=AWSKendraFrontendService.BatchDeleteDocument" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IndexId\": \"\",\n \"DocumentIdList\": \"\",\n \"DataSourceSyncJobMetricTarget\": {\n \"DataSourceId\": \"\",\n \"DataSourceSyncJobId\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchDeleteDocument",
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([
'IndexId' => '',
'DocumentIdList' => '',
'DataSourceSyncJobMetricTarget' => [
'DataSourceId' => '',
'DataSourceSyncJobId' => ''
]
]),
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=AWSKendraFrontendService.BatchDeleteDocument', [
'body' => '{
"IndexId": "",
"DocumentIdList": "",
"DataSourceSyncJobMetricTarget": {
"DataSourceId": "",
"DataSourceSyncJobId": ""
}
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchDeleteDocument');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IndexId' => '',
'DocumentIdList' => '',
'DataSourceSyncJobMetricTarget' => [
'DataSourceId' => '',
'DataSourceSyncJobId' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IndexId' => '',
'DocumentIdList' => '',
'DataSourceSyncJobMetricTarget' => [
'DataSourceId' => '',
'DataSourceSyncJobId' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchDeleteDocument');
$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=AWSKendraFrontendService.BatchDeleteDocument' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"DocumentIdList": "",
"DataSourceSyncJobMetricTarget": {
"DataSourceId": "",
"DataSourceSyncJobId": ""
}
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchDeleteDocument' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"DocumentIdList": "",
"DataSourceSyncJobMetricTarget": {
"DataSourceId": "",
"DataSourceSyncJobId": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IndexId\": \"\",\n \"DocumentIdList\": \"\",\n \"DataSourceSyncJobMetricTarget\": {\n \"DataSourceId\": \"\",\n \"DataSourceSyncJobId\": \"\"\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=AWSKendraFrontendService.BatchDeleteDocument"
payload = {
"IndexId": "",
"DocumentIdList": "",
"DataSourceSyncJobMetricTarget": {
"DataSourceId": "",
"DataSourceSyncJobId": ""
}
}
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=AWSKendraFrontendService.BatchDeleteDocument"
payload <- "{\n \"IndexId\": \"\",\n \"DocumentIdList\": \"\",\n \"DataSourceSyncJobMetricTarget\": {\n \"DataSourceId\": \"\",\n \"DataSourceSyncJobId\": \"\"\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=AWSKendraFrontendService.BatchDeleteDocument")
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 \"IndexId\": \"\",\n \"DocumentIdList\": \"\",\n \"DataSourceSyncJobMetricTarget\": {\n \"DataSourceId\": \"\",\n \"DataSourceSyncJobId\": \"\"\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 \"IndexId\": \"\",\n \"DocumentIdList\": \"\",\n \"DataSourceSyncJobMetricTarget\": {\n \"DataSourceId\": \"\",\n \"DataSourceSyncJobId\": \"\"\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=AWSKendraFrontendService.BatchDeleteDocument";
let payload = json!({
"IndexId": "",
"DocumentIdList": "",
"DataSourceSyncJobMetricTarget": json!({
"DataSourceId": "",
"DataSourceSyncJobId": ""
})
});
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=AWSKendraFrontendService.BatchDeleteDocument' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IndexId": "",
"DocumentIdList": "",
"DataSourceSyncJobMetricTarget": {
"DataSourceId": "",
"DataSourceSyncJobId": ""
}
}'
echo '{
"IndexId": "",
"DocumentIdList": "",
"DataSourceSyncJobMetricTarget": {
"DataSourceId": "",
"DataSourceSyncJobId": ""
}
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchDeleteDocument' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IndexId": "",\n "DocumentIdList": "",\n "DataSourceSyncJobMetricTarget": {\n "DataSourceId": "",\n "DataSourceSyncJobId": ""\n }\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchDeleteDocument'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"IndexId": "",
"DocumentIdList": "",
"DataSourceSyncJobMetricTarget": [
"DataSourceId": "",
"DataSourceSyncJobId": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchDeleteDocument")! 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
BatchDeleteFeaturedResultsSet
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchDeleteFeaturedResultsSet
HEADERS
X-Amz-Target
BODY json
{
"IndexId": "",
"FeaturedResultsSetIds": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchDeleteFeaturedResultsSet");
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 \"IndexId\": \"\",\n \"FeaturedResultsSetIds\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchDeleteFeaturedResultsSet" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IndexId ""
:FeaturedResultsSetIds ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchDeleteFeaturedResultsSet"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IndexId\": \"\",\n \"FeaturedResultsSetIds\": \"\"\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=AWSKendraFrontendService.BatchDeleteFeaturedResultsSet"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IndexId\": \"\",\n \"FeaturedResultsSetIds\": \"\"\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=AWSKendraFrontendService.BatchDeleteFeaturedResultsSet");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IndexId\": \"\",\n \"FeaturedResultsSetIds\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchDeleteFeaturedResultsSet"
payload := strings.NewReader("{\n \"IndexId\": \"\",\n \"FeaturedResultsSetIds\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 50
{
"IndexId": "",
"FeaturedResultsSetIds": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchDeleteFeaturedResultsSet")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IndexId\": \"\",\n \"FeaturedResultsSetIds\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchDeleteFeaturedResultsSet"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IndexId\": \"\",\n \"FeaturedResultsSetIds\": \"\"\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 \"IndexId\": \"\",\n \"FeaturedResultsSetIds\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchDeleteFeaturedResultsSet")
.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=AWSKendraFrontendService.BatchDeleteFeaturedResultsSet")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IndexId\": \"\",\n \"FeaturedResultsSetIds\": \"\"\n}")
.asString();
const data = JSON.stringify({
IndexId: '',
FeaturedResultsSetIds: ''
});
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=AWSKendraFrontendService.BatchDeleteFeaturedResultsSet');
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=AWSKendraFrontendService.BatchDeleteFeaturedResultsSet',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', FeaturedResultsSetIds: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchDeleteFeaturedResultsSet';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","FeaturedResultsSetIds":""}'
};
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=AWSKendraFrontendService.BatchDeleteFeaturedResultsSet',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IndexId": "",\n "FeaturedResultsSetIds": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"IndexId\": \"\",\n \"FeaturedResultsSetIds\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchDeleteFeaturedResultsSet")
.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({IndexId: '', FeaturedResultsSetIds: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchDeleteFeaturedResultsSet',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {IndexId: '', FeaturedResultsSetIds: ''},
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=AWSKendraFrontendService.BatchDeleteFeaturedResultsSet');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IndexId: '',
FeaturedResultsSetIds: ''
});
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=AWSKendraFrontendService.BatchDeleteFeaturedResultsSet',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', FeaturedResultsSetIds: ''}
};
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=AWSKendraFrontendService.BatchDeleteFeaturedResultsSet';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","FeaturedResultsSetIds":""}'
};
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 = @{ @"IndexId": @"",
@"FeaturedResultsSetIds": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchDeleteFeaturedResultsSet"]
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=AWSKendraFrontendService.BatchDeleteFeaturedResultsSet" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IndexId\": \"\",\n \"FeaturedResultsSetIds\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchDeleteFeaturedResultsSet",
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([
'IndexId' => '',
'FeaturedResultsSetIds' => ''
]),
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=AWSKendraFrontendService.BatchDeleteFeaturedResultsSet', [
'body' => '{
"IndexId": "",
"FeaturedResultsSetIds": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchDeleteFeaturedResultsSet');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IndexId' => '',
'FeaturedResultsSetIds' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IndexId' => '',
'FeaturedResultsSetIds' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchDeleteFeaturedResultsSet');
$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=AWSKendraFrontendService.BatchDeleteFeaturedResultsSet' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"FeaturedResultsSetIds": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchDeleteFeaturedResultsSet' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"FeaturedResultsSetIds": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IndexId\": \"\",\n \"FeaturedResultsSetIds\": \"\"\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=AWSKendraFrontendService.BatchDeleteFeaturedResultsSet"
payload = {
"IndexId": "",
"FeaturedResultsSetIds": ""
}
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=AWSKendraFrontendService.BatchDeleteFeaturedResultsSet"
payload <- "{\n \"IndexId\": \"\",\n \"FeaturedResultsSetIds\": \"\"\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=AWSKendraFrontendService.BatchDeleteFeaturedResultsSet")
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 \"IndexId\": \"\",\n \"FeaturedResultsSetIds\": \"\"\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 \"IndexId\": \"\",\n \"FeaturedResultsSetIds\": \"\"\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=AWSKendraFrontendService.BatchDeleteFeaturedResultsSet";
let payload = json!({
"IndexId": "",
"FeaturedResultsSetIds": ""
});
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=AWSKendraFrontendService.BatchDeleteFeaturedResultsSet' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IndexId": "",
"FeaturedResultsSetIds": ""
}'
echo '{
"IndexId": "",
"FeaturedResultsSetIds": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchDeleteFeaturedResultsSet' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IndexId": "",\n "FeaturedResultsSetIds": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchDeleteFeaturedResultsSet'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"IndexId": "",
"FeaturedResultsSetIds": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchDeleteFeaturedResultsSet")! 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
BatchGetDocumentStatus
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchGetDocumentStatus
HEADERS
X-Amz-Target
BODY json
{
"IndexId": "",
"DocumentInfoList": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchGetDocumentStatus");
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 \"IndexId\": \"\",\n \"DocumentInfoList\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchGetDocumentStatus" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IndexId ""
:DocumentInfoList ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchGetDocumentStatus"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IndexId\": \"\",\n \"DocumentInfoList\": \"\"\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=AWSKendraFrontendService.BatchGetDocumentStatus"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IndexId\": \"\",\n \"DocumentInfoList\": \"\"\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=AWSKendraFrontendService.BatchGetDocumentStatus");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IndexId\": \"\",\n \"DocumentInfoList\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchGetDocumentStatus"
payload := strings.NewReader("{\n \"IndexId\": \"\",\n \"DocumentInfoList\": \"\"\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: 45
{
"IndexId": "",
"DocumentInfoList": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchGetDocumentStatus")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IndexId\": \"\",\n \"DocumentInfoList\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchGetDocumentStatus"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IndexId\": \"\",\n \"DocumentInfoList\": \"\"\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 \"IndexId\": \"\",\n \"DocumentInfoList\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchGetDocumentStatus")
.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=AWSKendraFrontendService.BatchGetDocumentStatus")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IndexId\": \"\",\n \"DocumentInfoList\": \"\"\n}")
.asString();
const data = JSON.stringify({
IndexId: '',
DocumentInfoList: ''
});
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=AWSKendraFrontendService.BatchGetDocumentStatus');
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=AWSKendraFrontendService.BatchGetDocumentStatus',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', DocumentInfoList: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchGetDocumentStatus';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","DocumentInfoList":""}'
};
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=AWSKendraFrontendService.BatchGetDocumentStatus',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IndexId": "",\n "DocumentInfoList": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"IndexId\": \"\",\n \"DocumentInfoList\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchGetDocumentStatus")
.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({IndexId: '', DocumentInfoList: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchGetDocumentStatus',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {IndexId: '', DocumentInfoList: ''},
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=AWSKendraFrontendService.BatchGetDocumentStatus');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IndexId: '',
DocumentInfoList: ''
});
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=AWSKendraFrontendService.BatchGetDocumentStatus',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', DocumentInfoList: ''}
};
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=AWSKendraFrontendService.BatchGetDocumentStatus';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","DocumentInfoList":""}'
};
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 = @{ @"IndexId": @"",
@"DocumentInfoList": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchGetDocumentStatus"]
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=AWSKendraFrontendService.BatchGetDocumentStatus" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IndexId\": \"\",\n \"DocumentInfoList\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchGetDocumentStatus",
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([
'IndexId' => '',
'DocumentInfoList' => ''
]),
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=AWSKendraFrontendService.BatchGetDocumentStatus', [
'body' => '{
"IndexId": "",
"DocumentInfoList": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchGetDocumentStatus');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IndexId' => '',
'DocumentInfoList' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IndexId' => '',
'DocumentInfoList' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchGetDocumentStatus');
$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=AWSKendraFrontendService.BatchGetDocumentStatus' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"DocumentInfoList": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchGetDocumentStatus' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"DocumentInfoList": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IndexId\": \"\",\n \"DocumentInfoList\": \"\"\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=AWSKendraFrontendService.BatchGetDocumentStatus"
payload = {
"IndexId": "",
"DocumentInfoList": ""
}
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=AWSKendraFrontendService.BatchGetDocumentStatus"
payload <- "{\n \"IndexId\": \"\",\n \"DocumentInfoList\": \"\"\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=AWSKendraFrontendService.BatchGetDocumentStatus")
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 \"IndexId\": \"\",\n \"DocumentInfoList\": \"\"\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 \"IndexId\": \"\",\n \"DocumentInfoList\": \"\"\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=AWSKendraFrontendService.BatchGetDocumentStatus";
let payload = json!({
"IndexId": "",
"DocumentInfoList": ""
});
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=AWSKendraFrontendService.BatchGetDocumentStatus' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IndexId": "",
"DocumentInfoList": ""
}'
echo '{
"IndexId": "",
"DocumentInfoList": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchGetDocumentStatus' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IndexId": "",\n "DocumentInfoList": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchGetDocumentStatus'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"IndexId": "",
"DocumentInfoList": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchGetDocumentStatus")! 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
BatchPutDocument
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchPutDocument
HEADERS
X-Amz-Target
BODY json
{
"IndexId": "",
"RoleArn": "",
"Documents": "",
"CustomDocumentEnrichmentConfiguration": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchPutDocument");
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 \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Documents\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchPutDocument" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IndexId ""
:RoleArn ""
:Documents ""
:CustomDocumentEnrichmentConfiguration ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchPutDocument"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Documents\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\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=AWSKendraFrontendService.BatchPutDocument"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Documents\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\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=AWSKendraFrontendService.BatchPutDocument");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Documents\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchPutDocument"
payload := strings.NewReader("{\n \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Documents\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\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: 102
{
"IndexId": "",
"RoleArn": "",
"Documents": "",
"CustomDocumentEnrichmentConfiguration": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchPutDocument")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Documents\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchPutDocument"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Documents\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\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 \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Documents\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchPutDocument")
.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=AWSKendraFrontendService.BatchPutDocument")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Documents\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\n}")
.asString();
const data = JSON.stringify({
IndexId: '',
RoleArn: '',
Documents: '',
CustomDocumentEnrichmentConfiguration: ''
});
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=AWSKendraFrontendService.BatchPutDocument');
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=AWSKendraFrontendService.BatchPutDocument',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
IndexId: '',
RoleArn: '',
Documents: '',
CustomDocumentEnrichmentConfiguration: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchPutDocument';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","RoleArn":"","Documents":"","CustomDocumentEnrichmentConfiguration":""}'
};
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=AWSKendraFrontendService.BatchPutDocument',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IndexId": "",\n "RoleArn": "",\n "Documents": "",\n "CustomDocumentEnrichmentConfiguration": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Documents\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchPutDocument")
.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({
IndexId: '',
RoleArn: '',
Documents: '',
CustomDocumentEnrichmentConfiguration: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchPutDocument',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
IndexId: '',
RoleArn: '',
Documents: '',
CustomDocumentEnrichmentConfiguration: ''
},
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=AWSKendraFrontendService.BatchPutDocument');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IndexId: '',
RoleArn: '',
Documents: '',
CustomDocumentEnrichmentConfiguration: ''
});
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=AWSKendraFrontendService.BatchPutDocument',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
IndexId: '',
RoleArn: '',
Documents: '',
CustomDocumentEnrichmentConfiguration: ''
}
};
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=AWSKendraFrontendService.BatchPutDocument';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","RoleArn":"","Documents":"","CustomDocumentEnrichmentConfiguration":""}'
};
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 = @{ @"IndexId": @"",
@"RoleArn": @"",
@"Documents": @"",
@"CustomDocumentEnrichmentConfiguration": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchPutDocument"]
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=AWSKendraFrontendService.BatchPutDocument" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Documents\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchPutDocument",
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([
'IndexId' => '',
'RoleArn' => '',
'Documents' => '',
'CustomDocumentEnrichmentConfiguration' => ''
]),
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=AWSKendraFrontendService.BatchPutDocument', [
'body' => '{
"IndexId": "",
"RoleArn": "",
"Documents": "",
"CustomDocumentEnrichmentConfiguration": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchPutDocument');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IndexId' => '',
'RoleArn' => '',
'Documents' => '',
'CustomDocumentEnrichmentConfiguration' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IndexId' => '',
'RoleArn' => '',
'Documents' => '',
'CustomDocumentEnrichmentConfiguration' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchPutDocument');
$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=AWSKendraFrontendService.BatchPutDocument' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"RoleArn": "",
"Documents": "",
"CustomDocumentEnrichmentConfiguration": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchPutDocument' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"RoleArn": "",
"Documents": "",
"CustomDocumentEnrichmentConfiguration": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Documents\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\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=AWSKendraFrontendService.BatchPutDocument"
payload = {
"IndexId": "",
"RoleArn": "",
"Documents": "",
"CustomDocumentEnrichmentConfiguration": ""
}
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=AWSKendraFrontendService.BatchPutDocument"
payload <- "{\n \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Documents\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\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=AWSKendraFrontendService.BatchPutDocument")
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 \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Documents\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\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 \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Documents\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\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=AWSKendraFrontendService.BatchPutDocument";
let payload = json!({
"IndexId": "",
"RoleArn": "",
"Documents": "",
"CustomDocumentEnrichmentConfiguration": ""
});
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=AWSKendraFrontendService.BatchPutDocument' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IndexId": "",
"RoleArn": "",
"Documents": "",
"CustomDocumentEnrichmentConfiguration": ""
}'
echo '{
"IndexId": "",
"RoleArn": "",
"Documents": "",
"CustomDocumentEnrichmentConfiguration": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchPutDocument' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IndexId": "",\n "RoleArn": "",\n "Documents": "",\n "CustomDocumentEnrichmentConfiguration": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchPutDocument'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"IndexId": "",
"RoleArn": "",
"Documents": "",
"CustomDocumentEnrichmentConfiguration": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.BatchPutDocument")! 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
ClearQuerySuggestions
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ClearQuerySuggestions
HEADERS
X-Amz-Target
BODY json
{
"IndexId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ClearQuerySuggestions");
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 \"IndexId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ClearQuerySuggestions" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IndexId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ClearQuerySuggestions"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IndexId\": \"\"\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=AWSKendraFrontendService.ClearQuerySuggestions"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IndexId\": \"\"\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=AWSKendraFrontendService.ClearQuerySuggestions");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IndexId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ClearQuerySuggestions"
payload := strings.NewReader("{\n \"IndexId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 19
{
"IndexId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ClearQuerySuggestions")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IndexId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ClearQuerySuggestions"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IndexId\": \"\"\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 \"IndexId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ClearQuerySuggestions")
.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=AWSKendraFrontendService.ClearQuerySuggestions")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IndexId\": \"\"\n}")
.asString();
const data = JSON.stringify({
IndexId: ''
});
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=AWSKendraFrontendService.ClearQuerySuggestions');
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=AWSKendraFrontendService.ClearQuerySuggestions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ClearQuerySuggestions';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":""}'
};
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=AWSKendraFrontendService.ClearQuerySuggestions',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IndexId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"IndexId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ClearQuerySuggestions")
.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({IndexId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ClearQuerySuggestions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {IndexId: ''},
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=AWSKendraFrontendService.ClearQuerySuggestions');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IndexId: ''
});
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=AWSKendraFrontendService.ClearQuerySuggestions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: ''}
};
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=AWSKendraFrontendService.ClearQuerySuggestions';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":""}'
};
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 = @{ @"IndexId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ClearQuerySuggestions"]
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=AWSKendraFrontendService.ClearQuerySuggestions" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IndexId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ClearQuerySuggestions",
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([
'IndexId' => ''
]),
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=AWSKendraFrontendService.ClearQuerySuggestions', [
'body' => '{
"IndexId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ClearQuerySuggestions');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IndexId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IndexId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ClearQuerySuggestions');
$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=AWSKendraFrontendService.ClearQuerySuggestions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ClearQuerySuggestions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IndexId\": \"\"\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=AWSKendraFrontendService.ClearQuerySuggestions"
payload = { "IndexId": "" }
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=AWSKendraFrontendService.ClearQuerySuggestions"
payload <- "{\n \"IndexId\": \"\"\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=AWSKendraFrontendService.ClearQuerySuggestions")
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 \"IndexId\": \"\"\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 \"IndexId\": \"\"\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=AWSKendraFrontendService.ClearQuerySuggestions";
let payload = json!({"IndexId": ""});
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=AWSKendraFrontendService.ClearQuerySuggestions' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IndexId": ""
}'
echo '{
"IndexId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ClearQuerySuggestions' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IndexId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ClearQuerySuggestions'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["IndexId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ClearQuerySuggestions")! 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
CreateAccessControlConfiguration
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateAccessControlConfiguration
HEADERS
X-Amz-Target
BODY json
{
"IndexId": "",
"Name": "",
"Description": "",
"AccessControlList": "",
"HierarchicalAccessControlList": "",
"ClientToken": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateAccessControlConfiguration");
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 \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"AccessControlList\": \"\",\n \"HierarchicalAccessControlList\": \"\",\n \"ClientToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateAccessControlConfiguration" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IndexId ""
:Name ""
:Description ""
:AccessControlList ""
:HierarchicalAccessControlList ""
:ClientToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateAccessControlConfiguration"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"AccessControlList\": \"\",\n \"HierarchicalAccessControlList\": \"\",\n \"ClientToken\": \"\"\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=AWSKendraFrontendService.CreateAccessControlConfiguration"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"AccessControlList\": \"\",\n \"HierarchicalAccessControlList\": \"\",\n \"ClientToken\": \"\"\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=AWSKendraFrontendService.CreateAccessControlConfiguration");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"AccessControlList\": \"\",\n \"HierarchicalAccessControlList\": \"\",\n \"ClientToken\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateAccessControlConfiguration"
payload := strings.NewReader("{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"AccessControlList\": \"\",\n \"HierarchicalAccessControlList\": \"\",\n \"ClientToken\": \"\"\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: 141
{
"IndexId": "",
"Name": "",
"Description": "",
"AccessControlList": "",
"HierarchicalAccessControlList": "",
"ClientToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateAccessControlConfiguration")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"AccessControlList\": \"\",\n \"HierarchicalAccessControlList\": \"\",\n \"ClientToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateAccessControlConfiguration"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"AccessControlList\": \"\",\n \"HierarchicalAccessControlList\": \"\",\n \"ClientToken\": \"\"\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 \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"AccessControlList\": \"\",\n \"HierarchicalAccessControlList\": \"\",\n \"ClientToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateAccessControlConfiguration")
.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=AWSKendraFrontendService.CreateAccessControlConfiguration")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"AccessControlList\": \"\",\n \"HierarchicalAccessControlList\": \"\",\n \"ClientToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
IndexId: '',
Name: '',
Description: '',
AccessControlList: '',
HierarchicalAccessControlList: '',
ClientToken: ''
});
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=AWSKendraFrontendService.CreateAccessControlConfiguration');
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=AWSKendraFrontendService.CreateAccessControlConfiguration',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
IndexId: '',
Name: '',
Description: '',
AccessControlList: '',
HierarchicalAccessControlList: '',
ClientToken: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateAccessControlConfiguration';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","Name":"","Description":"","AccessControlList":"","HierarchicalAccessControlList":"","ClientToken":""}'
};
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=AWSKendraFrontendService.CreateAccessControlConfiguration',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IndexId": "",\n "Name": "",\n "Description": "",\n "AccessControlList": "",\n "HierarchicalAccessControlList": "",\n "ClientToken": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"AccessControlList\": \"\",\n \"HierarchicalAccessControlList\": \"\",\n \"ClientToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateAccessControlConfiguration")
.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({
IndexId: '',
Name: '',
Description: '',
AccessControlList: '',
HierarchicalAccessControlList: '',
ClientToken: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateAccessControlConfiguration',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
IndexId: '',
Name: '',
Description: '',
AccessControlList: '',
HierarchicalAccessControlList: '',
ClientToken: ''
},
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=AWSKendraFrontendService.CreateAccessControlConfiguration');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IndexId: '',
Name: '',
Description: '',
AccessControlList: '',
HierarchicalAccessControlList: '',
ClientToken: ''
});
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=AWSKendraFrontendService.CreateAccessControlConfiguration',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
IndexId: '',
Name: '',
Description: '',
AccessControlList: '',
HierarchicalAccessControlList: '',
ClientToken: ''
}
};
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=AWSKendraFrontendService.CreateAccessControlConfiguration';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","Name":"","Description":"","AccessControlList":"","HierarchicalAccessControlList":"","ClientToken":""}'
};
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 = @{ @"IndexId": @"",
@"Name": @"",
@"Description": @"",
@"AccessControlList": @"",
@"HierarchicalAccessControlList": @"",
@"ClientToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateAccessControlConfiguration"]
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=AWSKendraFrontendService.CreateAccessControlConfiguration" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"AccessControlList\": \"\",\n \"HierarchicalAccessControlList\": \"\",\n \"ClientToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateAccessControlConfiguration",
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([
'IndexId' => '',
'Name' => '',
'Description' => '',
'AccessControlList' => '',
'HierarchicalAccessControlList' => '',
'ClientToken' => ''
]),
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=AWSKendraFrontendService.CreateAccessControlConfiguration', [
'body' => '{
"IndexId": "",
"Name": "",
"Description": "",
"AccessControlList": "",
"HierarchicalAccessControlList": "",
"ClientToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateAccessControlConfiguration');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IndexId' => '',
'Name' => '',
'Description' => '',
'AccessControlList' => '',
'HierarchicalAccessControlList' => '',
'ClientToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IndexId' => '',
'Name' => '',
'Description' => '',
'AccessControlList' => '',
'HierarchicalAccessControlList' => '',
'ClientToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateAccessControlConfiguration');
$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=AWSKendraFrontendService.CreateAccessControlConfiguration' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"Name": "",
"Description": "",
"AccessControlList": "",
"HierarchicalAccessControlList": "",
"ClientToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateAccessControlConfiguration' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"Name": "",
"Description": "",
"AccessControlList": "",
"HierarchicalAccessControlList": "",
"ClientToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"AccessControlList\": \"\",\n \"HierarchicalAccessControlList\": \"\",\n \"ClientToken\": \"\"\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=AWSKendraFrontendService.CreateAccessControlConfiguration"
payload = {
"IndexId": "",
"Name": "",
"Description": "",
"AccessControlList": "",
"HierarchicalAccessControlList": "",
"ClientToken": ""
}
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=AWSKendraFrontendService.CreateAccessControlConfiguration"
payload <- "{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"AccessControlList\": \"\",\n \"HierarchicalAccessControlList\": \"\",\n \"ClientToken\": \"\"\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=AWSKendraFrontendService.CreateAccessControlConfiguration")
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 \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"AccessControlList\": \"\",\n \"HierarchicalAccessControlList\": \"\",\n \"ClientToken\": \"\"\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 \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"AccessControlList\": \"\",\n \"HierarchicalAccessControlList\": \"\",\n \"ClientToken\": \"\"\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=AWSKendraFrontendService.CreateAccessControlConfiguration";
let payload = json!({
"IndexId": "",
"Name": "",
"Description": "",
"AccessControlList": "",
"HierarchicalAccessControlList": "",
"ClientToken": ""
});
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=AWSKendraFrontendService.CreateAccessControlConfiguration' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IndexId": "",
"Name": "",
"Description": "",
"AccessControlList": "",
"HierarchicalAccessControlList": "",
"ClientToken": ""
}'
echo '{
"IndexId": "",
"Name": "",
"Description": "",
"AccessControlList": "",
"HierarchicalAccessControlList": "",
"ClientToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateAccessControlConfiguration' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IndexId": "",\n "Name": "",\n "Description": "",\n "AccessControlList": "",\n "HierarchicalAccessControlList": "",\n "ClientToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateAccessControlConfiguration'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"IndexId": "",
"Name": "",
"Description": "",
"AccessControlList": "",
"HierarchicalAccessControlList": "",
"ClientToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateAccessControlConfiguration")! 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
CreateDataSource
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateDataSource
HEADERS
X-Amz-Target
BODY json
{
"Name": "",
"IndexId": "",
"Type": "",
"Configuration": "",
"VpcConfiguration": "",
"Description": "",
"Schedule": "",
"RoleArn": "",
"Tags": "",
"ClientToken": "",
"LanguageCode": "",
"CustomDocumentEnrichmentConfiguration": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateDataSource");
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 \"IndexId\": \"\",\n \"Type\": \"\",\n \"Configuration\": \"\",\n \"VpcConfiguration\": \"\",\n \"Description\": \"\",\n \"Schedule\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"ClientToken\": \"\",\n \"LanguageCode\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateDataSource" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Name ""
:IndexId ""
:Type ""
:Configuration ""
:VpcConfiguration ""
:Description ""
:Schedule ""
:RoleArn ""
:Tags ""
:ClientToken ""
:LanguageCode ""
:CustomDocumentEnrichmentConfiguration ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateDataSource"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Type\": \"\",\n \"Configuration\": \"\",\n \"VpcConfiguration\": \"\",\n \"Description\": \"\",\n \"Schedule\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"ClientToken\": \"\",\n \"LanguageCode\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\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=AWSKendraFrontendService.CreateDataSource"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Type\": \"\",\n \"Configuration\": \"\",\n \"VpcConfiguration\": \"\",\n \"Description\": \"\",\n \"Schedule\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"ClientToken\": \"\",\n \"LanguageCode\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\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=AWSKendraFrontendService.CreateDataSource");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Type\": \"\",\n \"Configuration\": \"\",\n \"VpcConfiguration\": \"\",\n \"Description\": \"\",\n \"Schedule\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"ClientToken\": \"\",\n \"LanguageCode\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateDataSource"
payload := strings.NewReader("{\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Type\": \"\",\n \"Configuration\": \"\",\n \"VpcConfiguration\": \"\",\n \"Description\": \"\",\n \"Schedule\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"ClientToken\": \"\",\n \"LanguageCode\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\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: 256
{
"Name": "",
"IndexId": "",
"Type": "",
"Configuration": "",
"VpcConfiguration": "",
"Description": "",
"Schedule": "",
"RoleArn": "",
"Tags": "",
"ClientToken": "",
"LanguageCode": "",
"CustomDocumentEnrichmentConfiguration": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateDataSource")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Type\": \"\",\n \"Configuration\": \"\",\n \"VpcConfiguration\": \"\",\n \"Description\": \"\",\n \"Schedule\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"ClientToken\": \"\",\n \"LanguageCode\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateDataSource"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Type\": \"\",\n \"Configuration\": \"\",\n \"VpcConfiguration\": \"\",\n \"Description\": \"\",\n \"Schedule\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"ClientToken\": \"\",\n \"LanguageCode\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\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 \"IndexId\": \"\",\n \"Type\": \"\",\n \"Configuration\": \"\",\n \"VpcConfiguration\": \"\",\n \"Description\": \"\",\n \"Schedule\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"ClientToken\": \"\",\n \"LanguageCode\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateDataSource")
.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=AWSKendraFrontendService.CreateDataSource")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Type\": \"\",\n \"Configuration\": \"\",\n \"VpcConfiguration\": \"\",\n \"Description\": \"\",\n \"Schedule\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"ClientToken\": \"\",\n \"LanguageCode\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\n}")
.asString();
const data = JSON.stringify({
Name: '',
IndexId: '',
Type: '',
Configuration: '',
VpcConfiguration: '',
Description: '',
Schedule: '',
RoleArn: '',
Tags: '',
ClientToken: '',
LanguageCode: '',
CustomDocumentEnrichmentConfiguration: ''
});
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=AWSKendraFrontendService.CreateDataSource');
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=AWSKendraFrontendService.CreateDataSource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Name: '',
IndexId: '',
Type: '',
Configuration: '',
VpcConfiguration: '',
Description: '',
Schedule: '',
RoleArn: '',
Tags: '',
ClientToken: '',
LanguageCode: '',
CustomDocumentEnrichmentConfiguration: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateDataSource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","IndexId":"","Type":"","Configuration":"","VpcConfiguration":"","Description":"","Schedule":"","RoleArn":"","Tags":"","ClientToken":"","LanguageCode":"","CustomDocumentEnrichmentConfiguration":""}'
};
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=AWSKendraFrontendService.CreateDataSource',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Name": "",\n "IndexId": "",\n "Type": "",\n "Configuration": "",\n "VpcConfiguration": "",\n "Description": "",\n "Schedule": "",\n "RoleArn": "",\n "Tags": "",\n "ClientToken": "",\n "LanguageCode": "",\n "CustomDocumentEnrichmentConfiguration": ""\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 \"IndexId\": \"\",\n \"Type\": \"\",\n \"Configuration\": \"\",\n \"VpcConfiguration\": \"\",\n \"Description\": \"\",\n \"Schedule\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"ClientToken\": \"\",\n \"LanguageCode\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateDataSource")
.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: '',
IndexId: '',
Type: '',
Configuration: '',
VpcConfiguration: '',
Description: '',
Schedule: '',
RoleArn: '',
Tags: '',
ClientToken: '',
LanguageCode: '',
CustomDocumentEnrichmentConfiguration: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateDataSource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
Name: '',
IndexId: '',
Type: '',
Configuration: '',
VpcConfiguration: '',
Description: '',
Schedule: '',
RoleArn: '',
Tags: '',
ClientToken: '',
LanguageCode: '',
CustomDocumentEnrichmentConfiguration: ''
},
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=AWSKendraFrontendService.CreateDataSource');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Name: '',
IndexId: '',
Type: '',
Configuration: '',
VpcConfiguration: '',
Description: '',
Schedule: '',
RoleArn: '',
Tags: '',
ClientToken: '',
LanguageCode: '',
CustomDocumentEnrichmentConfiguration: ''
});
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=AWSKendraFrontendService.CreateDataSource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Name: '',
IndexId: '',
Type: '',
Configuration: '',
VpcConfiguration: '',
Description: '',
Schedule: '',
RoleArn: '',
Tags: '',
ClientToken: '',
LanguageCode: '',
CustomDocumentEnrichmentConfiguration: ''
}
};
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=AWSKendraFrontendService.CreateDataSource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","IndexId":"","Type":"","Configuration":"","VpcConfiguration":"","Description":"","Schedule":"","RoleArn":"","Tags":"","ClientToken":"","LanguageCode":"","CustomDocumentEnrichmentConfiguration":""}'
};
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": @"",
@"IndexId": @"",
@"Type": @"",
@"Configuration": @"",
@"VpcConfiguration": @"",
@"Description": @"",
@"Schedule": @"",
@"RoleArn": @"",
@"Tags": @"",
@"ClientToken": @"",
@"LanguageCode": @"",
@"CustomDocumentEnrichmentConfiguration": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateDataSource"]
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=AWSKendraFrontendService.CreateDataSource" 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 \"IndexId\": \"\",\n \"Type\": \"\",\n \"Configuration\": \"\",\n \"VpcConfiguration\": \"\",\n \"Description\": \"\",\n \"Schedule\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"ClientToken\": \"\",\n \"LanguageCode\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateDataSource",
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' => '',
'IndexId' => '',
'Type' => '',
'Configuration' => '',
'VpcConfiguration' => '',
'Description' => '',
'Schedule' => '',
'RoleArn' => '',
'Tags' => '',
'ClientToken' => '',
'LanguageCode' => '',
'CustomDocumentEnrichmentConfiguration' => ''
]),
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=AWSKendraFrontendService.CreateDataSource', [
'body' => '{
"Name": "",
"IndexId": "",
"Type": "",
"Configuration": "",
"VpcConfiguration": "",
"Description": "",
"Schedule": "",
"RoleArn": "",
"Tags": "",
"ClientToken": "",
"LanguageCode": "",
"CustomDocumentEnrichmentConfiguration": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateDataSource');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Name' => '',
'IndexId' => '',
'Type' => '',
'Configuration' => '',
'VpcConfiguration' => '',
'Description' => '',
'Schedule' => '',
'RoleArn' => '',
'Tags' => '',
'ClientToken' => '',
'LanguageCode' => '',
'CustomDocumentEnrichmentConfiguration' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Name' => '',
'IndexId' => '',
'Type' => '',
'Configuration' => '',
'VpcConfiguration' => '',
'Description' => '',
'Schedule' => '',
'RoleArn' => '',
'Tags' => '',
'ClientToken' => '',
'LanguageCode' => '',
'CustomDocumentEnrichmentConfiguration' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateDataSource');
$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=AWSKendraFrontendService.CreateDataSource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"IndexId": "",
"Type": "",
"Configuration": "",
"VpcConfiguration": "",
"Description": "",
"Schedule": "",
"RoleArn": "",
"Tags": "",
"ClientToken": "",
"LanguageCode": "",
"CustomDocumentEnrichmentConfiguration": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateDataSource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"IndexId": "",
"Type": "",
"Configuration": "",
"VpcConfiguration": "",
"Description": "",
"Schedule": "",
"RoleArn": "",
"Tags": "",
"ClientToken": "",
"LanguageCode": "",
"CustomDocumentEnrichmentConfiguration": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Type\": \"\",\n \"Configuration\": \"\",\n \"VpcConfiguration\": \"\",\n \"Description\": \"\",\n \"Schedule\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"ClientToken\": \"\",\n \"LanguageCode\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\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=AWSKendraFrontendService.CreateDataSource"
payload = {
"Name": "",
"IndexId": "",
"Type": "",
"Configuration": "",
"VpcConfiguration": "",
"Description": "",
"Schedule": "",
"RoleArn": "",
"Tags": "",
"ClientToken": "",
"LanguageCode": "",
"CustomDocumentEnrichmentConfiguration": ""
}
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=AWSKendraFrontendService.CreateDataSource"
payload <- "{\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Type\": \"\",\n \"Configuration\": \"\",\n \"VpcConfiguration\": \"\",\n \"Description\": \"\",\n \"Schedule\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"ClientToken\": \"\",\n \"LanguageCode\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\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=AWSKendraFrontendService.CreateDataSource")
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 \"IndexId\": \"\",\n \"Type\": \"\",\n \"Configuration\": \"\",\n \"VpcConfiguration\": \"\",\n \"Description\": \"\",\n \"Schedule\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"ClientToken\": \"\",\n \"LanguageCode\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\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 \"IndexId\": \"\",\n \"Type\": \"\",\n \"Configuration\": \"\",\n \"VpcConfiguration\": \"\",\n \"Description\": \"\",\n \"Schedule\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"ClientToken\": \"\",\n \"LanguageCode\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\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=AWSKendraFrontendService.CreateDataSource";
let payload = json!({
"Name": "",
"IndexId": "",
"Type": "",
"Configuration": "",
"VpcConfiguration": "",
"Description": "",
"Schedule": "",
"RoleArn": "",
"Tags": "",
"ClientToken": "",
"LanguageCode": "",
"CustomDocumentEnrichmentConfiguration": ""
});
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=AWSKendraFrontendService.CreateDataSource' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Name": "",
"IndexId": "",
"Type": "",
"Configuration": "",
"VpcConfiguration": "",
"Description": "",
"Schedule": "",
"RoleArn": "",
"Tags": "",
"ClientToken": "",
"LanguageCode": "",
"CustomDocumentEnrichmentConfiguration": ""
}'
echo '{
"Name": "",
"IndexId": "",
"Type": "",
"Configuration": "",
"VpcConfiguration": "",
"Description": "",
"Schedule": "",
"RoleArn": "",
"Tags": "",
"ClientToken": "",
"LanguageCode": "",
"CustomDocumentEnrichmentConfiguration": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateDataSource' \
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 "IndexId": "",\n "Type": "",\n "Configuration": "",\n "VpcConfiguration": "",\n "Description": "",\n "Schedule": "",\n "RoleArn": "",\n "Tags": "",\n "ClientToken": "",\n "LanguageCode": "",\n "CustomDocumentEnrichmentConfiguration": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateDataSource'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Name": "",
"IndexId": "",
"Type": "",
"Configuration": "",
"VpcConfiguration": "",
"Description": "",
"Schedule": "",
"RoleArn": "",
"Tags": "",
"ClientToken": "",
"LanguageCode": "",
"CustomDocumentEnrichmentConfiguration": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateDataSource")! 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
CreateExperience
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateExperience
HEADERS
X-Amz-Target
BODY json
{
"Name": "",
"IndexId": "",
"RoleArn": "",
"Configuration": "",
"Description": "",
"ClientToken": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateExperience");
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 \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Configuration\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateExperience" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Name ""
:IndexId ""
:RoleArn ""
:Configuration ""
:Description ""
:ClientToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateExperience"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Configuration\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\"\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=AWSKendraFrontendService.CreateExperience"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Configuration\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\"\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=AWSKendraFrontendService.CreateExperience");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Configuration\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateExperience"
payload := strings.NewReader("{\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Configuration\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\"\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: 115
{
"Name": "",
"IndexId": "",
"RoleArn": "",
"Configuration": "",
"Description": "",
"ClientToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateExperience")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Configuration\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateExperience"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Configuration\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\"\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 \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Configuration\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateExperience")
.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=AWSKendraFrontendService.CreateExperience")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Configuration\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
Name: '',
IndexId: '',
RoleArn: '',
Configuration: '',
Description: '',
ClientToken: ''
});
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=AWSKendraFrontendService.CreateExperience');
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=AWSKendraFrontendService.CreateExperience',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Name: '',
IndexId: '',
RoleArn: '',
Configuration: '',
Description: '',
ClientToken: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateExperience';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","IndexId":"","RoleArn":"","Configuration":"","Description":"","ClientToken":""}'
};
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=AWSKendraFrontendService.CreateExperience',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Name": "",\n "IndexId": "",\n "RoleArn": "",\n "Configuration": "",\n "Description": "",\n "ClientToken": ""\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 \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Configuration\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateExperience")
.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: '',
IndexId: '',
RoleArn: '',
Configuration: '',
Description: '',
ClientToken: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateExperience',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
Name: '',
IndexId: '',
RoleArn: '',
Configuration: '',
Description: '',
ClientToken: ''
},
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=AWSKendraFrontendService.CreateExperience');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Name: '',
IndexId: '',
RoleArn: '',
Configuration: '',
Description: '',
ClientToken: ''
});
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=AWSKendraFrontendService.CreateExperience',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Name: '',
IndexId: '',
RoleArn: '',
Configuration: '',
Description: '',
ClientToken: ''
}
};
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=AWSKendraFrontendService.CreateExperience';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","IndexId":"","RoleArn":"","Configuration":"","Description":"","ClientToken":""}'
};
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": @"",
@"IndexId": @"",
@"RoleArn": @"",
@"Configuration": @"",
@"Description": @"",
@"ClientToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateExperience"]
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=AWSKendraFrontendService.CreateExperience" 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 \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Configuration\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateExperience",
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' => '',
'IndexId' => '',
'RoleArn' => '',
'Configuration' => '',
'Description' => '',
'ClientToken' => ''
]),
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=AWSKendraFrontendService.CreateExperience', [
'body' => '{
"Name": "",
"IndexId": "",
"RoleArn": "",
"Configuration": "",
"Description": "",
"ClientToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateExperience');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Name' => '',
'IndexId' => '',
'RoleArn' => '',
'Configuration' => '',
'Description' => '',
'ClientToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Name' => '',
'IndexId' => '',
'RoleArn' => '',
'Configuration' => '',
'Description' => '',
'ClientToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateExperience');
$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=AWSKendraFrontendService.CreateExperience' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"IndexId": "",
"RoleArn": "",
"Configuration": "",
"Description": "",
"ClientToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateExperience' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"IndexId": "",
"RoleArn": "",
"Configuration": "",
"Description": "",
"ClientToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Configuration\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\"\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=AWSKendraFrontendService.CreateExperience"
payload = {
"Name": "",
"IndexId": "",
"RoleArn": "",
"Configuration": "",
"Description": "",
"ClientToken": ""
}
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=AWSKendraFrontendService.CreateExperience"
payload <- "{\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Configuration\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\"\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=AWSKendraFrontendService.CreateExperience")
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 \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Configuration\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\"\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 \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Configuration\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\"\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=AWSKendraFrontendService.CreateExperience";
let payload = json!({
"Name": "",
"IndexId": "",
"RoleArn": "",
"Configuration": "",
"Description": "",
"ClientToken": ""
});
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=AWSKendraFrontendService.CreateExperience' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Name": "",
"IndexId": "",
"RoleArn": "",
"Configuration": "",
"Description": "",
"ClientToken": ""
}'
echo '{
"Name": "",
"IndexId": "",
"RoleArn": "",
"Configuration": "",
"Description": "",
"ClientToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateExperience' \
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 "IndexId": "",\n "RoleArn": "",\n "Configuration": "",\n "Description": "",\n "ClientToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateExperience'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Name": "",
"IndexId": "",
"RoleArn": "",
"Configuration": "",
"Description": "",
"ClientToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateExperience")! 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
CreateFaq
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateFaq
HEADERS
X-Amz-Target
BODY json
{
"IndexId": "",
"Name": "",
"Description": "",
"S3Path": "",
"RoleArn": "",
"Tags": "",
"FileFormat": "",
"ClientToken": "",
"LanguageCode": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateFaq");
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 \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"S3Path\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"FileFormat\": \"\",\n \"ClientToken\": \"\",\n \"LanguageCode\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateFaq" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IndexId ""
:Name ""
:Description ""
:S3Path ""
:RoleArn ""
:Tags ""
:FileFormat ""
:ClientToken ""
:LanguageCode ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateFaq"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"S3Path\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"FileFormat\": \"\",\n \"ClientToken\": \"\",\n \"LanguageCode\": \"\"\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=AWSKendraFrontendService.CreateFaq"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"S3Path\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"FileFormat\": \"\",\n \"ClientToken\": \"\",\n \"LanguageCode\": \"\"\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=AWSKendraFrontendService.CreateFaq");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"S3Path\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"FileFormat\": \"\",\n \"ClientToken\": \"\",\n \"LanguageCode\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateFaq"
payload := strings.NewReader("{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"S3Path\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"FileFormat\": \"\",\n \"ClientToken\": \"\",\n \"LanguageCode\": \"\"\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: 164
{
"IndexId": "",
"Name": "",
"Description": "",
"S3Path": "",
"RoleArn": "",
"Tags": "",
"FileFormat": "",
"ClientToken": "",
"LanguageCode": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateFaq")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"S3Path\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"FileFormat\": \"\",\n \"ClientToken\": \"\",\n \"LanguageCode\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateFaq"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"S3Path\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"FileFormat\": \"\",\n \"ClientToken\": \"\",\n \"LanguageCode\": \"\"\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 \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"S3Path\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"FileFormat\": \"\",\n \"ClientToken\": \"\",\n \"LanguageCode\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateFaq")
.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=AWSKendraFrontendService.CreateFaq")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"S3Path\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"FileFormat\": \"\",\n \"ClientToken\": \"\",\n \"LanguageCode\": \"\"\n}")
.asString();
const data = JSON.stringify({
IndexId: '',
Name: '',
Description: '',
S3Path: '',
RoleArn: '',
Tags: '',
FileFormat: '',
ClientToken: '',
LanguageCode: ''
});
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=AWSKendraFrontendService.CreateFaq');
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=AWSKendraFrontendService.CreateFaq',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
IndexId: '',
Name: '',
Description: '',
S3Path: '',
RoleArn: '',
Tags: '',
FileFormat: '',
ClientToken: '',
LanguageCode: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateFaq';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","Name":"","Description":"","S3Path":"","RoleArn":"","Tags":"","FileFormat":"","ClientToken":"","LanguageCode":""}'
};
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=AWSKendraFrontendService.CreateFaq',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IndexId": "",\n "Name": "",\n "Description": "",\n "S3Path": "",\n "RoleArn": "",\n "Tags": "",\n "FileFormat": "",\n "ClientToken": "",\n "LanguageCode": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"S3Path\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"FileFormat\": \"\",\n \"ClientToken\": \"\",\n \"LanguageCode\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateFaq")
.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({
IndexId: '',
Name: '',
Description: '',
S3Path: '',
RoleArn: '',
Tags: '',
FileFormat: '',
ClientToken: '',
LanguageCode: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateFaq',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
IndexId: '',
Name: '',
Description: '',
S3Path: '',
RoleArn: '',
Tags: '',
FileFormat: '',
ClientToken: '',
LanguageCode: ''
},
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=AWSKendraFrontendService.CreateFaq');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IndexId: '',
Name: '',
Description: '',
S3Path: '',
RoleArn: '',
Tags: '',
FileFormat: '',
ClientToken: '',
LanguageCode: ''
});
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=AWSKendraFrontendService.CreateFaq',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
IndexId: '',
Name: '',
Description: '',
S3Path: '',
RoleArn: '',
Tags: '',
FileFormat: '',
ClientToken: '',
LanguageCode: ''
}
};
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=AWSKendraFrontendService.CreateFaq';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","Name":"","Description":"","S3Path":"","RoleArn":"","Tags":"","FileFormat":"","ClientToken":"","LanguageCode":""}'
};
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 = @{ @"IndexId": @"",
@"Name": @"",
@"Description": @"",
@"S3Path": @"",
@"RoleArn": @"",
@"Tags": @"",
@"FileFormat": @"",
@"ClientToken": @"",
@"LanguageCode": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateFaq"]
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=AWSKendraFrontendService.CreateFaq" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"S3Path\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"FileFormat\": \"\",\n \"ClientToken\": \"\",\n \"LanguageCode\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateFaq",
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([
'IndexId' => '',
'Name' => '',
'Description' => '',
'S3Path' => '',
'RoleArn' => '',
'Tags' => '',
'FileFormat' => '',
'ClientToken' => '',
'LanguageCode' => ''
]),
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=AWSKendraFrontendService.CreateFaq', [
'body' => '{
"IndexId": "",
"Name": "",
"Description": "",
"S3Path": "",
"RoleArn": "",
"Tags": "",
"FileFormat": "",
"ClientToken": "",
"LanguageCode": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateFaq');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IndexId' => '',
'Name' => '',
'Description' => '',
'S3Path' => '',
'RoleArn' => '',
'Tags' => '',
'FileFormat' => '',
'ClientToken' => '',
'LanguageCode' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IndexId' => '',
'Name' => '',
'Description' => '',
'S3Path' => '',
'RoleArn' => '',
'Tags' => '',
'FileFormat' => '',
'ClientToken' => '',
'LanguageCode' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateFaq');
$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=AWSKendraFrontendService.CreateFaq' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"Name": "",
"Description": "",
"S3Path": "",
"RoleArn": "",
"Tags": "",
"FileFormat": "",
"ClientToken": "",
"LanguageCode": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateFaq' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"Name": "",
"Description": "",
"S3Path": "",
"RoleArn": "",
"Tags": "",
"FileFormat": "",
"ClientToken": "",
"LanguageCode": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"S3Path\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"FileFormat\": \"\",\n \"ClientToken\": \"\",\n \"LanguageCode\": \"\"\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=AWSKendraFrontendService.CreateFaq"
payload = {
"IndexId": "",
"Name": "",
"Description": "",
"S3Path": "",
"RoleArn": "",
"Tags": "",
"FileFormat": "",
"ClientToken": "",
"LanguageCode": ""
}
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=AWSKendraFrontendService.CreateFaq"
payload <- "{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"S3Path\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"FileFormat\": \"\",\n \"ClientToken\": \"\",\n \"LanguageCode\": \"\"\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=AWSKendraFrontendService.CreateFaq")
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 \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"S3Path\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"FileFormat\": \"\",\n \"ClientToken\": \"\",\n \"LanguageCode\": \"\"\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 \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"S3Path\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"FileFormat\": \"\",\n \"ClientToken\": \"\",\n \"LanguageCode\": \"\"\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=AWSKendraFrontendService.CreateFaq";
let payload = json!({
"IndexId": "",
"Name": "",
"Description": "",
"S3Path": "",
"RoleArn": "",
"Tags": "",
"FileFormat": "",
"ClientToken": "",
"LanguageCode": ""
});
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=AWSKendraFrontendService.CreateFaq' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IndexId": "",
"Name": "",
"Description": "",
"S3Path": "",
"RoleArn": "",
"Tags": "",
"FileFormat": "",
"ClientToken": "",
"LanguageCode": ""
}'
echo '{
"IndexId": "",
"Name": "",
"Description": "",
"S3Path": "",
"RoleArn": "",
"Tags": "",
"FileFormat": "",
"ClientToken": "",
"LanguageCode": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateFaq' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IndexId": "",\n "Name": "",\n "Description": "",\n "S3Path": "",\n "RoleArn": "",\n "Tags": "",\n "FileFormat": "",\n "ClientToken": "",\n "LanguageCode": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateFaq'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"IndexId": "",
"Name": "",
"Description": "",
"S3Path": "",
"RoleArn": "",
"Tags": "",
"FileFormat": "",
"ClientToken": "",
"LanguageCode": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateFaq")! 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
CreateFeaturedResultsSet
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateFeaturedResultsSet
HEADERS
X-Amz-Target
BODY json
{
"IndexId": "",
"FeaturedResultsSetName": "",
"Description": "",
"ClientToken": "",
"Status": "",
"QueryTexts": "",
"FeaturedDocuments": "",
"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=AWSKendraFrontendService.CreateFeaturedResultsSet");
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 \"IndexId\": \"\",\n \"FeaturedResultsSetName\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"Status\": \"\",\n \"QueryTexts\": \"\",\n \"FeaturedDocuments\": \"\",\n \"Tags\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateFeaturedResultsSet" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IndexId ""
:FeaturedResultsSetName ""
:Description ""
:ClientToken ""
:Status ""
:QueryTexts ""
:FeaturedDocuments ""
:Tags ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateFeaturedResultsSet"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IndexId\": \"\",\n \"FeaturedResultsSetName\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"Status\": \"\",\n \"QueryTexts\": \"\",\n \"FeaturedDocuments\": \"\",\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=AWSKendraFrontendService.CreateFeaturedResultsSet"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IndexId\": \"\",\n \"FeaturedResultsSetName\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"Status\": \"\",\n \"QueryTexts\": \"\",\n \"FeaturedDocuments\": \"\",\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=AWSKendraFrontendService.CreateFeaturedResultsSet");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IndexId\": \"\",\n \"FeaturedResultsSetName\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"Status\": \"\",\n \"QueryTexts\": \"\",\n \"FeaturedDocuments\": \"\",\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=AWSKendraFrontendService.CreateFeaturedResultsSet"
payload := strings.NewReader("{\n \"IndexId\": \"\",\n \"FeaturedResultsSetName\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"Status\": \"\",\n \"QueryTexts\": \"\",\n \"FeaturedDocuments\": \"\",\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: 170
{
"IndexId": "",
"FeaturedResultsSetName": "",
"Description": "",
"ClientToken": "",
"Status": "",
"QueryTexts": "",
"FeaturedDocuments": "",
"Tags": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateFeaturedResultsSet")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IndexId\": \"\",\n \"FeaturedResultsSetName\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"Status\": \"\",\n \"QueryTexts\": \"\",\n \"FeaturedDocuments\": \"\",\n \"Tags\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateFeaturedResultsSet"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IndexId\": \"\",\n \"FeaturedResultsSetName\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"Status\": \"\",\n \"QueryTexts\": \"\",\n \"FeaturedDocuments\": \"\",\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 \"IndexId\": \"\",\n \"FeaturedResultsSetName\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"Status\": \"\",\n \"QueryTexts\": \"\",\n \"FeaturedDocuments\": \"\",\n \"Tags\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateFeaturedResultsSet")
.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=AWSKendraFrontendService.CreateFeaturedResultsSet")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IndexId\": \"\",\n \"FeaturedResultsSetName\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"Status\": \"\",\n \"QueryTexts\": \"\",\n \"FeaturedDocuments\": \"\",\n \"Tags\": \"\"\n}")
.asString();
const data = JSON.stringify({
IndexId: '',
FeaturedResultsSetName: '',
Description: '',
ClientToken: '',
Status: '',
QueryTexts: '',
FeaturedDocuments: '',
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=AWSKendraFrontendService.CreateFeaturedResultsSet');
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=AWSKendraFrontendService.CreateFeaturedResultsSet',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
IndexId: '',
FeaturedResultsSetName: '',
Description: '',
ClientToken: '',
Status: '',
QueryTexts: '',
FeaturedDocuments: '',
Tags: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateFeaturedResultsSet';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","FeaturedResultsSetName":"","Description":"","ClientToken":"","Status":"","QueryTexts":"","FeaturedDocuments":"","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=AWSKendraFrontendService.CreateFeaturedResultsSet',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IndexId": "",\n "FeaturedResultsSetName": "",\n "Description": "",\n "ClientToken": "",\n "Status": "",\n "QueryTexts": "",\n "FeaturedDocuments": "",\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 \"IndexId\": \"\",\n \"FeaturedResultsSetName\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"Status\": \"\",\n \"QueryTexts\": \"\",\n \"FeaturedDocuments\": \"\",\n \"Tags\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateFeaturedResultsSet")
.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({
IndexId: '',
FeaturedResultsSetName: '',
Description: '',
ClientToken: '',
Status: '',
QueryTexts: '',
FeaturedDocuments: '',
Tags: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateFeaturedResultsSet',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
IndexId: '',
FeaturedResultsSetName: '',
Description: '',
ClientToken: '',
Status: '',
QueryTexts: '',
FeaturedDocuments: '',
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=AWSKendraFrontendService.CreateFeaturedResultsSet');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IndexId: '',
FeaturedResultsSetName: '',
Description: '',
ClientToken: '',
Status: '',
QueryTexts: '',
FeaturedDocuments: '',
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=AWSKendraFrontendService.CreateFeaturedResultsSet',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
IndexId: '',
FeaturedResultsSetName: '',
Description: '',
ClientToken: '',
Status: '',
QueryTexts: '',
FeaturedDocuments: '',
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=AWSKendraFrontendService.CreateFeaturedResultsSet';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","FeaturedResultsSetName":"","Description":"","ClientToken":"","Status":"","QueryTexts":"","FeaturedDocuments":"","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 = @{ @"IndexId": @"",
@"FeaturedResultsSetName": @"",
@"Description": @"",
@"ClientToken": @"",
@"Status": @"",
@"QueryTexts": @"",
@"FeaturedDocuments": @"",
@"Tags": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateFeaturedResultsSet"]
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=AWSKendraFrontendService.CreateFeaturedResultsSet" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IndexId\": \"\",\n \"FeaturedResultsSetName\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"Status\": \"\",\n \"QueryTexts\": \"\",\n \"FeaturedDocuments\": \"\",\n \"Tags\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateFeaturedResultsSet",
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([
'IndexId' => '',
'FeaturedResultsSetName' => '',
'Description' => '',
'ClientToken' => '',
'Status' => '',
'QueryTexts' => '',
'FeaturedDocuments' => '',
'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=AWSKendraFrontendService.CreateFeaturedResultsSet', [
'body' => '{
"IndexId": "",
"FeaturedResultsSetName": "",
"Description": "",
"ClientToken": "",
"Status": "",
"QueryTexts": "",
"FeaturedDocuments": "",
"Tags": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateFeaturedResultsSet');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IndexId' => '',
'FeaturedResultsSetName' => '',
'Description' => '',
'ClientToken' => '',
'Status' => '',
'QueryTexts' => '',
'FeaturedDocuments' => '',
'Tags' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IndexId' => '',
'FeaturedResultsSetName' => '',
'Description' => '',
'ClientToken' => '',
'Status' => '',
'QueryTexts' => '',
'FeaturedDocuments' => '',
'Tags' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateFeaturedResultsSet');
$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=AWSKendraFrontendService.CreateFeaturedResultsSet' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"FeaturedResultsSetName": "",
"Description": "",
"ClientToken": "",
"Status": "",
"QueryTexts": "",
"FeaturedDocuments": "",
"Tags": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateFeaturedResultsSet' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"FeaturedResultsSetName": "",
"Description": "",
"ClientToken": "",
"Status": "",
"QueryTexts": "",
"FeaturedDocuments": "",
"Tags": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IndexId\": \"\",\n \"FeaturedResultsSetName\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"Status\": \"\",\n \"QueryTexts\": \"\",\n \"FeaturedDocuments\": \"\",\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=AWSKendraFrontendService.CreateFeaturedResultsSet"
payload = {
"IndexId": "",
"FeaturedResultsSetName": "",
"Description": "",
"ClientToken": "",
"Status": "",
"QueryTexts": "",
"FeaturedDocuments": "",
"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=AWSKendraFrontendService.CreateFeaturedResultsSet"
payload <- "{\n \"IndexId\": \"\",\n \"FeaturedResultsSetName\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"Status\": \"\",\n \"QueryTexts\": \"\",\n \"FeaturedDocuments\": \"\",\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=AWSKendraFrontendService.CreateFeaturedResultsSet")
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 \"IndexId\": \"\",\n \"FeaturedResultsSetName\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"Status\": \"\",\n \"QueryTexts\": \"\",\n \"FeaturedDocuments\": \"\",\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 \"IndexId\": \"\",\n \"FeaturedResultsSetName\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"Status\": \"\",\n \"QueryTexts\": \"\",\n \"FeaturedDocuments\": \"\",\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=AWSKendraFrontendService.CreateFeaturedResultsSet";
let payload = json!({
"IndexId": "",
"FeaturedResultsSetName": "",
"Description": "",
"ClientToken": "",
"Status": "",
"QueryTexts": "",
"FeaturedDocuments": "",
"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=AWSKendraFrontendService.CreateFeaturedResultsSet' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IndexId": "",
"FeaturedResultsSetName": "",
"Description": "",
"ClientToken": "",
"Status": "",
"QueryTexts": "",
"FeaturedDocuments": "",
"Tags": ""
}'
echo '{
"IndexId": "",
"FeaturedResultsSetName": "",
"Description": "",
"ClientToken": "",
"Status": "",
"QueryTexts": "",
"FeaturedDocuments": "",
"Tags": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateFeaturedResultsSet' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IndexId": "",\n "FeaturedResultsSetName": "",\n "Description": "",\n "ClientToken": "",\n "Status": "",\n "QueryTexts": "",\n "FeaturedDocuments": "",\n "Tags": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateFeaturedResultsSet'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"IndexId": "",
"FeaturedResultsSetName": "",
"Description": "",
"ClientToken": "",
"Status": "",
"QueryTexts": "",
"FeaturedDocuments": "",
"Tags": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateFeaturedResultsSet")! 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
CreateIndex
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateIndex
HEADERS
X-Amz-Target
BODY json
{
"Name": "",
"Edition": "",
"RoleArn": "",
"ServerSideEncryptionConfiguration": "",
"Description": "",
"ClientToken": "",
"Tags": "",
"UserTokenConfigurations": "",
"UserContextPolicy": "",
"UserGroupResolutionConfiguration": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateIndex");
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 \"Edition\": \"\",\n \"RoleArn\": \"\",\n \"ServerSideEncryptionConfiguration\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"Tags\": \"\",\n \"UserTokenConfigurations\": \"\",\n \"UserContextPolicy\": \"\",\n \"UserGroupResolutionConfiguration\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateIndex" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Name ""
:Edition ""
:RoleArn ""
:ServerSideEncryptionConfiguration ""
:Description ""
:ClientToken ""
:Tags ""
:UserTokenConfigurations ""
:UserContextPolicy ""
:UserGroupResolutionConfiguration ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateIndex"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Name\": \"\",\n \"Edition\": \"\",\n \"RoleArn\": \"\",\n \"ServerSideEncryptionConfiguration\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"Tags\": \"\",\n \"UserTokenConfigurations\": \"\",\n \"UserContextPolicy\": \"\",\n \"UserGroupResolutionConfiguration\": \"\"\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=AWSKendraFrontendService.CreateIndex"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Name\": \"\",\n \"Edition\": \"\",\n \"RoleArn\": \"\",\n \"ServerSideEncryptionConfiguration\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"Tags\": \"\",\n \"UserTokenConfigurations\": \"\",\n \"UserContextPolicy\": \"\",\n \"UserGroupResolutionConfiguration\": \"\"\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=AWSKendraFrontendService.CreateIndex");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Name\": \"\",\n \"Edition\": \"\",\n \"RoleArn\": \"\",\n \"ServerSideEncryptionConfiguration\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"Tags\": \"\",\n \"UserTokenConfigurations\": \"\",\n \"UserContextPolicy\": \"\",\n \"UserGroupResolutionConfiguration\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateIndex"
payload := strings.NewReader("{\n \"Name\": \"\",\n \"Edition\": \"\",\n \"RoleArn\": \"\",\n \"ServerSideEncryptionConfiguration\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"Tags\": \"\",\n \"UserTokenConfigurations\": \"\",\n \"UserContextPolicy\": \"\",\n \"UserGroupResolutionConfiguration\": \"\"\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: 251
{
"Name": "",
"Edition": "",
"RoleArn": "",
"ServerSideEncryptionConfiguration": "",
"Description": "",
"ClientToken": "",
"Tags": "",
"UserTokenConfigurations": "",
"UserContextPolicy": "",
"UserGroupResolutionConfiguration": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateIndex")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Name\": \"\",\n \"Edition\": \"\",\n \"RoleArn\": \"\",\n \"ServerSideEncryptionConfiguration\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"Tags\": \"\",\n \"UserTokenConfigurations\": \"\",\n \"UserContextPolicy\": \"\",\n \"UserGroupResolutionConfiguration\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateIndex"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Name\": \"\",\n \"Edition\": \"\",\n \"RoleArn\": \"\",\n \"ServerSideEncryptionConfiguration\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"Tags\": \"\",\n \"UserTokenConfigurations\": \"\",\n \"UserContextPolicy\": \"\",\n \"UserGroupResolutionConfiguration\": \"\"\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 \"Edition\": \"\",\n \"RoleArn\": \"\",\n \"ServerSideEncryptionConfiguration\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"Tags\": \"\",\n \"UserTokenConfigurations\": \"\",\n \"UserContextPolicy\": \"\",\n \"UserGroupResolutionConfiguration\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateIndex")
.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=AWSKendraFrontendService.CreateIndex")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Name\": \"\",\n \"Edition\": \"\",\n \"RoleArn\": \"\",\n \"ServerSideEncryptionConfiguration\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"Tags\": \"\",\n \"UserTokenConfigurations\": \"\",\n \"UserContextPolicy\": \"\",\n \"UserGroupResolutionConfiguration\": \"\"\n}")
.asString();
const data = JSON.stringify({
Name: '',
Edition: '',
RoleArn: '',
ServerSideEncryptionConfiguration: '',
Description: '',
ClientToken: '',
Tags: '',
UserTokenConfigurations: '',
UserContextPolicy: '',
UserGroupResolutionConfiguration: ''
});
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=AWSKendraFrontendService.CreateIndex');
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=AWSKendraFrontendService.CreateIndex',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Name: '',
Edition: '',
RoleArn: '',
ServerSideEncryptionConfiguration: '',
Description: '',
ClientToken: '',
Tags: '',
UserTokenConfigurations: '',
UserContextPolicy: '',
UserGroupResolutionConfiguration: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateIndex';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","Edition":"","RoleArn":"","ServerSideEncryptionConfiguration":"","Description":"","ClientToken":"","Tags":"","UserTokenConfigurations":"","UserContextPolicy":"","UserGroupResolutionConfiguration":""}'
};
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=AWSKendraFrontendService.CreateIndex',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Name": "",\n "Edition": "",\n "RoleArn": "",\n "ServerSideEncryptionConfiguration": "",\n "Description": "",\n "ClientToken": "",\n "Tags": "",\n "UserTokenConfigurations": "",\n "UserContextPolicy": "",\n "UserGroupResolutionConfiguration": ""\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 \"Edition\": \"\",\n \"RoleArn\": \"\",\n \"ServerSideEncryptionConfiguration\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"Tags\": \"\",\n \"UserTokenConfigurations\": \"\",\n \"UserContextPolicy\": \"\",\n \"UserGroupResolutionConfiguration\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateIndex")
.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: '',
Edition: '',
RoleArn: '',
ServerSideEncryptionConfiguration: '',
Description: '',
ClientToken: '',
Tags: '',
UserTokenConfigurations: '',
UserContextPolicy: '',
UserGroupResolutionConfiguration: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateIndex',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
Name: '',
Edition: '',
RoleArn: '',
ServerSideEncryptionConfiguration: '',
Description: '',
ClientToken: '',
Tags: '',
UserTokenConfigurations: '',
UserContextPolicy: '',
UserGroupResolutionConfiguration: ''
},
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=AWSKendraFrontendService.CreateIndex');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Name: '',
Edition: '',
RoleArn: '',
ServerSideEncryptionConfiguration: '',
Description: '',
ClientToken: '',
Tags: '',
UserTokenConfigurations: '',
UserContextPolicy: '',
UserGroupResolutionConfiguration: ''
});
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=AWSKendraFrontendService.CreateIndex',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Name: '',
Edition: '',
RoleArn: '',
ServerSideEncryptionConfiguration: '',
Description: '',
ClientToken: '',
Tags: '',
UserTokenConfigurations: '',
UserContextPolicy: '',
UserGroupResolutionConfiguration: ''
}
};
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=AWSKendraFrontendService.CreateIndex';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Name":"","Edition":"","RoleArn":"","ServerSideEncryptionConfiguration":"","Description":"","ClientToken":"","Tags":"","UserTokenConfigurations":"","UserContextPolicy":"","UserGroupResolutionConfiguration":""}'
};
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": @"",
@"Edition": @"",
@"RoleArn": @"",
@"ServerSideEncryptionConfiguration": @"",
@"Description": @"",
@"ClientToken": @"",
@"Tags": @"",
@"UserTokenConfigurations": @"",
@"UserContextPolicy": @"",
@"UserGroupResolutionConfiguration": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateIndex"]
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=AWSKendraFrontendService.CreateIndex" 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 \"Edition\": \"\",\n \"RoleArn\": \"\",\n \"ServerSideEncryptionConfiguration\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"Tags\": \"\",\n \"UserTokenConfigurations\": \"\",\n \"UserContextPolicy\": \"\",\n \"UserGroupResolutionConfiguration\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateIndex",
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' => '',
'Edition' => '',
'RoleArn' => '',
'ServerSideEncryptionConfiguration' => '',
'Description' => '',
'ClientToken' => '',
'Tags' => '',
'UserTokenConfigurations' => '',
'UserContextPolicy' => '',
'UserGroupResolutionConfiguration' => ''
]),
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=AWSKendraFrontendService.CreateIndex', [
'body' => '{
"Name": "",
"Edition": "",
"RoleArn": "",
"ServerSideEncryptionConfiguration": "",
"Description": "",
"ClientToken": "",
"Tags": "",
"UserTokenConfigurations": "",
"UserContextPolicy": "",
"UserGroupResolutionConfiguration": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateIndex');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Name' => '',
'Edition' => '',
'RoleArn' => '',
'ServerSideEncryptionConfiguration' => '',
'Description' => '',
'ClientToken' => '',
'Tags' => '',
'UserTokenConfigurations' => '',
'UserContextPolicy' => '',
'UserGroupResolutionConfiguration' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Name' => '',
'Edition' => '',
'RoleArn' => '',
'ServerSideEncryptionConfiguration' => '',
'Description' => '',
'ClientToken' => '',
'Tags' => '',
'UserTokenConfigurations' => '',
'UserContextPolicy' => '',
'UserGroupResolutionConfiguration' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateIndex');
$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=AWSKendraFrontendService.CreateIndex' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"Edition": "",
"RoleArn": "",
"ServerSideEncryptionConfiguration": "",
"Description": "",
"ClientToken": "",
"Tags": "",
"UserTokenConfigurations": "",
"UserContextPolicy": "",
"UserGroupResolutionConfiguration": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateIndex' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Name": "",
"Edition": "",
"RoleArn": "",
"ServerSideEncryptionConfiguration": "",
"Description": "",
"ClientToken": "",
"Tags": "",
"UserTokenConfigurations": "",
"UserContextPolicy": "",
"UserGroupResolutionConfiguration": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Name\": \"\",\n \"Edition\": \"\",\n \"RoleArn\": \"\",\n \"ServerSideEncryptionConfiguration\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"Tags\": \"\",\n \"UserTokenConfigurations\": \"\",\n \"UserContextPolicy\": \"\",\n \"UserGroupResolutionConfiguration\": \"\"\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=AWSKendraFrontendService.CreateIndex"
payload = {
"Name": "",
"Edition": "",
"RoleArn": "",
"ServerSideEncryptionConfiguration": "",
"Description": "",
"ClientToken": "",
"Tags": "",
"UserTokenConfigurations": "",
"UserContextPolicy": "",
"UserGroupResolutionConfiguration": ""
}
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=AWSKendraFrontendService.CreateIndex"
payload <- "{\n \"Name\": \"\",\n \"Edition\": \"\",\n \"RoleArn\": \"\",\n \"ServerSideEncryptionConfiguration\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"Tags\": \"\",\n \"UserTokenConfigurations\": \"\",\n \"UserContextPolicy\": \"\",\n \"UserGroupResolutionConfiguration\": \"\"\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=AWSKendraFrontendService.CreateIndex")
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 \"Edition\": \"\",\n \"RoleArn\": \"\",\n \"ServerSideEncryptionConfiguration\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"Tags\": \"\",\n \"UserTokenConfigurations\": \"\",\n \"UserContextPolicy\": \"\",\n \"UserGroupResolutionConfiguration\": \"\"\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 \"Edition\": \"\",\n \"RoleArn\": \"\",\n \"ServerSideEncryptionConfiguration\": \"\",\n \"Description\": \"\",\n \"ClientToken\": \"\",\n \"Tags\": \"\",\n \"UserTokenConfigurations\": \"\",\n \"UserContextPolicy\": \"\",\n \"UserGroupResolutionConfiguration\": \"\"\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=AWSKendraFrontendService.CreateIndex";
let payload = json!({
"Name": "",
"Edition": "",
"RoleArn": "",
"ServerSideEncryptionConfiguration": "",
"Description": "",
"ClientToken": "",
"Tags": "",
"UserTokenConfigurations": "",
"UserContextPolicy": "",
"UserGroupResolutionConfiguration": ""
});
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=AWSKendraFrontendService.CreateIndex' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Name": "",
"Edition": "",
"RoleArn": "",
"ServerSideEncryptionConfiguration": "",
"Description": "",
"ClientToken": "",
"Tags": "",
"UserTokenConfigurations": "",
"UserContextPolicy": "",
"UserGroupResolutionConfiguration": ""
}'
echo '{
"Name": "",
"Edition": "",
"RoleArn": "",
"ServerSideEncryptionConfiguration": "",
"Description": "",
"ClientToken": "",
"Tags": "",
"UserTokenConfigurations": "",
"UserContextPolicy": "",
"UserGroupResolutionConfiguration": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateIndex' \
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 "Edition": "",\n "RoleArn": "",\n "ServerSideEncryptionConfiguration": "",\n "Description": "",\n "ClientToken": "",\n "Tags": "",\n "UserTokenConfigurations": "",\n "UserContextPolicy": "",\n "UserGroupResolutionConfiguration": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateIndex'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Name": "",
"Edition": "",
"RoleArn": "",
"ServerSideEncryptionConfiguration": "",
"Description": "",
"ClientToken": "",
"Tags": "",
"UserTokenConfigurations": "",
"UserContextPolicy": "",
"UserGroupResolutionConfiguration": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateIndex")! 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
CreateQuerySuggestionsBlockList
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateQuerySuggestionsBlockList
HEADERS
X-Amz-Target
BODY json
{
"IndexId": "",
"Name": "",
"Description": "",
"SourceS3Path": "",
"ClientToken": "",
"RoleArn": "",
"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=AWSKendraFrontendService.CreateQuerySuggestionsBlockList");
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 \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"SourceS3Path\": \"\",\n \"ClientToken\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateQuerySuggestionsBlockList" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IndexId ""
:Name ""
:Description ""
:SourceS3Path ""
:ClientToken ""
:RoleArn ""
:Tags ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateQuerySuggestionsBlockList"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"SourceS3Path\": \"\",\n \"ClientToken\": \"\",\n \"RoleArn\": \"\",\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=AWSKendraFrontendService.CreateQuerySuggestionsBlockList"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"SourceS3Path\": \"\",\n \"ClientToken\": \"\",\n \"RoleArn\": \"\",\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=AWSKendraFrontendService.CreateQuerySuggestionsBlockList");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"SourceS3Path\": \"\",\n \"ClientToken\": \"\",\n \"RoleArn\": \"\",\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=AWSKendraFrontendService.CreateQuerySuggestionsBlockList"
payload := strings.NewReader("{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"SourceS3Path\": \"\",\n \"ClientToken\": \"\",\n \"RoleArn\": \"\",\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: 128
{
"IndexId": "",
"Name": "",
"Description": "",
"SourceS3Path": "",
"ClientToken": "",
"RoleArn": "",
"Tags": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateQuerySuggestionsBlockList")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"SourceS3Path\": \"\",\n \"ClientToken\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateQuerySuggestionsBlockList"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"SourceS3Path\": \"\",\n \"ClientToken\": \"\",\n \"RoleArn\": \"\",\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 \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"SourceS3Path\": \"\",\n \"ClientToken\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateQuerySuggestionsBlockList")
.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=AWSKendraFrontendService.CreateQuerySuggestionsBlockList")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"SourceS3Path\": \"\",\n \"ClientToken\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\"\n}")
.asString();
const data = JSON.stringify({
IndexId: '',
Name: '',
Description: '',
SourceS3Path: '',
ClientToken: '',
RoleArn: '',
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=AWSKendraFrontendService.CreateQuerySuggestionsBlockList');
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=AWSKendraFrontendService.CreateQuerySuggestionsBlockList',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
IndexId: '',
Name: '',
Description: '',
SourceS3Path: '',
ClientToken: '',
RoleArn: '',
Tags: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateQuerySuggestionsBlockList';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","Name":"","Description":"","SourceS3Path":"","ClientToken":"","RoleArn":"","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=AWSKendraFrontendService.CreateQuerySuggestionsBlockList',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IndexId": "",\n "Name": "",\n "Description": "",\n "SourceS3Path": "",\n "ClientToken": "",\n "RoleArn": "",\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 \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"SourceS3Path\": \"\",\n \"ClientToken\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateQuerySuggestionsBlockList")
.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({
IndexId: '',
Name: '',
Description: '',
SourceS3Path: '',
ClientToken: '',
RoleArn: '',
Tags: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateQuerySuggestionsBlockList',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
IndexId: '',
Name: '',
Description: '',
SourceS3Path: '',
ClientToken: '',
RoleArn: '',
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=AWSKendraFrontendService.CreateQuerySuggestionsBlockList');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IndexId: '',
Name: '',
Description: '',
SourceS3Path: '',
ClientToken: '',
RoleArn: '',
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=AWSKendraFrontendService.CreateQuerySuggestionsBlockList',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
IndexId: '',
Name: '',
Description: '',
SourceS3Path: '',
ClientToken: '',
RoleArn: '',
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=AWSKendraFrontendService.CreateQuerySuggestionsBlockList';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","Name":"","Description":"","SourceS3Path":"","ClientToken":"","RoleArn":"","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 = @{ @"IndexId": @"",
@"Name": @"",
@"Description": @"",
@"SourceS3Path": @"",
@"ClientToken": @"",
@"RoleArn": @"",
@"Tags": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateQuerySuggestionsBlockList"]
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=AWSKendraFrontendService.CreateQuerySuggestionsBlockList" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"SourceS3Path\": \"\",\n \"ClientToken\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateQuerySuggestionsBlockList",
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([
'IndexId' => '',
'Name' => '',
'Description' => '',
'SourceS3Path' => '',
'ClientToken' => '',
'RoleArn' => '',
'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=AWSKendraFrontendService.CreateQuerySuggestionsBlockList', [
'body' => '{
"IndexId": "",
"Name": "",
"Description": "",
"SourceS3Path": "",
"ClientToken": "",
"RoleArn": "",
"Tags": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateQuerySuggestionsBlockList');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IndexId' => '',
'Name' => '',
'Description' => '',
'SourceS3Path' => '',
'ClientToken' => '',
'RoleArn' => '',
'Tags' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IndexId' => '',
'Name' => '',
'Description' => '',
'SourceS3Path' => '',
'ClientToken' => '',
'RoleArn' => '',
'Tags' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateQuerySuggestionsBlockList');
$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=AWSKendraFrontendService.CreateQuerySuggestionsBlockList' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"Name": "",
"Description": "",
"SourceS3Path": "",
"ClientToken": "",
"RoleArn": "",
"Tags": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateQuerySuggestionsBlockList' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"Name": "",
"Description": "",
"SourceS3Path": "",
"ClientToken": "",
"RoleArn": "",
"Tags": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"SourceS3Path\": \"\",\n \"ClientToken\": \"\",\n \"RoleArn\": \"\",\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=AWSKendraFrontendService.CreateQuerySuggestionsBlockList"
payload = {
"IndexId": "",
"Name": "",
"Description": "",
"SourceS3Path": "",
"ClientToken": "",
"RoleArn": "",
"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=AWSKendraFrontendService.CreateQuerySuggestionsBlockList"
payload <- "{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"SourceS3Path\": \"\",\n \"ClientToken\": \"\",\n \"RoleArn\": \"\",\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=AWSKendraFrontendService.CreateQuerySuggestionsBlockList")
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 \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"SourceS3Path\": \"\",\n \"ClientToken\": \"\",\n \"RoleArn\": \"\",\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 \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"SourceS3Path\": \"\",\n \"ClientToken\": \"\",\n \"RoleArn\": \"\",\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=AWSKendraFrontendService.CreateQuerySuggestionsBlockList";
let payload = json!({
"IndexId": "",
"Name": "",
"Description": "",
"SourceS3Path": "",
"ClientToken": "",
"RoleArn": "",
"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=AWSKendraFrontendService.CreateQuerySuggestionsBlockList' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IndexId": "",
"Name": "",
"Description": "",
"SourceS3Path": "",
"ClientToken": "",
"RoleArn": "",
"Tags": ""
}'
echo '{
"IndexId": "",
"Name": "",
"Description": "",
"SourceS3Path": "",
"ClientToken": "",
"RoleArn": "",
"Tags": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateQuerySuggestionsBlockList' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IndexId": "",\n "Name": "",\n "Description": "",\n "SourceS3Path": "",\n "ClientToken": "",\n "RoleArn": "",\n "Tags": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateQuerySuggestionsBlockList'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"IndexId": "",
"Name": "",
"Description": "",
"SourceS3Path": "",
"ClientToken": "",
"RoleArn": "",
"Tags": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateQuerySuggestionsBlockList")! 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
CreateThesaurus
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateThesaurus
HEADERS
X-Amz-Target
BODY json
{
"IndexId": "",
"Name": "",
"Description": "",
"RoleArn": "",
"Tags": "",
"SourceS3Path": "",
"ClientToken": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateThesaurus");
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 \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"SourceS3Path\": \"\",\n \"ClientToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateThesaurus" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IndexId ""
:Name ""
:Description ""
:RoleArn ""
:Tags ""
:SourceS3Path ""
:ClientToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateThesaurus"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"SourceS3Path\": \"\",\n \"ClientToken\": \"\"\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=AWSKendraFrontendService.CreateThesaurus"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"SourceS3Path\": \"\",\n \"ClientToken\": \"\"\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=AWSKendraFrontendService.CreateThesaurus");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"SourceS3Path\": \"\",\n \"ClientToken\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateThesaurus"
payload := strings.NewReader("{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"SourceS3Path\": \"\",\n \"ClientToken\": \"\"\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: 128
{
"IndexId": "",
"Name": "",
"Description": "",
"RoleArn": "",
"Tags": "",
"SourceS3Path": "",
"ClientToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateThesaurus")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"SourceS3Path\": \"\",\n \"ClientToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateThesaurus"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"SourceS3Path\": \"\",\n \"ClientToken\": \"\"\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 \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"SourceS3Path\": \"\",\n \"ClientToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateThesaurus")
.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=AWSKendraFrontendService.CreateThesaurus")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"SourceS3Path\": \"\",\n \"ClientToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
IndexId: '',
Name: '',
Description: '',
RoleArn: '',
Tags: '',
SourceS3Path: '',
ClientToken: ''
});
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=AWSKendraFrontendService.CreateThesaurus');
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=AWSKendraFrontendService.CreateThesaurus',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
IndexId: '',
Name: '',
Description: '',
RoleArn: '',
Tags: '',
SourceS3Path: '',
ClientToken: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateThesaurus';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","Name":"","Description":"","RoleArn":"","Tags":"","SourceS3Path":"","ClientToken":""}'
};
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=AWSKendraFrontendService.CreateThesaurus',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IndexId": "",\n "Name": "",\n "Description": "",\n "RoleArn": "",\n "Tags": "",\n "SourceS3Path": "",\n "ClientToken": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"SourceS3Path\": \"\",\n \"ClientToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateThesaurus")
.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({
IndexId: '',
Name: '',
Description: '',
RoleArn: '',
Tags: '',
SourceS3Path: '',
ClientToken: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateThesaurus',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
IndexId: '',
Name: '',
Description: '',
RoleArn: '',
Tags: '',
SourceS3Path: '',
ClientToken: ''
},
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=AWSKendraFrontendService.CreateThesaurus');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IndexId: '',
Name: '',
Description: '',
RoleArn: '',
Tags: '',
SourceS3Path: '',
ClientToken: ''
});
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=AWSKendraFrontendService.CreateThesaurus',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
IndexId: '',
Name: '',
Description: '',
RoleArn: '',
Tags: '',
SourceS3Path: '',
ClientToken: ''
}
};
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=AWSKendraFrontendService.CreateThesaurus';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","Name":"","Description":"","RoleArn":"","Tags":"","SourceS3Path":"","ClientToken":""}'
};
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 = @{ @"IndexId": @"",
@"Name": @"",
@"Description": @"",
@"RoleArn": @"",
@"Tags": @"",
@"SourceS3Path": @"",
@"ClientToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateThesaurus"]
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=AWSKendraFrontendService.CreateThesaurus" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"SourceS3Path\": \"\",\n \"ClientToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateThesaurus",
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([
'IndexId' => '',
'Name' => '',
'Description' => '',
'RoleArn' => '',
'Tags' => '',
'SourceS3Path' => '',
'ClientToken' => ''
]),
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=AWSKendraFrontendService.CreateThesaurus', [
'body' => '{
"IndexId": "",
"Name": "",
"Description": "",
"RoleArn": "",
"Tags": "",
"SourceS3Path": "",
"ClientToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateThesaurus');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IndexId' => '',
'Name' => '',
'Description' => '',
'RoleArn' => '',
'Tags' => '',
'SourceS3Path' => '',
'ClientToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IndexId' => '',
'Name' => '',
'Description' => '',
'RoleArn' => '',
'Tags' => '',
'SourceS3Path' => '',
'ClientToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateThesaurus');
$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=AWSKendraFrontendService.CreateThesaurus' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"Name": "",
"Description": "",
"RoleArn": "",
"Tags": "",
"SourceS3Path": "",
"ClientToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateThesaurus' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"Name": "",
"Description": "",
"RoleArn": "",
"Tags": "",
"SourceS3Path": "",
"ClientToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"SourceS3Path\": \"\",\n \"ClientToken\": \"\"\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=AWSKendraFrontendService.CreateThesaurus"
payload = {
"IndexId": "",
"Name": "",
"Description": "",
"RoleArn": "",
"Tags": "",
"SourceS3Path": "",
"ClientToken": ""
}
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=AWSKendraFrontendService.CreateThesaurus"
payload <- "{\n \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"SourceS3Path\": \"\",\n \"ClientToken\": \"\"\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=AWSKendraFrontendService.CreateThesaurus")
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 \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"SourceS3Path\": \"\",\n \"ClientToken\": \"\"\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 \"IndexId\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"Tags\": \"\",\n \"SourceS3Path\": \"\",\n \"ClientToken\": \"\"\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=AWSKendraFrontendService.CreateThesaurus";
let payload = json!({
"IndexId": "",
"Name": "",
"Description": "",
"RoleArn": "",
"Tags": "",
"SourceS3Path": "",
"ClientToken": ""
});
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=AWSKendraFrontendService.CreateThesaurus' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IndexId": "",
"Name": "",
"Description": "",
"RoleArn": "",
"Tags": "",
"SourceS3Path": "",
"ClientToken": ""
}'
echo '{
"IndexId": "",
"Name": "",
"Description": "",
"RoleArn": "",
"Tags": "",
"SourceS3Path": "",
"ClientToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateThesaurus' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IndexId": "",\n "Name": "",\n "Description": "",\n "RoleArn": "",\n "Tags": "",\n "SourceS3Path": "",\n "ClientToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateThesaurus'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"IndexId": "",
"Name": "",
"Description": "",
"RoleArn": "",
"Tags": "",
"SourceS3Path": "",
"ClientToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.CreateThesaurus")! 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
DeleteAccessControlConfiguration
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteAccessControlConfiguration
HEADERS
X-Amz-Target
BODY json
{
"IndexId": "",
"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=AWSKendraFrontendService.DeleteAccessControlConfiguration");
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 \"IndexId\": \"\",\n \"Id\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteAccessControlConfiguration" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IndexId ""
:Id ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteAccessControlConfiguration"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.DeleteAccessControlConfiguration"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.DeleteAccessControlConfiguration");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.DeleteAccessControlConfiguration"
payload := strings.NewReader("{\n \"IndexId\": \"\",\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: 31
{
"IndexId": "",
"Id": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteAccessControlConfiguration")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IndexId\": \"\",\n \"Id\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteAccessControlConfiguration"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IndexId\": \"\",\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 \"IndexId\": \"\",\n \"Id\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteAccessControlConfiguration")
.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=AWSKendraFrontendService.DeleteAccessControlConfiguration")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IndexId\": \"\",\n \"Id\": \"\"\n}")
.asString();
const data = JSON.stringify({
IndexId: '',
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=AWSKendraFrontendService.DeleteAccessControlConfiguration');
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=AWSKendraFrontendService.DeleteAccessControlConfiguration',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', Id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteAccessControlConfiguration';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","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=AWSKendraFrontendService.DeleteAccessControlConfiguration',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IndexId": "",\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 \"IndexId\": \"\",\n \"Id\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteAccessControlConfiguration")
.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({IndexId: '', Id: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteAccessControlConfiguration',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {IndexId: '', 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=AWSKendraFrontendService.DeleteAccessControlConfiguration');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IndexId: '',
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=AWSKendraFrontendService.DeleteAccessControlConfiguration',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', 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=AWSKendraFrontendService.DeleteAccessControlConfiguration';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","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 = @{ @"IndexId": @"",
@"Id": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteAccessControlConfiguration"]
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=AWSKendraFrontendService.DeleteAccessControlConfiguration" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IndexId\": \"\",\n \"Id\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteAccessControlConfiguration",
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([
'IndexId' => '',
'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=AWSKendraFrontendService.DeleteAccessControlConfiguration', [
'body' => '{
"IndexId": "",
"Id": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteAccessControlConfiguration');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IndexId' => '',
'Id' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IndexId' => '',
'Id' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteAccessControlConfiguration');
$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=AWSKendraFrontendService.DeleteAccessControlConfiguration' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"Id": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteAccessControlConfiguration' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"Id": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.DeleteAccessControlConfiguration"
payload = {
"IndexId": "",
"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=AWSKendraFrontendService.DeleteAccessControlConfiguration"
payload <- "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.DeleteAccessControlConfiguration")
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 \"IndexId\": \"\",\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 \"IndexId\": \"\",\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=AWSKendraFrontendService.DeleteAccessControlConfiguration";
let payload = json!({
"IndexId": "",
"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=AWSKendraFrontendService.DeleteAccessControlConfiguration' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IndexId": "",
"Id": ""
}'
echo '{
"IndexId": "",
"Id": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteAccessControlConfiguration' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IndexId": "",\n "Id": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteAccessControlConfiguration'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"IndexId": "",
"Id": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteAccessControlConfiguration")! 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
DeleteDataSource
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteDataSource
HEADERS
X-Amz-Target
BODY json
{
"Id": "",
"IndexId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteDataSource");
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 \"Id\": \"\",\n \"IndexId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteDataSource" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Id ""
:IndexId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteDataSource"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DeleteDataSource"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DeleteDataSource");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteDataSource"
payload := strings.NewReader("{\n \"Id\": \"\",\n \"IndexId\": \"\"\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: 31
{
"Id": "",
"IndexId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteDataSource")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteDataSource"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Id\": \"\",\n \"IndexId\": \"\"\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 \"Id\": \"\",\n \"IndexId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteDataSource")
.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=AWSKendraFrontendService.DeleteDataSource")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}")
.asString();
const data = JSON.stringify({
Id: '',
IndexId: ''
});
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=AWSKendraFrontendService.DeleteDataSource');
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=AWSKendraFrontendService.DeleteDataSource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Id: '', IndexId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteDataSource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","IndexId":""}'
};
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=AWSKendraFrontendService.DeleteDataSource',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Id": "",\n "IndexId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteDataSource")
.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({Id: '', IndexId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteDataSource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Id: '', IndexId: ''},
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=AWSKendraFrontendService.DeleteDataSource');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Id: '',
IndexId: ''
});
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=AWSKendraFrontendService.DeleteDataSource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Id: '', IndexId: ''}
};
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=AWSKendraFrontendService.DeleteDataSource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","IndexId":""}'
};
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 = @{ @"Id": @"",
@"IndexId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteDataSource"]
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=AWSKendraFrontendService.DeleteDataSource" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteDataSource",
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([
'Id' => '',
'IndexId' => ''
]),
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=AWSKendraFrontendService.DeleteDataSource', [
'body' => '{
"Id": "",
"IndexId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteDataSource');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Id' => '',
'IndexId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Id' => '',
'IndexId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteDataSource');
$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=AWSKendraFrontendService.DeleteDataSource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"IndexId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteDataSource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"IndexId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DeleteDataSource"
payload = {
"Id": "",
"IndexId": ""
}
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=AWSKendraFrontendService.DeleteDataSource"
payload <- "{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DeleteDataSource")
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 \"Id\": \"\",\n \"IndexId\": \"\"\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 \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DeleteDataSource";
let payload = json!({
"Id": "",
"IndexId": ""
});
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=AWSKendraFrontendService.DeleteDataSource' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Id": "",
"IndexId": ""
}'
echo '{
"Id": "",
"IndexId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteDataSource' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Id": "",\n "IndexId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteDataSource'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Id": "",
"IndexId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteDataSource")! 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
DeleteExperience
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteExperience
HEADERS
X-Amz-Target
BODY json
{
"Id": "",
"IndexId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteExperience");
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 \"Id\": \"\",\n \"IndexId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteExperience" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Id ""
:IndexId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteExperience"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DeleteExperience"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DeleteExperience");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteExperience"
payload := strings.NewReader("{\n \"Id\": \"\",\n \"IndexId\": \"\"\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: 31
{
"Id": "",
"IndexId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteExperience")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteExperience"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Id\": \"\",\n \"IndexId\": \"\"\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 \"Id\": \"\",\n \"IndexId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteExperience")
.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=AWSKendraFrontendService.DeleteExperience")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}")
.asString();
const data = JSON.stringify({
Id: '',
IndexId: ''
});
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=AWSKendraFrontendService.DeleteExperience');
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=AWSKendraFrontendService.DeleteExperience',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Id: '', IndexId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteExperience';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","IndexId":""}'
};
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=AWSKendraFrontendService.DeleteExperience',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Id": "",\n "IndexId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteExperience")
.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({Id: '', IndexId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteExperience',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Id: '', IndexId: ''},
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=AWSKendraFrontendService.DeleteExperience');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Id: '',
IndexId: ''
});
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=AWSKendraFrontendService.DeleteExperience',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Id: '', IndexId: ''}
};
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=AWSKendraFrontendService.DeleteExperience';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","IndexId":""}'
};
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 = @{ @"Id": @"",
@"IndexId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteExperience"]
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=AWSKendraFrontendService.DeleteExperience" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteExperience",
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([
'Id' => '',
'IndexId' => ''
]),
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=AWSKendraFrontendService.DeleteExperience', [
'body' => '{
"Id": "",
"IndexId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteExperience');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Id' => '',
'IndexId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Id' => '',
'IndexId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteExperience');
$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=AWSKendraFrontendService.DeleteExperience' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"IndexId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteExperience' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"IndexId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DeleteExperience"
payload = {
"Id": "",
"IndexId": ""
}
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=AWSKendraFrontendService.DeleteExperience"
payload <- "{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DeleteExperience")
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 \"Id\": \"\",\n \"IndexId\": \"\"\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 \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DeleteExperience";
let payload = json!({
"Id": "",
"IndexId": ""
});
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=AWSKendraFrontendService.DeleteExperience' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Id": "",
"IndexId": ""
}'
echo '{
"Id": "",
"IndexId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteExperience' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Id": "",\n "IndexId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteExperience'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Id": "",
"IndexId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteExperience")! 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
DeleteFaq
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteFaq
HEADERS
X-Amz-Target
BODY json
{
"Id": "",
"IndexId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteFaq");
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 \"Id\": \"\",\n \"IndexId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteFaq" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Id ""
:IndexId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteFaq"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DeleteFaq"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DeleteFaq");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteFaq"
payload := strings.NewReader("{\n \"Id\": \"\",\n \"IndexId\": \"\"\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: 31
{
"Id": "",
"IndexId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteFaq")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteFaq"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Id\": \"\",\n \"IndexId\": \"\"\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 \"Id\": \"\",\n \"IndexId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteFaq")
.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=AWSKendraFrontendService.DeleteFaq")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}")
.asString();
const data = JSON.stringify({
Id: '',
IndexId: ''
});
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=AWSKendraFrontendService.DeleteFaq');
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=AWSKendraFrontendService.DeleteFaq',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Id: '', IndexId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteFaq';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","IndexId":""}'
};
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=AWSKendraFrontendService.DeleteFaq',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Id": "",\n "IndexId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteFaq")
.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({Id: '', IndexId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteFaq',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Id: '', IndexId: ''},
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=AWSKendraFrontendService.DeleteFaq');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Id: '',
IndexId: ''
});
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=AWSKendraFrontendService.DeleteFaq',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Id: '', IndexId: ''}
};
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=AWSKendraFrontendService.DeleteFaq';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","IndexId":""}'
};
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 = @{ @"Id": @"",
@"IndexId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteFaq"]
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=AWSKendraFrontendService.DeleteFaq" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteFaq",
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([
'Id' => '',
'IndexId' => ''
]),
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=AWSKendraFrontendService.DeleteFaq', [
'body' => '{
"Id": "",
"IndexId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteFaq');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Id' => '',
'IndexId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Id' => '',
'IndexId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteFaq');
$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=AWSKendraFrontendService.DeleteFaq' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"IndexId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteFaq' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"IndexId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DeleteFaq"
payload = {
"Id": "",
"IndexId": ""
}
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=AWSKendraFrontendService.DeleteFaq"
payload <- "{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DeleteFaq")
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 \"Id\": \"\",\n \"IndexId\": \"\"\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 \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DeleteFaq";
let payload = json!({
"Id": "",
"IndexId": ""
});
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=AWSKendraFrontendService.DeleteFaq' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Id": "",
"IndexId": ""
}'
echo '{
"Id": "",
"IndexId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteFaq' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Id": "",\n "IndexId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteFaq'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Id": "",
"IndexId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteFaq")! 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
DeleteIndex
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteIndex
HEADERS
X-Amz-Target
BODY json
{
"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=AWSKendraFrontendService.DeleteIndex");
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 \"Id\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteIndex" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Id ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteIndex"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\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=AWSKendraFrontendService.DeleteIndex"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\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=AWSKendraFrontendService.DeleteIndex");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\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=AWSKendraFrontendService.DeleteIndex"
payload := strings.NewReader("{\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: 14
{
"Id": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteIndex")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Id\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteIndex"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\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 \"Id\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteIndex")
.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=AWSKendraFrontendService.DeleteIndex")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Id\": \"\"\n}")
.asString();
const data = JSON.stringify({
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=AWSKendraFrontendService.DeleteIndex');
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=AWSKendraFrontendService.DeleteIndex',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteIndex';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"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=AWSKendraFrontendService.DeleteIndex',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\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 \"Id\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteIndex")
.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({Id: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteIndex',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {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=AWSKendraFrontendService.DeleteIndex');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
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=AWSKendraFrontendService.DeleteIndex',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {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=AWSKendraFrontendService.DeleteIndex';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"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 = @{ @"Id": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteIndex"]
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=AWSKendraFrontendService.DeleteIndex" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Id\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteIndex",
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([
'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=AWSKendraFrontendService.DeleteIndex', [
'body' => '{
"Id": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteIndex');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Id' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Id' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteIndex');
$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=AWSKendraFrontendService.DeleteIndex' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteIndex' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\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=AWSKendraFrontendService.DeleteIndex"
payload = { "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=AWSKendraFrontendService.DeleteIndex"
payload <- "{\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=AWSKendraFrontendService.DeleteIndex")
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 \"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 \"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=AWSKendraFrontendService.DeleteIndex";
let payload = json!({"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=AWSKendraFrontendService.DeleteIndex' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Id": ""
}'
echo '{
"Id": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteIndex' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Id": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteIndex'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["Id": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteIndex")! 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
DeletePrincipalMapping
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeletePrincipalMapping
HEADERS
X-Amz-Target
BODY json
{
"IndexId": "",
"DataSourceId": "",
"GroupId": "",
"OrderingId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeletePrincipalMapping");
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 \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"GroupId\": \"\",\n \"OrderingId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeletePrincipalMapping" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IndexId ""
:DataSourceId ""
:GroupId ""
:OrderingId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeletePrincipalMapping"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"GroupId\": \"\",\n \"OrderingId\": \"\"\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=AWSKendraFrontendService.DeletePrincipalMapping"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"GroupId\": \"\",\n \"OrderingId\": \"\"\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=AWSKendraFrontendService.DeletePrincipalMapping");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"GroupId\": \"\",\n \"OrderingId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeletePrincipalMapping"
payload := strings.NewReader("{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"GroupId\": \"\",\n \"OrderingId\": \"\"\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: 78
{
"IndexId": "",
"DataSourceId": "",
"GroupId": "",
"OrderingId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeletePrincipalMapping")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"GroupId\": \"\",\n \"OrderingId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeletePrincipalMapping"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"GroupId\": \"\",\n \"OrderingId\": \"\"\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 \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"GroupId\": \"\",\n \"OrderingId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeletePrincipalMapping")
.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=AWSKendraFrontendService.DeletePrincipalMapping")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"GroupId\": \"\",\n \"OrderingId\": \"\"\n}")
.asString();
const data = JSON.stringify({
IndexId: '',
DataSourceId: '',
GroupId: '',
OrderingId: ''
});
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=AWSKendraFrontendService.DeletePrincipalMapping');
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=AWSKendraFrontendService.DeletePrincipalMapping',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', DataSourceId: '', GroupId: '', OrderingId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeletePrincipalMapping';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","DataSourceId":"","GroupId":"","OrderingId":""}'
};
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=AWSKendraFrontendService.DeletePrincipalMapping',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IndexId": "",\n "DataSourceId": "",\n "GroupId": "",\n "OrderingId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"GroupId\": \"\",\n \"OrderingId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeletePrincipalMapping")
.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({IndexId: '', DataSourceId: '', GroupId: '', OrderingId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeletePrincipalMapping',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {IndexId: '', DataSourceId: '', GroupId: '', OrderingId: ''},
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=AWSKendraFrontendService.DeletePrincipalMapping');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IndexId: '',
DataSourceId: '',
GroupId: '',
OrderingId: ''
});
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=AWSKendraFrontendService.DeletePrincipalMapping',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', DataSourceId: '', GroupId: '', OrderingId: ''}
};
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=AWSKendraFrontendService.DeletePrincipalMapping';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","DataSourceId":"","GroupId":"","OrderingId":""}'
};
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 = @{ @"IndexId": @"",
@"DataSourceId": @"",
@"GroupId": @"",
@"OrderingId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeletePrincipalMapping"]
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=AWSKendraFrontendService.DeletePrincipalMapping" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"GroupId\": \"\",\n \"OrderingId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeletePrincipalMapping",
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([
'IndexId' => '',
'DataSourceId' => '',
'GroupId' => '',
'OrderingId' => ''
]),
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=AWSKendraFrontendService.DeletePrincipalMapping', [
'body' => '{
"IndexId": "",
"DataSourceId": "",
"GroupId": "",
"OrderingId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeletePrincipalMapping');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IndexId' => '',
'DataSourceId' => '',
'GroupId' => '',
'OrderingId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IndexId' => '',
'DataSourceId' => '',
'GroupId' => '',
'OrderingId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeletePrincipalMapping');
$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=AWSKendraFrontendService.DeletePrincipalMapping' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"DataSourceId": "",
"GroupId": "",
"OrderingId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeletePrincipalMapping' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"DataSourceId": "",
"GroupId": "",
"OrderingId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"GroupId\": \"\",\n \"OrderingId\": \"\"\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=AWSKendraFrontendService.DeletePrincipalMapping"
payload = {
"IndexId": "",
"DataSourceId": "",
"GroupId": "",
"OrderingId": ""
}
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=AWSKendraFrontendService.DeletePrincipalMapping"
payload <- "{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"GroupId\": \"\",\n \"OrderingId\": \"\"\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=AWSKendraFrontendService.DeletePrincipalMapping")
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 \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"GroupId\": \"\",\n \"OrderingId\": \"\"\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 \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"GroupId\": \"\",\n \"OrderingId\": \"\"\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=AWSKendraFrontendService.DeletePrincipalMapping";
let payload = json!({
"IndexId": "",
"DataSourceId": "",
"GroupId": "",
"OrderingId": ""
});
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=AWSKendraFrontendService.DeletePrincipalMapping' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IndexId": "",
"DataSourceId": "",
"GroupId": "",
"OrderingId": ""
}'
echo '{
"IndexId": "",
"DataSourceId": "",
"GroupId": "",
"OrderingId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeletePrincipalMapping' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IndexId": "",\n "DataSourceId": "",\n "GroupId": "",\n "OrderingId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeletePrincipalMapping'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"IndexId": "",
"DataSourceId": "",
"GroupId": "",
"OrderingId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeletePrincipalMapping")! 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
DeleteQuerySuggestionsBlockList
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteQuerySuggestionsBlockList
HEADERS
X-Amz-Target
BODY json
{
"IndexId": "",
"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=AWSKendraFrontendService.DeleteQuerySuggestionsBlockList");
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 \"IndexId\": \"\",\n \"Id\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteQuerySuggestionsBlockList" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IndexId ""
:Id ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteQuerySuggestionsBlockList"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.DeleteQuerySuggestionsBlockList"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.DeleteQuerySuggestionsBlockList");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.DeleteQuerySuggestionsBlockList"
payload := strings.NewReader("{\n \"IndexId\": \"\",\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: 31
{
"IndexId": "",
"Id": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteQuerySuggestionsBlockList")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IndexId\": \"\",\n \"Id\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteQuerySuggestionsBlockList"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IndexId\": \"\",\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 \"IndexId\": \"\",\n \"Id\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteQuerySuggestionsBlockList")
.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=AWSKendraFrontendService.DeleteQuerySuggestionsBlockList")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IndexId\": \"\",\n \"Id\": \"\"\n}")
.asString();
const data = JSON.stringify({
IndexId: '',
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=AWSKendraFrontendService.DeleteQuerySuggestionsBlockList');
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=AWSKendraFrontendService.DeleteQuerySuggestionsBlockList',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', Id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteQuerySuggestionsBlockList';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","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=AWSKendraFrontendService.DeleteQuerySuggestionsBlockList',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IndexId": "",\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 \"IndexId\": \"\",\n \"Id\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteQuerySuggestionsBlockList")
.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({IndexId: '', Id: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteQuerySuggestionsBlockList',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {IndexId: '', 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=AWSKendraFrontendService.DeleteQuerySuggestionsBlockList');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IndexId: '',
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=AWSKendraFrontendService.DeleteQuerySuggestionsBlockList',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', 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=AWSKendraFrontendService.DeleteQuerySuggestionsBlockList';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","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 = @{ @"IndexId": @"",
@"Id": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteQuerySuggestionsBlockList"]
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=AWSKendraFrontendService.DeleteQuerySuggestionsBlockList" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IndexId\": \"\",\n \"Id\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteQuerySuggestionsBlockList",
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([
'IndexId' => '',
'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=AWSKendraFrontendService.DeleteQuerySuggestionsBlockList', [
'body' => '{
"IndexId": "",
"Id": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteQuerySuggestionsBlockList');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IndexId' => '',
'Id' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IndexId' => '',
'Id' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteQuerySuggestionsBlockList');
$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=AWSKendraFrontendService.DeleteQuerySuggestionsBlockList' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"Id": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteQuerySuggestionsBlockList' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"Id": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.DeleteQuerySuggestionsBlockList"
payload = {
"IndexId": "",
"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=AWSKendraFrontendService.DeleteQuerySuggestionsBlockList"
payload <- "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.DeleteQuerySuggestionsBlockList")
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 \"IndexId\": \"\",\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 \"IndexId\": \"\",\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=AWSKendraFrontendService.DeleteQuerySuggestionsBlockList";
let payload = json!({
"IndexId": "",
"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=AWSKendraFrontendService.DeleteQuerySuggestionsBlockList' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IndexId": "",
"Id": ""
}'
echo '{
"IndexId": "",
"Id": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteQuerySuggestionsBlockList' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IndexId": "",\n "Id": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteQuerySuggestionsBlockList'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"IndexId": "",
"Id": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteQuerySuggestionsBlockList")! 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
DeleteThesaurus
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteThesaurus
HEADERS
X-Amz-Target
BODY json
{
"Id": "",
"IndexId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteThesaurus");
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 \"Id\": \"\",\n \"IndexId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteThesaurus" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Id ""
:IndexId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteThesaurus"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DeleteThesaurus"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DeleteThesaurus");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteThesaurus"
payload := strings.NewReader("{\n \"Id\": \"\",\n \"IndexId\": \"\"\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: 31
{
"Id": "",
"IndexId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteThesaurus")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteThesaurus"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Id\": \"\",\n \"IndexId\": \"\"\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 \"Id\": \"\",\n \"IndexId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteThesaurus")
.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=AWSKendraFrontendService.DeleteThesaurus")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}")
.asString();
const data = JSON.stringify({
Id: '',
IndexId: ''
});
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=AWSKendraFrontendService.DeleteThesaurus');
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=AWSKendraFrontendService.DeleteThesaurus',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Id: '', IndexId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteThesaurus';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","IndexId":""}'
};
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=AWSKendraFrontendService.DeleteThesaurus',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Id": "",\n "IndexId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteThesaurus")
.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({Id: '', IndexId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteThesaurus',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Id: '', IndexId: ''},
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=AWSKendraFrontendService.DeleteThesaurus');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Id: '',
IndexId: ''
});
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=AWSKendraFrontendService.DeleteThesaurus',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Id: '', IndexId: ''}
};
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=AWSKendraFrontendService.DeleteThesaurus';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","IndexId":""}'
};
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 = @{ @"Id": @"",
@"IndexId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteThesaurus"]
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=AWSKendraFrontendService.DeleteThesaurus" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteThesaurus",
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([
'Id' => '',
'IndexId' => ''
]),
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=AWSKendraFrontendService.DeleteThesaurus', [
'body' => '{
"Id": "",
"IndexId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteThesaurus');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Id' => '',
'IndexId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Id' => '',
'IndexId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteThesaurus');
$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=AWSKendraFrontendService.DeleteThesaurus' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"IndexId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteThesaurus' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"IndexId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DeleteThesaurus"
payload = {
"Id": "",
"IndexId": ""
}
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=AWSKendraFrontendService.DeleteThesaurus"
payload <- "{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DeleteThesaurus")
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 \"Id\": \"\",\n \"IndexId\": \"\"\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 \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DeleteThesaurus";
let payload = json!({
"Id": "",
"IndexId": ""
});
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=AWSKendraFrontendService.DeleteThesaurus' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Id": "",
"IndexId": ""
}'
echo '{
"Id": "",
"IndexId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteThesaurus' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Id": "",\n "IndexId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteThesaurus'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Id": "",
"IndexId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DeleteThesaurus")! 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
DescribeAccessControlConfiguration
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeAccessControlConfiguration
HEADERS
X-Amz-Target
BODY json
{
"IndexId": "",
"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=AWSKendraFrontendService.DescribeAccessControlConfiguration");
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 \"IndexId\": \"\",\n \"Id\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeAccessControlConfiguration" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IndexId ""
:Id ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeAccessControlConfiguration"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.DescribeAccessControlConfiguration"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.DescribeAccessControlConfiguration");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.DescribeAccessControlConfiguration"
payload := strings.NewReader("{\n \"IndexId\": \"\",\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: 31
{
"IndexId": "",
"Id": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeAccessControlConfiguration")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IndexId\": \"\",\n \"Id\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeAccessControlConfiguration"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IndexId\": \"\",\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 \"IndexId\": \"\",\n \"Id\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeAccessControlConfiguration")
.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=AWSKendraFrontendService.DescribeAccessControlConfiguration")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IndexId\": \"\",\n \"Id\": \"\"\n}")
.asString();
const data = JSON.stringify({
IndexId: '',
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=AWSKendraFrontendService.DescribeAccessControlConfiguration');
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=AWSKendraFrontendService.DescribeAccessControlConfiguration',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', Id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeAccessControlConfiguration';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","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=AWSKendraFrontendService.DescribeAccessControlConfiguration',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IndexId": "",\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 \"IndexId\": \"\",\n \"Id\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeAccessControlConfiguration")
.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({IndexId: '', Id: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeAccessControlConfiguration',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {IndexId: '', 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=AWSKendraFrontendService.DescribeAccessControlConfiguration');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IndexId: '',
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=AWSKendraFrontendService.DescribeAccessControlConfiguration',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', 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=AWSKendraFrontendService.DescribeAccessControlConfiguration';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","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 = @{ @"IndexId": @"",
@"Id": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeAccessControlConfiguration"]
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=AWSKendraFrontendService.DescribeAccessControlConfiguration" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IndexId\": \"\",\n \"Id\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeAccessControlConfiguration",
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([
'IndexId' => '',
'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=AWSKendraFrontendService.DescribeAccessControlConfiguration', [
'body' => '{
"IndexId": "",
"Id": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeAccessControlConfiguration');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IndexId' => '',
'Id' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IndexId' => '',
'Id' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeAccessControlConfiguration');
$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=AWSKendraFrontendService.DescribeAccessControlConfiguration' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"Id": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeAccessControlConfiguration' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"Id": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.DescribeAccessControlConfiguration"
payload = {
"IndexId": "",
"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=AWSKendraFrontendService.DescribeAccessControlConfiguration"
payload <- "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.DescribeAccessControlConfiguration")
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 \"IndexId\": \"\",\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 \"IndexId\": \"\",\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=AWSKendraFrontendService.DescribeAccessControlConfiguration";
let payload = json!({
"IndexId": "",
"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=AWSKendraFrontendService.DescribeAccessControlConfiguration' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IndexId": "",
"Id": ""
}'
echo '{
"IndexId": "",
"Id": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeAccessControlConfiguration' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IndexId": "",\n "Id": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeAccessControlConfiguration'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"IndexId": "",
"Id": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeAccessControlConfiguration")! 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
DescribeDataSource
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeDataSource
HEADERS
X-Amz-Target
BODY json
{
"Id": "",
"IndexId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeDataSource");
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 \"Id\": \"\",\n \"IndexId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeDataSource" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Id ""
:IndexId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeDataSource"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DescribeDataSource"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DescribeDataSource");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeDataSource"
payload := strings.NewReader("{\n \"Id\": \"\",\n \"IndexId\": \"\"\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: 31
{
"Id": "",
"IndexId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeDataSource")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeDataSource"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Id\": \"\",\n \"IndexId\": \"\"\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 \"Id\": \"\",\n \"IndexId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeDataSource")
.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=AWSKendraFrontendService.DescribeDataSource")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}")
.asString();
const data = JSON.stringify({
Id: '',
IndexId: ''
});
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=AWSKendraFrontendService.DescribeDataSource');
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=AWSKendraFrontendService.DescribeDataSource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Id: '', IndexId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeDataSource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","IndexId":""}'
};
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=AWSKendraFrontendService.DescribeDataSource',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Id": "",\n "IndexId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeDataSource")
.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({Id: '', IndexId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeDataSource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Id: '', IndexId: ''},
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=AWSKendraFrontendService.DescribeDataSource');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Id: '',
IndexId: ''
});
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=AWSKendraFrontendService.DescribeDataSource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Id: '', IndexId: ''}
};
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=AWSKendraFrontendService.DescribeDataSource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","IndexId":""}'
};
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 = @{ @"Id": @"",
@"IndexId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeDataSource"]
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=AWSKendraFrontendService.DescribeDataSource" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeDataSource",
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([
'Id' => '',
'IndexId' => ''
]),
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=AWSKendraFrontendService.DescribeDataSource', [
'body' => '{
"Id": "",
"IndexId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeDataSource');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Id' => '',
'IndexId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Id' => '',
'IndexId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeDataSource');
$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=AWSKendraFrontendService.DescribeDataSource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"IndexId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeDataSource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"IndexId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DescribeDataSource"
payload = {
"Id": "",
"IndexId": ""
}
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=AWSKendraFrontendService.DescribeDataSource"
payload <- "{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DescribeDataSource")
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 \"Id\": \"\",\n \"IndexId\": \"\"\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 \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DescribeDataSource";
let payload = json!({
"Id": "",
"IndexId": ""
});
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=AWSKendraFrontendService.DescribeDataSource' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Id": "",
"IndexId": ""
}'
echo '{
"Id": "",
"IndexId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeDataSource' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Id": "",\n "IndexId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeDataSource'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Id": "",
"IndexId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeDataSource")! 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
DescribeExperience
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeExperience
HEADERS
X-Amz-Target
BODY json
{
"Id": "",
"IndexId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeExperience");
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 \"Id\": \"\",\n \"IndexId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeExperience" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Id ""
:IndexId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeExperience"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DescribeExperience"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DescribeExperience");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeExperience"
payload := strings.NewReader("{\n \"Id\": \"\",\n \"IndexId\": \"\"\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: 31
{
"Id": "",
"IndexId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeExperience")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeExperience"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Id\": \"\",\n \"IndexId\": \"\"\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 \"Id\": \"\",\n \"IndexId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeExperience")
.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=AWSKendraFrontendService.DescribeExperience")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}")
.asString();
const data = JSON.stringify({
Id: '',
IndexId: ''
});
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=AWSKendraFrontendService.DescribeExperience');
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=AWSKendraFrontendService.DescribeExperience',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Id: '', IndexId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeExperience';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","IndexId":""}'
};
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=AWSKendraFrontendService.DescribeExperience',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Id": "",\n "IndexId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeExperience")
.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({Id: '', IndexId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeExperience',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Id: '', IndexId: ''},
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=AWSKendraFrontendService.DescribeExperience');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Id: '',
IndexId: ''
});
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=AWSKendraFrontendService.DescribeExperience',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Id: '', IndexId: ''}
};
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=AWSKendraFrontendService.DescribeExperience';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","IndexId":""}'
};
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 = @{ @"Id": @"",
@"IndexId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeExperience"]
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=AWSKendraFrontendService.DescribeExperience" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeExperience",
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([
'Id' => '',
'IndexId' => ''
]),
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=AWSKendraFrontendService.DescribeExperience', [
'body' => '{
"Id": "",
"IndexId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeExperience');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Id' => '',
'IndexId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Id' => '',
'IndexId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeExperience');
$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=AWSKendraFrontendService.DescribeExperience' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"IndexId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeExperience' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"IndexId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DescribeExperience"
payload = {
"Id": "",
"IndexId": ""
}
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=AWSKendraFrontendService.DescribeExperience"
payload <- "{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DescribeExperience")
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 \"Id\": \"\",\n \"IndexId\": \"\"\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 \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DescribeExperience";
let payload = json!({
"Id": "",
"IndexId": ""
});
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=AWSKendraFrontendService.DescribeExperience' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Id": "",
"IndexId": ""
}'
echo '{
"Id": "",
"IndexId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeExperience' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Id": "",\n "IndexId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeExperience'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Id": "",
"IndexId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeExperience")! 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
DescribeFaq
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeFaq
HEADERS
X-Amz-Target
BODY json
{
"Id": "",
"IndexId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeFaq");
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 \"Id\": \"\",\n \"IndexId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeFaq" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Id ""
:IndexId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeFaq"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DescribeFaq"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DescribeFaq");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeFaq"
payload := strings.NewReader("{\n \"Id\": \"\",\n \"IndexId\": \"\"\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: 31
{
"Id": "",
"IndexId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeFaq")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeFaq"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Id\": \"\",\n \"IndexId\": \"\"\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 \"Id\": \"\",\n \"IndexId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeFaq")
.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=AWSKendraFrontendService.DescribeFaq")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}")
.asString();
const data = JSON.stringify({
Id: '',
IndexId: ''
});
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=AWSKendraFrontendService.DescribeFaq');
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=AWSKendraFrontendService.DescribeFaq',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Id: '', IndexId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeFaq';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","IndexId":""}'
};
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=AWSKendraFrontendService.DescribeFaq',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Id": "",\n "IndexId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeFaq")
.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({Id: '', IndexId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeFaq',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Id: '', IndexId: ''},
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=AWSKendraFrontendService.DescribeFaq');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Id: '',
IndexId: ''
});
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=AWSKendraFrontendService.DescribeFaq',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Id: '', IndexId: ''}
};
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=AWSKendraFrontendService.DescribeFaq';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","IndexId":""}'
};
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 = @{ @"Id": @"",
@"IndexId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeFaq"]
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=AWSKendraFrontendService.DescribeFaq" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeFaq",
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([
'Id' => '',
'IndexId' => ''
]),
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=AWSKendraFrontendService.DescribeFaq', [
'body' => '{
"Id": "",
"IndexId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeFaq');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Id' => '',
'IndexId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Id' => '',
'IndexId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeFaq');
$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=AWSKendraFrontendService.DescribeFaq' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"IndexId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeFaq' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"IndexId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DescribeFaq"
payload = {
"Id": "",
"IndexId": ""
}
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=AWSKendraFrontendService.DescribeFaq"
payload <- "{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DescribeFaq")
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 \"Id\": \"\",\n \"IndexId\": \"\"\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 \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DescribeFaq";
let payload = json!({
"Id": "",
"IndexId": ""
});
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=AWSKendraFrontendService.DescribeFaq' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Id": "",
"IndexId": ""
}'
echo '{
"Id": "",
"IndexId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeFaq' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Id": "",\n "IndexId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeFaq'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Id": "",
"IndexId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeFaq")! 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
DescribeFeaturedResultsSet
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeFeaturedResultsSet
HEADERS
X-Amz-Target
BODY json
{
"IndexId": "",
"FeaturedResultsSetId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeFeaturedResultsSet");
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 \"IndexId\": \"\",\n \"FeaturedResultsSetId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeFeaturedResultsSet" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IndexId ""
:FeaturedResultsSetId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeFeaturedResultsSet"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IndexId\": \"\",\n \"FeaturedResultsSetId\": \"\"\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=AWSKendraFrontendService.DescribeFeaturedResultsSet"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IndexId\": \"\",\n \"FeaturedResultsSetId\": \"\"\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=AWSKendraFrontendService.DescribeFeaturedResultsSet");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IndexId\": \"\",\n \"FeaturedResultsSetId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeFeaturedResultsSet"
payload := strings.NewReader("{\n \"IndexId\": \"\",\n \"FeaturedResultsSetId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 49
{
"IndexId": "",
"FeaturedResultsSetId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeFeaturedResultsSet")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IndexId\": \"\",\n \"FeaturedResultsSetId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeFeaturedResultsSet"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IndexId\": \"\",\n \"FeaturedResultsSetId\": \"\"\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 \"IndexId\": \"\",\n \"FeaturedResultsSetId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeFeaturedResultsSet")
.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=AWSKendraFrontendService.DescribeFeaturedResultsSet")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IndexId\": \"\",\n \"FeaturedResultsSetId\": \"\"\n}")
.asString();
const data = JSON.stringify({
IndexId: '',
FeaturedResultsSetId: ''
});
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=AWSKendraFrontendService.DescribeFeaturedResultsSet');
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=AWSKendraFrontendService.DescribeFeaturedResultsSet',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', FeaturedResultsSetId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeFeaturedResultsSet';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","FeaturedResultsSetId":""}'
};
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=AWSKendraFrontendService.DescribeFeaturedResultsSet',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IndexId": "",\n "FeaturedResultsSetId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"IndexId\": \"\",\n \"FeaturedResultsSetId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeFeaturedResultsSet")
.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({IndexId: '', FeaturedResultsSetId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeFeaturedResultsSet',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {IndexId: '', FeaturedResultsSetId: ''},
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=AWSKendraFrontendService.DescribeFeaturedResultsSet');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IndexId: '',
FeaturedResultsSetId: ''
});
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=AWSKendraFrontendService.DescribeFeaturedResultsSet',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', FeaturedResultsSetId: ''}
};
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=AWSKendraFrontendService.DescribeFeaturedResultsSet';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","FeaturedResultsSetId":""}'
};
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 = @{ @"IndexId": @"",
@"FeaturedResultsSetId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeFeaturedResultsSet"]
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=AWSKendraFrontendService.DescribeFeaturedResultsSet" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IndexId\": \"\",\n \"FeaturedResultsSetId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeFeaturedResultsSet",
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([
'IndexId' => '',
'FeaturedResultsSetId' => ''
]),
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=AWSKendraFrontendService.DescribeFeaturedResultsSet', [
'body' => '{
"IndexId": "",
"FeaturedResultsSetId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeFeaturedResultsSet');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IndexId' => '',
'FeaturedResultsSetId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IndexId' => '',
'FeaturedResultsSetId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeFeaturedResultsSet');
$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=AWSKendraFrontendService.DescribeFeaturedResultsSet' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"FeaturedResultsSetId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeFeaturedResultsSet' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"FeaturedResultsSetId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IndexId\": \"\",\n \"FeaturedResultsSetId\": \"\"\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=AWSKendraFrontendService.DescribeFeaturedResultsSet"
payload = {
"IndexId": "",
"FeaturedResultsSetId": ""
}
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=AWSKendraFrontendService.DescribeFeaturedResultsSet"
payload <- "{\n \"IndexId\": \"\",\n \"FeaturedResultsSetId\": \"\"\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=AWSKendraFrontendService.DescribeFeaturedResultsSet")
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 \"IndexId\": \"\",\n \"FeaturedResultsSetId\": \"\"\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 \"IndexId\": \"\",\n \"FeaturedResultsSetId\": \"\"\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=AWSKendraFrontendService.DescribeFeaturedResultsSet";
let payload = json!({
"IndexId": "",
"FeaturedResultsSetId": ""
});
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=AWSKendraFrontendService.DescribeFeaturedResultsSet' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IndexId": "",
"FeaturedResultsSetId": ""
}'
echo '{
"IndexId": "",
"FeaturedResultsSetId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeFeaturedResultsSet' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IndexId": "",\n "FeaturedResultsSetId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeFeaturedResultsSet'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"IndexId": "",
"FeaturedResultsSetId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeFeaturedResultsSet")! 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
DescribeIndex
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeIndex
HEADERS
X-Amz-Target
BODY json
{
"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=AWSKendraFrontendService.DescribeIndex");
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 \"Id\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeIndex" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Id ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeIndex"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\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=AWSKendraFrontendService.DescribeIndex"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\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=AWSKendraFrontendService.DescribeIndex");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\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=AWSKendraFrontendService.DescribeIndex"
payload := strings.NewReader("{\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: 14
{
"Id": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeIndex")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Id\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeIndex"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\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 \"Id\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeIndex")
.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=AWSKendraFrontendService.DescribeIndex")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Id\": \"\"\n}")
.asString();
const data = JSON.stringify({
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=AWSKendraFrontendService.DescribeIndex');
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=AWSKendraFrontendService.DescribeIndex',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeIndex';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"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=AWSKendraFrontendService.DescribeIndex',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\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 \"Id\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeIndex")
.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({Id: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeIndex',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {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=AWSKendraFrontendService.DescribeIndex');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
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=AWSKendraFrontendService.DescribeIndex',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {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=AWSKendraFrontendService.DescribeIndex';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"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 = @{ @"Id": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeIndex"]
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=AWSKendraFrontendService.DescribeIndex" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Id\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeIndex",
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([
'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=AWSKendraFrontendService.DescribeIndex', [
'body' => '{
"Id": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeIndex');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Id' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Id' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeIndex');
$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=AWSKendraFrontendService.DescribeIndex' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeIndex' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\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=AWSKendraFrontendService.DescribeIndex"
payload = { "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=AWSKendraFrontendService.DescribeIndex"
payload <- "{\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=AWSKendraFrontendService.DescribeIndex")
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 \"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 \"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=AWSKendraFrontendService.DescribeIndex";
let payload = json!({"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=AWSKendraFrontendService.DescribeIndex' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Id": ""
}'
echo '{
"Id": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeIndex' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Id": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeIndex'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["Id": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeIndex")! 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
DescribePrincipalMapping
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribePrincipalMapping
HEADERS
X-Amz-Target
BODY json
{
"IndexId": "",
"DataSourceId": "",
"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=AWSKendraFrontendService.DescribePrincipalMapping");
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 \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"GroupId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribePrincipalMapping" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IndexId ""
:DataSourceId ""
:GroupId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribePrincipalMapping"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\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=AWSKendraFrontendService.DescribePrincipalMapping"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\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=AWSKendraFrontendService.DescribePrincipalMapping");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\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=AWSKendraFrontendService.DescribePrincipalMapping"
payload := strings.NewReader("{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\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: 58
{
"IndexId": "",
"DataSourceId": "",
"GroupId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribePrincipalMapping")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"GroupId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribePrincipalMapping"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\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 \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"GroupId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribePrincipalMapping")
.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=AWSKendraFrontendService.DescribePrincipalMapping")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"GroupId\": \"\"\n}")
.asString();
const data = JSON.stringify({
IndexId: '',
DataSourceId: '',
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=AWSKendraFrontendService.DescribePrincipalMapping');
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=AWSKendraFrontendService.DescribePrincipalMapping',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', DataSourceId: '', GroupId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribePrincipalMapping';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","DataSourceId":"","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=AWSKendraFrontendService.DescribePrincipalMapping',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IndexId": "",\n "DataSourceId": "",\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 \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"GroupId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribePrincipalMapping")
.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({IndexId: '', DataSourceId: '', GroupId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribePrincipalMapping',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {IndexId: '', DataSourceId: '', 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=AWSKendraFrontendService.DescribePrincipalMapping');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IndexId: '',
DataSourceId: '',
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=AWSKendraFrontendService.DescribePrincipalMapping',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', DataSourceId: '', 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=AWSKendraFrontendService.DescribePrincipalMapping';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","DataSourceId":"","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 = @{ @"IndexId": @"",
@"DataSourceId": @"",
@"GroupId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribePrincipalMapping"]
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=AWSKendraFrontendService.DescribePrincipalMapping" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"GroupId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribePrincipalMapping",
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([
'IndexId' => '',
'DataSourceId' => '',
'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=AWSKendraFrontendService.DescribePrincipalMapping', [
'body' => '{
"IndexId": "",
"DataSourceId": "",
"GroupId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribePrincipalMapping');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IndexId' => '',
'DataSourceId' => '',
'GroupId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IndexId' => '',
'DataSourceId' => '',
'GroupId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribePrincipalMapping');
$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=AWSKendraFrontendService.DescribePrincipalMapping' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"DataSourceId": "",
"GroupId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribePrincipalMapping' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"DataSourceId": "",
"GroupId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\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=AWSKendraFrontendService.DescribePrincipalMapping"
payload = {
"IndexId": "",
"DataSourceId": "",
"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=AWSKendraFrontendService.DescribePrincipalMapping"
payload <- "{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\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=AWSKendraFrontendService.DescribePrincipalMapping")
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 \"IndexId\": \"\",\n \"DataSourceId\": \"\",\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 \"IndexId\": \"\",\n \"DataSourceId\": \"\",\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=AWSKendraFrontendService.DescribePrincipalMapping";
let payload = json!({
"IndexId": "",
"DataSourceId": "",
"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=AWSKendraFrontendService.DescribePrincipalMapping' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IndexId": "",
"DataSourceId": "",
"GroupId": ""
}'
echo '{
"IndexId": "",
"DataSourceId": "",
"GroupId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribePrincipalMapping' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IndexId": "",\n "DataSourceId": "",\n "GroupId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribePrincipalMapping'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"IndexId": "",
"DataSourceId": "",
"GroupId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribePrincipalMapping")! 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
DescribeQuerySuggestionsBlockList
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeQuerySuggestionsBlockList
HEADERS
X-Amz-Target
BODY json
{
"IndexId": "",
"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=AWSKendraFrontendService.DescribeQuerySuggestionsBlockList");
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 \"IndexId\": \"\",\n \"Id\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeQuerySuggestionsBlockList" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IndexId ""
:Id ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeQuerySuggestionsBlockList"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.DescribeQuerySuggestionsBlockList"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.DescribeQuerySuggestionsBlockList");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.DescribeQuerySuggestionsBlockList"
payload := strings.NewReader("{\n \"IndexId\": \"\",\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: 31
{
"IndexId": "",
"Id": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeQuerySuggestionsBlockList")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IndexId\": \"\",\n \"Id\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeQuerySuggestionsBlockList"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IndexId\": \"\",\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 \"IndexId\": \"\",\n \"Id\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeQuerySuggestionsBlockList")
.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=AWSKendraFrontendService.DescribeQuerySuggestionsBlockList")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IndexId\": \"\",\n \"Id\": \"\"\n}")
.asString();
const data = JSON.stringify({
IndexId: '',
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=AWSKendraFrontendService.DescribeQuerySuggestionsBlockList');
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=AWSKendraFrontendService.DescribeQuerySuggestionsBlockList',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', Id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeQuerySuggestionsBlockList';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","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=AWSKendraFrontendService.DescribeQuerySuggestionsBlockList',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IndexId": "",\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 \"IndexId\": \"\",\n \"Id\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeQuerySuggestionsBlockList")
.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({IndexId: '', Id: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeQuerySuggestionsBlockList',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {IndexId: '', 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=AWSKendraFrontendService.DescribeQuerySuggestionsBlockList');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IndexId: '',
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=AWSKendraFrontendService.DescribeQuerySuggestionsBlockList',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', 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=AWSKendraFrontendService.DescribeQuerySuggestionsBlockList';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","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 = @{ @"IndexId": @"",
@"Id": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeQuerySuggestionsBlockList"]
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=AWSKendraFrontendService.DescribeQuerySuggestionsBlockList" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IndexId\": \"\",\n \"Id\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeQuerySuggestionsBlockList",
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([
'IndexId' => '',
'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=AWSKendraFrontendService.DescribeQuerySuggestionsBlockList', [
'body' => '{
"IndexId": "",
"Id": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeQuerySuggestionsBlockList');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IndexId' => '',
'Id' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IndexId' => '',
'Id' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeQuerySuggestionsBlockList');
$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=AWSKendraFrontendService.DescribeQuerySuggestionsBlockList' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"Id": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeQuerySuggestionsBlockList' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"Id": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.DescribeQuerySuggestionsBlockList"
payload = {
"IndexId": "",
"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=AWSKendraFrontendService.DescribeQuerySuggestionsBlockList"
payload <- "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.DescribeQuerySuggestionsBlockList")
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 \"IndexId\": \"\",\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 \"IndexId\": \"\",\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=AWSKendraFrontendService.DescribeQuerySuggestionsBlockList";
let payload = json!({
"IndexId": "",
"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=AWSKendraFrontendService.DescribeQuerySuggestionsBlockList' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IndexId": "",
"Id": ""
}'
echo '{
"IndexId": "",
"Id": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeQuerySuggestionsBlockList' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IndexId": "",\n "Id": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeQuerySuggestionsBlockList'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"IndexId": "",
"Id": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeQuerySuggestionsBlockList")! 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
DescribeQuerySuggestionsConfig
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeQuerySuggestionsConfig
HEADERS
X-Amz-Target
BODY json
{
"IndexId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeQuerySuggestionsConfig");
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 \"IndexId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeQuerySuggestionsConfig" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IndexId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeQuerySuggestionsConfig"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DescribeQuerySuggestionsConfig"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DescribeQuerySuggestionsConfig");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IndexId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeQuerySuggestionsConfig"
payload := strings.NewReader("{\n \"IndexId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 19
{
"IndexId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeQuerySuggestionsConfig")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IndexId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeQuerySuggestionsConfig"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IndexId\": \"\"\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 \"IndexId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeQuerySuggestionsConfig")
.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=AWSKendraFrontendService.DescribeQuerySuggestionsConfig")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IndexId\": \"\"\n}")
.asString();
const data = JSON.stringify({
IndexId: ''
});
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=AWSKendraFrontendService.DescribeQuerySuggestionsConfig');
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=AWSKendraFrontendService.DescribeQuerySuggestionsConfig',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeQuerySuggestionsConfig';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":""}'
};
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=AWSKendraFrontendService.DescribeQuerySuggestionsConfig',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IndexId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"IndexId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeQuerySuggestionsConfig")
.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({IndexId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeQuerySuggestionsConfig',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {IndexId: ''},
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=AWSKendraFrontendService.DescribeQuerySuggestionsConfig');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IndexId: ''
});
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=AWSKendraFrontendService.DescribeQuerySuggestionsConfig',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: ''}
};
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=AWSKendraFrontendService.DescribeQuerySuggestionsConfig';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":""}'
};
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 = @{ @"IndexId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeQuerySuggestionsConfig"]
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=AWSKendraFrontendService.DescribeQuerySuggestionsConfig" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IndexId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeQuerySuggestionsConfig",
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([
'IndexId' => ''
]),
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=AWSKendraFrontendService.DescribeQuerySuggestionsConfig', [
'body' => '{
"IndexId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeQuerySuggestionsConfig');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IndexId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IndexId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeQuerySuggestionsConfig');
$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=AWSKendraFrontendService.DescribeQuerySuggestionsConfig' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeQuerySuggestionsConfig' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DescribeQuerySuggestionsConfig"
payload = { "IndexId": "" }
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=AWSKendraFrontendService.DescribeQuerySuggestionsConfig"
payload <- "{\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DescribeQuerySuggestionsConfig")
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 \"IndexId\": \"\"\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 \"IndexId\": \"\"\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=AWSKendraFrontendService.DescribeQuerySuggestionsConfig";
let payload = json!({"IndexId": ""});
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=AWSKendraFrontendService.DescribeQuerySuggestionsConfig' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IndexId": ""
}'
echo '{
"IndexId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeQuerySuggestionsConfig' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IndexId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeQuerySuggestionsConfig'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["IndexId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeQuerySuggestionsConfig")! 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
DescribeThesaurus
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeThesaurus
HEADERS
X-Amz-Target
BODY json
{
"Id": "",
"IndexId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeThesaurus");
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 \"Id\": \"\",\n \"IndexId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeThesaurus" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Id ""
:IndexId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeThesaurus"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DescribeThesaurus"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DescribeThesaurus");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeThesaurus"
payload := strings.NewReader("{\n \"Id\": \"\",\n \"IndexId\": \"\"\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: 31
{
"Id": "",
"IndexId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeThesaurus")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeThesaurus"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Id\": \"\",\n \"IndexId\": \"\"\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 \"Id\": \"\",\n \"IndexId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeThesaurus")
.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=AWSKendraFrontendService.DescribeThesaurus")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}")
.asString();
const data = JSON.stringify({
Id: '',
IndexId: ''
});
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=AWSKendraFrontendService.DescribeThesaurus');
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=AWSKendraFrontendService.DescribeThesaurus',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Id: '', IndexId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeThesaurus';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","IndexId":""}'
};
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=AWSKendraFrontendService.DescribeThesaurus',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Id": "",\n "IndexId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeThesaurus")
.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({Id: '', IndexId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeThesaurus',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Id: '', IndexId: ''},
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=AWSKendraFrontendService.DescribeThesaurus');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Id: '',
IndexId: ''
});
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=AWSKendraFrontendService.DescribeThesaurus',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Id: '', IndexId: ''}
};
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=AWSKendraFrontendService.DescribeThesaurus';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","IndexId":""}'
};
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 = @{ @"Id": @"",
@"IndexId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeThesaurus"]
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=AWSKendraFrontendService.DescribeThesaurus" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeThesaurus",
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([
'Id' => '',
'IndexId' => ''
]),
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=AWSKendraFrontendService.DescribeThesaurus', [
'body' => '{
"Id": "",
"IndexId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeThesaurus');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Id' => '',
'IndexId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Id' => '',
'IndexId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeThesaurus');
$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=AWSKendraFrontendService.DescribeThesaurus' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"IndexId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeThesaurus' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"IndexId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DescribeThesaurus"
payload = {
"Id": "",
"IndexId": ""
}
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=AWSKendraFrontendService.DescribeThesaurus"
payload <- "{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DescribeThesaurus")
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 \"Id\": \"\",\n \"IndexId\": \"\"\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 \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.DescribeThesaurus";
let payload = json!({
"Id": "",
"IndexId": ""
});
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=AWSKendraFrontendService.DescribeThesaurus' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Id": "",
"IndexId": ""
}'
echo '{
"Id": "",
"IndexId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeThesaurus' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Id": "",\n "IndexId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeThesaurus'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Id": "",
"IndexId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DescribeThesaurus")! 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
DisassociateEntitiesFromExperience
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DisassociateEntitiesFromExperience
HEADERS
X-Amz-Target
BODY json
{
"Id": "",
"IndexId": "",
"EntityList": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DisassociateEntitiesFromExperience");
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 \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityList\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DisassociateEntitiesFromExperience" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Id ""
:IndexId ""
:EntityList ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DisassociateEntitiesFromExperience"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityList\": \"\"\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=AWSKendraFrontendService.DisassociateEntitiesFromExperience"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityList\": \"\"\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=AWSKendraFrontendService.DisassociateEntitiesFromExperience");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityList\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DisassociateEntitiesFromExperience"
payload := strings.NewReader("{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityList\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 51
{
"Id": "",
"IndexId": "",
"EntityList": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DisassociateEntitiesFromExperience")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityList\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DisassociateEntitiesFromExperience"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityList\": \"\"\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 \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityList\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DisassociateEntitiesFromExperience")
.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=AWSKendraFrontendService.DisassociateEntitiesFromExperience")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityList\": \"\"\n}")
.asString();
const data = JSON.stringify({
Id: '',
IndexId: '',
EntityList: ''
});
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=AWSKendraFrontendService.DisassociateEntitiesFromExperience');
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=AWSKendraFrontendService.DisassociateEntitiesFromExperience',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Id: '', IndexId: '', EntityList: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DisassociateEntitiesFromExperience';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","IndexId":"","EntityList":""}'
};
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=AWSKendraFrontendService.DisassociateEntitiesFromExperience',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Id": "",\n "IndexId": "",\n "EntityList": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityList\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DisassociateEntitiesFromExperience")
.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({Id: '', IndexId: '', EntityList: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DisassociateEntitiesFromExperience',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Id: '', IndexId: '', EntityList: ''},
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=AWSKendraFrontendService.DisassociateEntitiesFromExperience');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Id: '',
IndexId: '',
EntityList: ''
});
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=AWSKendraFrontendService.DisassociateEntitiesFromExperience',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Id: '', IndexId: '', EntityList: ''}
};
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=AWSKendraFrontendService.DisassociateEntitiesFromExperience';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","IndexId":"","EntityList":""}'
};
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 = @{ @"Id": @"",
@"IndexId": @"",
@"EntityList": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DisassociateEntitiesFromExperience"]
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=AWSKendraFrontendService.DisassociateEntitiesFromExperience" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityList\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DisassociateEntitiesFromExperience",
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([
'Id' => '',
'IndexId' => '',
'EntityList' => ''
]),
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=AWSKendraFrontendService.DisassociateEntitiesFromExperience', [
'body' => '{
"Id": "",
"IndexId": "",
"EntityList": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DisassociateEntitiesFromExperience');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Id' => '',
'IndexId' => '',
'EntityList' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Id' => '',
'IndexId' => '',
'EntityList' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DisassociateEntitiesFromExperience');
$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=AWSKendraFrontendService.DisassociateEntitiesFromExperience' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"IndexId": "",
"EntityList": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DisassociateEntitiesFromExperience' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"IndexId": "",
"EntityList": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityList\": \"\"\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=AWSKendraFrontendService.DisassociateEntitiesFromExperience"
payload = {
"Id": "",
"IndexId": "",
"EntityList": ""
}
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=AWSKendraFrontendService.DisassociateEntitiesFromExperience"
payload <- "{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityList\": \"\"\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=AWSKendraFrontendService.DisassociateEntitiesFromExperience")
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 \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityList\": \"\"\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 \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityList\": \"\"\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=AWSKendraFrontendService.DisassociateEntitiesFromExperience";
let payload = json!({
"Id": "",
"IndexId": "",
"EntityList": ""
});
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=AWSKendraFrontendService.DisassociateEntitiesFromExperience' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Id": "",
"IndexId": "",
"EntityList": ""
}'
echo '{
"Id": "",
"IndexId": "",
"EntityList": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DisassociateEntitiesFromExperience' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Id": "",\n "IndexId": "",\n "EntityList": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DisassociateEntitiesFromExperience'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Id": "",
"IndexId": "",
"EntityList": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DisassociateEntitiesFromExperience")! 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
DisassociatePersonasFromEntities
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DisassociatePersonasFromEntities
HEADERS
X-Amz-Target
BODY json
{
"Id": "",
"IndexId": "",
"EntityIds": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DisassociatePersonasFromEntities");
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 \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityIds\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DisassociatePersonasFromEntities" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Id ""
:IndexId ""
:EntityIds ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DisassociatePersonasFromEntities"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityIds\": \"\"\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=AWSKendraFrontendService.DisassociatePersonasFromEntities"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityIds\": \"\"\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=AWSKendraFrontendService.DisassociatePersonasFromEntities");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityIds\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DisassociatePersonasFromEntities"
payload := strings.NewReader("{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityIds\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 50
{
"Id": "",
"IndexId": "",
"EntityIds": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DisassociatePersonasFromEntities")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityIds\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DisassociatePersonasFromEntities"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityIds\": \"\"\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 \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityIds\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DisassociatePersonasFromEntities")
.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=AWSKendraFrontendService.DisassociatePersonasFromEntities")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityIds\": \"\"\n}")
.asString();
const data = JSON.stringify({
Id: '',
IndexId: '',
EntityIds: ''
});
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=AWSKendraFrontendService.DisassociatePersonasFromEntities');
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=AWSKendraFrontendService.DisassociatePersonasFromEntities',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Id: '', IndexId: '', EntityIds: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DisassociatePersonasFromEntities';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","IndexId":"","EntityIds":""}'
};
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=AWSKendraFrontendService.DisassociatePersonasFromEntities',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Id": "",\n "IndexId": "",\n "EntityIds": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityIds\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DisassociatePersonasFromEntities")
.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({Id: '', IndexId: '', EntityIds: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DisassociatePersonasFromEntities',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Id: '', IndexId: '', EntityIds: ''},
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=AWSKendraFrontendService.DisassociatePersonasFromEntities');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Id: '',
IndexId: '',
EntityIds: ''
});
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=AWSKendraFrontendService.DisassociatePersonasFromEntities',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Id: '', IndexId: '', EntityIds: ''}
};
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=AWSKendraFrontendService.DisassociatePersonasFromEntities';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","IndexId":"","EntityIds":""}'
};
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 = @{ @"Id": @"",
@"IndexId": @"",
@"EntityIds": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DisassociatePersonasFromEntities"]
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=AWSKendraFrontendService.DisassociatePersonasFromEntities" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityIds\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DisassociatePersonasFromEntities",
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([
'Id' => '',
'IndexId' => '',
'EntityIds' => ''
]),
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=AWSKendraFrontendService.DisassociatePersonasFromEntities', [
'body' => '{
"Id": "",
"IndexId": "",
"EntityIds": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DisassociatePersonasFromEntities');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Id' => '',
'IndexId' => '',
'EntityIds' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Id' => '',
'IndexId' => '',
'EntityIds' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DisassociatePersonasFromEntities');
$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=AWSKendraFrontendService.DisassociatePersonasFromEntities' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"IndexId": "",
"EntityIds": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DisassociatePersonasFromEntities' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"IndexId": "",
"EntityIds": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityIds\": \"\"\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=AWSKendraFrontendService.DisassociatePersonasFromEntities"
payload = {
"Id": "",
"IndexId": "",
"EntityIds": ""
}
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=AWSKendraFrontendService.DisassociatePersonasFromEntities"
payload <- "{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityIds\": \"\"\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=AWSKendraFrontendService.DisassociatePersonasFromEntities")
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 \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityIds\": \"\"\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 \"Id\": \"\",\n \"IndexId\": \"\",\n \"EntityIds\": \"\"\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=AWSKendraFrontendService.DisassociatePersonasFromEntities";
let payload = json!({
"Id": "",
"IndexId": "",
"EntityIds": ""
});
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=AWSKendraFrontendService.DisassociatePersonasFromEntities' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Id": "",
"IndexId": "",
"EntityIds": ""
}'
echo '{
"Id": "",
"IndexId": "",
"EntityIds": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DisassociatePersonasFromEntities' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Id": "",\n "IndexId": "",\n "EntityIds": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DisassociatePersonasFromEntities'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Id": "",
"IndexId": "",
"EntityIds": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.DisassociatePersonasFromEntities")! 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
GetQuerySuggestions
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.GetQuerySuggestions
HEADERS
X-Amz-Target
BODY json
{
"IndexId": "",
"QueryText": "",
"MaxSuggestionsCount": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.GetQuerySuggestions");
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 \"IndexId\": \"\",\n \"QueryText\": \"\",\n \"MaxSuggestionsCount\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.GetQuerySuggestions" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IndexId ""
:QueryText ""
:MaxSuggestionsCount ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.GetQuerySuggestions"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IndexId\": \"\",\n \"QueryText\": \"\",\n \"MaxSuggestionsCount\": \"\"\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=AWSKendraFrontendService.GetQuerySuggestions"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IndexId\": \"\",\n \"QueryText\": \"\",\n \"MaxSuggestionsCount\": \"\"\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=AWSKendraFrontendService.GetQuerySuggestions");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IndexId\": \"\",\n \"QueryText\": \"\",\n \"MaxSuggestionsCount\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.GetQuerySuggestions"
payload := strings.NewReader("{\n \"IndexId\": \"\",\n \"QueryText\": \"\",\n \"MaxSuggestionsCount\": \"\"\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
{
"IndexId": "",
"QueryText": "",
"MaxSuggestionsCount": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.GetQuerySuggestions")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IndexId\": \"\",\n \"QueryText\": \"\",\n \"MaxSuggestionsCount\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.GetQuerySuggestions"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IndexId\": \"\",\n \"QueryText\": \"\",\n \"MaxSuggestionsCount\": \"\"\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 \"IndexId\": \"\",\n \"QueryText\": \"\",\n \"MaxSuggestionsCount\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.GetQuerySuggestions")
.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=AWSKendraFrontendService.GetQuerySuggestions")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IndexId\": \"\",\n \"QueryText\": \"\",\n \"MaxSuggestionsCount\": \"\"\n}")
.asString();
const data = JSON.stringify({
IndexId: '',
QueryText: '',
MaxSuggestionsCount: ''
});
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=AWSKendraFrontendService.GetQuerySuggestions');
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=AWSKendraFrontendService.GetQuerySuggestions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', QueryText: '', MaxSuggestionsCount: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.GetQuerySuggestions';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","QueryText":"","MaxSuggestionsCount":""}'
};
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=AWSKendraFrontendService.GetQuerySuggestions',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IndexId": "",\n "QueryText": "",\n "MaxSuggestionsCount": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"IndexId\": \"\",\n \"QueryText\": \"\",\n \"MaxSuggestionsCount\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.GetQuerySuggestions")
.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({IndexId: '', QueryText: '', MaxSuggestionsCount: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.GetQuerySuggestions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {IndexId: '', QueryText: '', MaxSuggestionsCount: ''},
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=AWSKendraFrontendService.GetQuerySuggestions');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IndexId: '',
QueryText: '',
MaxSuggestionsCount: ''
});
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=AWSKendraFrontendService.GetQuerySuggestions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', QueryText: '', MaxSuggestionsCount: ''}
};
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=AWSKendraFrontendService.GetQuerySuggestions';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","QueryText":"","MaxSuggestionsCount":""}'
};
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 = @{ @"IndexId": @"",
@"QueryText": @"",
@"MaxSuggestionsCount": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.GetQuerySuggestions"]
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=AWSKendraFrontendService.GetQuerySuggestions" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IndexId\": \"\",\n \"QueryText\": \"\",\n \"MaxSuggestionsCount\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.GetQuerySuggestions",
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([
'IndexId' => '',
'QueryText' => '',
'MaxSuggestionsCount' => ''
]),
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=AWSKendraFrontendService.GetQuerySuggestions', [
'body' => '{
"IndexId": "",
"QueryText": "",
"MaxSuggestionsCount": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.GetQuerySuggestions');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IndexId' => '',
'QueryText' => '',
'MaxSuggestionsCount' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IndexId' => '',
'QueryText' => '',
'MaxSuggestionsCount' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.GetQuerySuggestions');
$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=AWSKendraFrontendService.GetQuerySuggestions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"QueryText": "",
"MaxSuggestionsCount": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.GetQuerySuggestions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"QueryText": "",
"MaxSuggestionsCount": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IndexId\": \"\",\n \"QueryText\": \"\",\n \"MaxSuggestionsCount\": \"\"\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=AWSKendraFrontendService.GetQuerySuggestions"
payload = {
"IndexId": "",
"QueryText": "",
"MaxSuggestionsCount": ""
}
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=AWSKendraFrontendService.GetQuerySuggestions"
payload <- "{\n \"IndexId\": \"\",\n \"QueryText\": \"\",\n \"MaxSuggestionsCount\": \"\"\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=AWSKendraFrontendService.GetQuerySuggestions")
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 \"IndexId\": \"\",\n \"QueryText\": \"\",\n \"MaxSuggestionsCount\": \"\"\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 \"IndexId\": \"\",\n \"QueryText\": \"\",\n \"MaxSuggestionsCount\": \"\"\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=AWSKendraFrontendService.GetQuerySuggestions";
let payload = json!({
"IndexId": "",
"QueryText": "",
"MaxSuggestionsCount": ""
});
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=AWSKendraFrontendService.GetQuerySuggestions' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IndexId": "",
"QueryText": "",
"MaxSuggestionsCount": ""
}'
echo '{
"IndexId": "",
"QueryText": "",
"MaxSuggestionsCount": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.GetQuerySuggestions' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IndexId": "",\n "QueryText": "",\n "MaxSuggestionsCount": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.GetQuerySuggestions'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"IndexId": "",
"QueryText": "",
"MaxSuggestionsCount": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.GetQuerySuggestions")! 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
GetSnapshots
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.GetSnapshots
HEADERS
X-Amz-Target
BODY json
{
"IndexId": "",
"Interval": "",
"MetricType": "",
"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=AWSKendraFrontendService.GetSnapshots");
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 \"IndexId\": \"\",\n \"Interval\": \"\",\n \"MetricType\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.GetSnapshots" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IndexId ""
:Interval ""
:MetricType ""
:NextToken ""
:MaxResults ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.GetSnapshots"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IndexId\": \"\",\n \"Interval\": \"\",\n \"MetricType\": \"\",\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=AWSKendraFrontendService.GetSnapshots"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IndexId\": \"\",\n \"Interval\": \"\",\n \"MetricType\": \"\",\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=AWSKendraFrontendService.GetSnapshots");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IndexId\": \"\",\n \"Interval\": \"\",\n \"MetricType\": \"\",\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=AWSKendraFrontendService.GetSnapshots"
payload := strings.NewReader("{\n \"IndexId\": \"\",\n \"Interval\": \"\",\n \"MetricType\": \"\",\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: 96
{
"IndexId": "",
"Interval": "",
"MetricType": "",
"NextToken": "",
"MaxResults": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.GetSnapshots")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IndexId\": \"\",\n \"Interval\": \"\",\n \"MetricType\": \"\",\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=AWSKendraFrontendService.GetSnapshots"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IndexId\": \"\",\n \"Interval\": \"\",\n \"MetricType\": \"\",\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 \"IndexId\": \"\",\n \"Interval\": \"\",\n \"MetricType\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.GetSnapshots")
.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=AWSKendraFrontendService.GetSnapshots")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IndexId\": \"\",\n \"Interval\": \"\",\n \"MetricType\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.asString();
const data = JSON.stringify({
IndexId: '',
Interval: '',
MetricType: '',
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=AWSKendraFrontendService.GetSnapshots');
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=AWSKendraFrontendService.GetSnapshots',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', Interval: '', MetricType: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.GetSnapshots';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","Interval":"","MetricType":"","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=AWSKendraFrontendService.GetSnapshots',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IndexId": "",\n "Interval": "",\n "MetricType": "",\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 \"IndexId\": \"\",\n \"Interval\": \"\",\n \"MetricType\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.GetSnapshots")
.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({IndexId: '', Interval: '', MetricType: '', NextToken: '', MaxResults: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.GetSnapshots',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {IndexId: '', Interval: '', MetricType: '', 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=AWSKendraFrontendService.GetSnapshots');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IndexId: '',
Interval: '',
MetricType: '',
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=AWSKendraFrontendService.GetSnapshots',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', Interval: '', MetricType: '', 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=AWSKendraFrontendService.GetSnapshots';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","Interval":"","MetricType":"","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 = @{ @"IndexId": @"",
@"Interval": @"",
@"MetricType": @"",
@"NextToken": @"",
@"MaxResults": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.GetSnapshots"]
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=AWSKendraFrontendService.GetSnapshots" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IndexId\": \"\",\n \"Interval\": \"\",\n \"MetricType\": \"\",\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=AWSKendraFrontendService.GetSnapshots",
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([
'IndexId' => '',
'Interval' => '',
'MetricType' => '',
'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=AWSKendraFrontendService.GetSnapshots', [
'body' => '{
"IndexId": "",
"Interval": "",
"MetricType": "",
"NextToken": "",
"MaxResults": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.GetSnapshots');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IndexId' => '',
'Interval' => '',
'MetricType' => '',
'NextToken' => '',
'MaxResults' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IndexId' => '',
'Interval' => '',
'MetricType' => '',
'NextToken' => '',
'MaxResults' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.GetSnapshots');
$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=AWSKendraFrontendService.GetSnapshots' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"Interval": "",
"MetricType": "",
"NextToken": "",
"MaxResults": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.GetSnapshots' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"Interval": "",
"MetricType": "",
"NextToken": "",
"MaxResults": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IndexId\": \"\",\n \"Interval\": \"\",\n \"MetricType\": \"\",\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=AWSKendraFrontendService.GetSnapshots"
payload = {
"IndexId": "",
"Interval": "",
"MetricType": "",
"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=AWSKendraFrontendService.GetSnapshots"
payload <- "{\n \"IndexId\": \"\",\n \"Interval\": \"\",\n \"MetricType\": \"\",\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=AWSKendraFrontendService.GetSnapshots")
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 \"IndexId\": \"\",\n \"Interval\": \"\",\n \"MetricType\": \"\",\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 \"IndexId\": \"\",\n \"Interval\": \"\",\n \"MetricType\": \"\",\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=AWSKendraFrontendService.GetSnapshots";
let payload = json!({
"IndexId": "",
"Interval": "",
"MetricType": "",
"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=AWSKendraFrontendService.GetSnapshots' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IndexId": "",
"Interval": "",
"MetricType": "",
"NextToken": "",
"MaxResults": ""
}'
echo '{
"IndexId": "",
"Interval": "",
"MetricType": "",
"NextToken": "",
"MaxResults": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.GetSnapshots' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IndexId": "",\n "Interval": "",\n "MetricType": "",\n "NextToken": "",\n "MaxResults": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.GetSnapshots'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"IndexId": "",
"Interval": "",
"MetricType": "",
"NextToken": "",
"MaxResults": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.GetSnapshots")! 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
ListAccessControlConfigurations
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListAccessControlConfigurations
HEADERS
X-Amz-Target
BODY json
{
"IndexId": "",
"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=AWSKendraFrontendService.ListAccessControlConfigurations");
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 \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListAccessControlConfigurations" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IndexId ""
:NextToken ""
:MaxResults ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListAccessControlConfigurations"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListAccessControlConfigurations"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListAccessControlConfigurations");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListAccessControlConfigurations"
payload := strings.NewReader("{\n \"IndexId\": \"\",\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: 58
{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListAccessControlConfigurations")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListAccessControlConfigurations"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IndexId\": \"\",\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 \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListAccessControlConfigurations")
.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=AWSKendraFrontendService.ListAccessControlConfigurations")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.asString();
const data = JSON.stringify({
IndexId: '',
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=AWSKendraFrontendService.ListAccessControlConfigurations');
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=AWSKendraFrontendService.ListAccessControlConfigurations',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListAccessControlConfigurations';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","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=AWSKendraFrontendService.ListAccessControlConfigurations',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IndexId": "",\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 \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListAccessControlConfigurations")
.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({IndexId: '', NextToken: '', MaxResults: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListAccessControlConfigurations',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {IndexId: '', 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=AWSKendraFrontendService.ListAccessControlConfigurations');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IndexId: '',
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=AWSKendraFrontendService.ListAccessControlConfigurations',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', 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=AWSKendraFrontendService.ListAccessControlConfigurations';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","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 = @{ @"IndexId": @"",
@"NextToken": @"",
@"MaxResults": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListAccessControlConfigurations"]
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=AWSKendraFrontendService.ListAccessControlConfigurations" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListAccessControlConfigurations",
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([
'IndexId' => '',
'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=AWSKendraFrontendService.ListAccessControlConfigurations', [
'body' => '{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListAccessControlConfigurations');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IndexId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IndexId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListAccessControlConfigurations');
$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=AWSKendraFrontendService.ListAccessControlConfigurations' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListAccessControlConfigurations' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListAccessControlConfigurations"
payload = {
"IndexId": "",
"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=AWSKendraFrontendService.ListAccessControlConfigurations"
payload <- "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListAccessControlConfigurations")
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 \"IndexId\": \"\",\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 \"IndexId\": \"\",\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=AWSKendraFrontendService.ListAccessControlConfigurations";
let payload = json!({
"IndexId": "",
"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=AWSKendraFrontendService.ListAccessControlConfigurations' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}'
echo '{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListAccessControlConfigurations' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IndexId": "",\n "NextToken": "",\n "MaxResults": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListAccessControlConfigurations'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"IndexId": "",
"NextToken": "",
"MaxResults": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListAccessControlConfigurations")! 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
ListDataSourceSyncJobs
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListDataSourceSyncJobs
HEADERS
X-Amz-Target
BODY json
{
"Id": "",
"IndexId": "",
"NextToken": "",
"MaxResults": "",
"StartTimeFilter": "",
"StatusFilter": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListDataSourceSyncJobs");
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 \"Id\": \"\",\n \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"StartTimeFilter\": \"\",\n \"StatusFilter\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListDataSourceSyncJobs" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Id ""
:IndexId ""
:NextToken ""
:MaxResults ""
:StartTimeFilter ""
:StatusFilter ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListDataSourceSyncJobs"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"StartTimeFilter\": \"\",\n \"StatusFilter\": \"\"\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=AWSKendraFrontendService.ListDataSourceSyncJobs"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"StartTimeFilter\": \"\",\n \"StatusFilter\": \"\"\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=AWSKendraFrontendService.ListDataSourceSyncJobs");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"StartTimeFilter\": \"\",\n \"StatusFilter\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListDataSourceSyncJobs"
payload := strings.NewReader("{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"StartTimeFilter\": \"\",\n \"StatusFilter\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 117
{
"Id": "",
"IndexId": "",
"NextToken": "",
"MaxResults": "",
"StartTimeFilter": "",
"StatusFilter": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListDataSourceSyncJobs")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"StartTimeFilter\": \"\",\n \"StatusFilter\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListDataSourceSyncJobs"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"StartTimeFilter\": \"\",\n \"StatusFilter\": \"\"\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 \"Id\": \"\",\n \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"StartTimeFilter\": \"\",\n \"StatusFilter\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListDataSourceSyncJobs")
.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=AWSKendraFrontendService.ListDataSourceSyncJobs")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"StartTimeFilter\": \"\",\n \"StatusFilter\": \"\"\n}")
.asString();
const data = JSON.stringify({
Id: '',
IndexId: '',
NextToken: '',
MaxResults: '',
StartTimeFilter: '',
StatusFilter: ''
});
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=AWSKendraFrontendService.ListDataSourceSyncJobs');
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=AWSKendraFrontendService.ListDataSourceSyncJobs',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Id: '',
IndexId: '',
NextToken: '',
MaxResults: '',
StartTimeFilter: '',
StatusFilter: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListDataSourceSyncJobs';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","IndexId":"","NextToken":"","MaxResults":"","StartTimeFilter":"","StatusFilter":""}'
};
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=AWSKendraFrontendService.ListDataSourceSyncJobs',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Id": "",\n "IndexId": "",\n "NextToken": "",\n "MaxResults": "",\n "StartTimeFilter": "",\n "StatusFilter": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"StartTimeFilter\": \"\",\n \"StatusFilter\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListDataSourceSyncJobs")
.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({
Id: '',
IndexId: '',
NextToken: '',
MaxResults: '',
StartTimeFilter: '',
StatusFilter: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListDataSourceSyncJobs',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
Id: '',
IndexId: '',
NextToken: '',
MaxResults: '',
StartTimeFilter: '',
StatusFilter: ''
},
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=AWSKendraFrontendService.ListDataSourceSyncJobs');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Id: '',
IndexId: '',
NextToken: '',
MaxResults: '',
StartTimeFilter: '',
StatusFilter: ''
});
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=AWSKendraFrontendService.ListDataSourceSyncJobs',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Id: '',
IndexId: '',
NextToken: '',
MaxResults: '',
StartTimeFilter: '',
StatusFilter: ''
}
};
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=AWSKendraFrontendService.ListDataSourceSyncJobs';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","IndexId":"","NextToken":"","MaxResults":"","StartTimeFilter":"","StatusFilter":""}'
};
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 = @{ @"Id": @"",
@"IndexId": @"",
@"NextToken": @"",
@"MaxResults": @"",
@"StartTimeFilter": @"",
@"StatusFilter": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListDataSourceSyncJobs"]
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=AWSKendraFrontendService.ListDataSourceSyncJobs" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"StartTimeFilter\": \"\",\n \"StatusFilter\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListDataSourceSyncJobs",
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([
'Id' => '',
'IndexId' => '',
'NextToken' => '',
'MaxResults' => '',
'StartTimeFilter' => '',
'StatusFilter' => ''
]),
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=AWSKendraFrontendService.ListDataSourceSyncJobs', [
'body' => '{
"Id": "",
"IndexId": "",
"NextToken": "",
"MaxResults": "",
"StartTimeFilter": "",
"StatusFilter": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListDataSourceSyncJobs');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Id' => '',
'IndexId' => '',
'NextToken' => '',
'MaxResults' => '',
'StartTimeFilter' => '',
'StatusFilter' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Id' => '',
'IndexId' => '',
'NextToken' => '',
'MaxResults' => '',
'StartTimeFilter' => '',
'StatusFilter' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListDataSourceSyncJobs');
$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=AWSKendraFrontendService.ListDataSourceSyncJobs' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"IndexId": "",
"NextToken": "",
"MaxResults": "",
"StartTimeFilter": "",
"StatusFilter": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListDataSourceSyncJobs' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"IndexId": "",
"NextToken": "",
"MaxResults": "",
"StartTimeFilter": "",
"StatusFilter": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"StartTimeFilter\": \"\",\n \"StatusFilter\": \"\"\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=AWSKendraFrontendService.ListDataSourceSyncJobs"
payload = {
"Id": "",
"IndexId": "",
"NextToken": "",
"MaxResults": "",
"StartTimeFilter": "",
"StatusFilter": ""
}
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=AWSKendraFrontendService.ListDataSourceSyncJobs"
payload <- "{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"StartTimeFilter\": \"\",\n \"StatusFilter\": \"\"\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=AWSKendraFrontendService.ListDataSourceSyncJobs")
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 \"Id\": \"\",\n \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"StartTimeFilter\": \"\",\n \"StatusFilter\": \"\"\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 \"Id\": \"\",\n \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\",\n \"StartTimeFilter\": \"\",\n \"StatusFilter\": \"\"\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=AWSKendraFrontendService.ListDataSourceSyncJobs";
let payload = json!({
"Id": "",
"IndexId": "",
"NextToken": "",
"MaxResults": "",
"StartTimeFilter": "",
"StatusFilter": ""
});
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=AWSKendraFrontendService.ListDataSourceSyncJobs' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Id": "",
"IndexId": "",
"NextToken": "",
"MaxResults": "",
"StartTimeFilter": "",
"StatusFilter": ""
}'
echo '{
"Id": "",
"IndexId": "",
"NextToken": "",
"MaxResults": "",
"StartTimeFilter": "",
"StatusFilter": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListDataSourceSyncJobs' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Id": "",\n "IndexId": "",\n "NextToken": "",\n "MaxResults": "",\n "StartTimeFilter": "",\n "StatusFilter": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListDataSourceSyncJobs'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Id": "",
"IndexId": "",
"NextToken": "",
"MaxResults": "",
"StartTimeFilter": "",
"StatusFilter": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListDataSourceSyncJobs")! 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
ListDataSources
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListDataSources
HEADERS
X-Amz-Target
BODY json
{
"IndexId": "",
"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=AWSKendraFrontendService.ListDataSources");
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 \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListDataSources" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IndexId ""
:NextToken ""
:MaxResults ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListDataSources"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListDataSources"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListDataSources");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListDataSources"
payload := strings.NewReader("{\n \"IndexId\": \"\",\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: 58
{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListDataSources")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListDataSources"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IndexId\": \"\",\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 \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListDataSources")
.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=AWSKendraFrontendService.ListDataSources")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.asString();
const data = JSON.stringify({
IndexId: '',
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=AWSKendraFrontendService.ListDataSources');
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=AWSKendraFrontendService.ListDataSources',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListDataSources';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","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=AWSKendraFrontendService.ListDataSources',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IndexId": "",\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 \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListDataSources")
.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({IndexId: '', NextToken: '', MaxResults: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListDataSources',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {IndexId: '', 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=AWSKendraFrontendService.ListDataSources');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IndexId: '',
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=AWSKendraFrontendService.ListDataSources',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', 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=AWSKendraFrontendService.ListDataSources';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","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 = @{ @"IndexId": @"",
@"NextToken": @"",
@"MaxResults": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListDataSources"]
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=AWSKendraFrontendService.ListDataSources" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListDataSources",
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([
'IndexId' => '',
'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=AWSKendraFrontendService.ListDataSources', [
'body' => '{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListDataSources');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IndexId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IndexId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListDataSources');
$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=AWSKendraFrontendService.ListDataSources' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListDataSources' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListDataSources"
payload = {
"IndexId": "",
"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=AWSKendraFrontendService.ListDataSources"
payload <- "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListDataSources")
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 \"IndexId\": \"\",\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 \"IndexId\": \"\",\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=AWSKendraFrontendService.ListDataSources";
let payload = json!({
"IndexId": "",
"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=AWSKendraFrontendService.ListDataSources' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}'
echo '{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListDataSources' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IndexId": "",\n "NextToken": "",\n "MaxResults": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListDataSources'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"IndexId": "",
"NextToken": "",
"MaxResults": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListDataSources")! 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
ListEntityPersonas
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListEntityPersonas
HEADERS
X-Amz-Target
BODY json
{
"Id": "",
"IndexId": "",
"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=AWSKendraFrontendService.ListEntityPersonas");
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 \"Id\": \"\",\n \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListEntityPersonas" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Id ""
:IndexId ""
:NextToken ""
:MaxResults ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListEntityPersonas"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Id\": \"\",\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListEntityPersonas"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Id\": \"\",\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListEntityPersonas");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Id\": \"\",\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListEntityPersonas"
payload := strings.NewReader("{\n \"Id\": \"\",\n \"IndexId\": \"\",\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: 70
{
"Id": "",
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListEntityPersonas")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Id\": \"\",\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListEntityPersonas"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Id\": \"\",\n \"IndexId\": \"\",\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 \"Id\": \"\",\n \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListEntityPersonas")
.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=AWSKendraFrontendService.ListEntityPersonas")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.asString();
const data = JSON.stringify({
Id: '',
IndexId: '',
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=AWSKendraFrontendService.ListEntityPersonas');
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=AWSKendraFrontendService.ListEntityPersonas',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Id: '', IndexId: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListEntityPersonas';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","IndexId":"","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=AWSKendraFrontendService.ListEntityPersonas',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Id": "",\n "IndexId": "",\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 \"Id\": \"\",\n \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListEntityPersonas")
.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({Id: '', IndexId: '', NextToken: '', MaxResults: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListEntityPersonas',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Id: '', IndexId: '', 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=AWSKendraFrontendService.ListEntityPersonas');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Id: '',
IndexId: '',
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=AWSKendraFrontendService.ListEntityPersonas',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Id: '', IndexId: '', 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=AWSKendraFrontendService.ListEntityPersonas';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","IndexId":"","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 = @{ @"Id": @"",
@"IndexId": @"",
@"NextToken": @"",
@"MaxResults": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListEntityPersonas"]
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=AWSKendraFrontendService.ListEntityPersonas" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Id\": \"\",\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListEntityPersonas",
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([
'Id' => '',
'IndexId' => '',
'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=AWSKendraFrontendService.ListEntityPersonas', [
'body' => '{
"Id": "",
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListEntityPersonas');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Id' => '',
'IndexId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Id' => '',
'IndexId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListEntityPersonas');
$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=AWSKendraFrontendService.ListEntityPersonas' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListEntityPersonas' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Id\": \"\",\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListEntityPersonas"
payload = {
"Id": "",
"IndexId": "",
"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=AWSKendraFrontendService.ListEntityPersonas"
payload <- "{\n \"Id\": \"\",\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListEntityPersonas")
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 \"Id\": \"\",\n \"IndexId\": \"\",\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 \"Id\": \"\",\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListEntityPersonas";
let payload = json!({
"Id": "",
"IndexId": "",
"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=AWSKendraFrontendService.ListEntityPersonas' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Id": "",
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}'
echo '{
"Id": "",
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListEntityPersonas' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Id": "",\n "IndexId": "",\n "NextToken": "",\n "MaxResults": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListEntityPersonas'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Id": "",
"IndexId": "",
"NextToken": "",
"MaxResults": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListEntityPersonas")! 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
ListExperienceEntities
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListExperienceEntities
HEADERS
X-Amz-Target
BODY json
{
"Id": "",
"IndexId": "",
"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=AWSKendraFrontendService.ListExperienceEntities");
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 \"Id\": \"\",\n \"IndexId\": \"\",\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListExperienceEntities" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Id ""
:IndexId ""
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListExperienceEntities"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Id\": \"\",\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListExperienceEntities"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Id\": \"\",\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListExperienceEntities");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Id\": \"\",\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListExperienceEntities"
payload := strings.NewReader("{\n \"Id\": \"\",\n \"IndexId\": \"\",\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: 50
{
"Id": "",
"IndexId": "",
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListExperienceEntities")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListExperienceEntities"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Id\": \"\",\n \"IndexId\": \"\",\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 \"Id\": \"\",\n \"IndexId\": \"\",\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListExperienceEntities")
.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=AWSKendraFrontendService.ListExperienceEntities")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
Id: '',
IndexId: '',
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=AWSKendraFrontendService.ListExperienceEntities');
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=AWSKendraFrontendService.ListExperienceEntities',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Id: '', IndexId: '', NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListExperienceEntities';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","IndexId":"","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=AWSKendraFrontendService.ListExperienceEntities',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Id": "",\n "IndexId": "",\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 \"Id\": \"\",\n \"IndexId\": \"\",\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListExperienceEntities")
.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({Id: '', IndexId: '', NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListExperienceEntities',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Id: '', IndexId: '', 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=AWSKendraFrontendService.ListExperienceEntities');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Id: '',
IndexId: '',
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=AWSKendraFrontendService.ListExperienceEntities',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Id: '', IndexId: '', 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=AWSKendraFrontendService.ListExperienceEntities';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","IndexId":"","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 = @{ @"Id": @"",
@"IndexId": @"",
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListExperienceEntities"]
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=AWSKendraFrontendService.ListExperienceEntities" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Id\": \"\",\n \"IndexId\": \"\",\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListExperienceEntities",
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([
'Id' => '',
'IndexId' => '',
'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=AWSKendraFrontendService.ListExperienceEntities', [
'body' => '{
"Id": "",
"IndexId": "",
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListExperienceEntities');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Id' => '',
'IndexId' => '',
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Id' => '',
'IndexId' => '',
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListExperienceEntities');
$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=AWSKendraFrontendService.ListExperienceEntities' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"IndexId": "",
"NextToken": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListExperienceEntities' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"IndexId": "",
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Id\": \"\",\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListExperienceEntities"
payload = {
"Id": "",
"IndexId": "",
"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=AWSKendraFrontendService.ListExperienceEntities"
payload <- "{\n \"Id\": \"\",\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListExperienceEntities")
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 \"Id\": \"\",\n \"IndexId\": \"\",\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 \"Id\": \"\",\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListExperienceEntities";
let payload = json!({
"Id": "",
"IndexId": "",
"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=AWSKendraFrontendService.ListExperienceEntities' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Id": "",
"IndexId": "",
"NextToken": ""
}'
echo '{
"Id": "",
"IndexId": "",
"NextToken": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListExperienceEntities' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Id": "",\n "IndexId": "",\n "NextToken": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListExperienceEntities'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Id": "",
"IndexId": "",
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListExperienceEntities")! 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
ListExperiences
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListExperiences
HEADERS
X-Amz-Target
BODY json
{
"IndexId": "",
"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=AWSKendraFrontendService.ListExperiences");
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 \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListExperiences" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IndexId ""
:NextToken ""
:MaxResults ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListExperiences"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListExperiences"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListExperiences");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListExperiences"
payload := strings.NewReader("{\n \"IndexId\": \"\",\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: 58
{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListExperiences")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListExperiences"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IndexId\": \"\",\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 \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListExperiences")
.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=AWSKendraFrontendService.ListExperiences")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.asString();
const data = JSON.stringify({
IndexId: '',
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=AWSKendraFrontendService.ListExperiences');
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=AWSKendraFrontendService.ListExperiences',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListExperiences';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","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=AWSKendraFrontendService.ListExperiences',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IndexId": "",\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 \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListExperiences")
.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({IndexId: '', NextToken: '', MaxResults: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListExperiences',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {IndexId: '', 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=AWSKendraFrontendService.ListExperiences');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IndexId: '',
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=AWSKendraFrontendService.ListExperiences',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', 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=AWSKendraFrontendService.ListExperiences';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","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 = @{ @"IndexId": @"",
@"NextToken": @"",
@"MaxResults": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListExperiences"]
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=AWSKendraFrontendService.ListExperiences" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListExperiences",
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([
'IndexId' => '',
'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=AWSKendraFrontendService.ListExperiences', [
'body' => '{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListExperiences');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IndexId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IndexId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListExperiences');
$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=AWSKendraFrontendService.ListExperiences' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListExperiences' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListExperiences"
payload = {
"IndexId": "",
"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=AWSKendraFrontendService.ListExperiences"
payload <- "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListExperiences")
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 \"IndexId\": \"\",\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 \"IndexId\": \"\",\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=AWSKendraFrontendService.ListExperiences";
let payload = json!({
"IndexId": "",
"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=AWSKendraFrontendService.ListExperiences' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}'
echo '{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListExperiences' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IndexId": "",\n "NextToken": "",\n "MaxResults": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListExperiences'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"IndexId": "",
"NextToken": "",
"MaxResults": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListExperiences")! 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
ListFaqs
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListFaqs
HEADERS
X-Amz-Target
BODY json
{
"IndexId": "",
"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=AWSKendraFrontendService.ListFaqs");
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 \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListFaqs" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IndexId ""
:NextToken ""
:MaxResults ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListFaqs"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListFaqs"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListFaqs");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListFaqs"
payload := strings.NewReader("{\n \"IndexId\": \"\",\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: 58
{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListFaqs")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListFaqs"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IndexId\": \"\",\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 \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListFaqs")
.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=AWSKendraFrontendService.ListFaqs")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.asString();
const data = JSON.stringify({
IndexId: '',
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=AWSKendraFrontendService.ListFaqs');
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=AWSKendraFrontendService.ListFaqs',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListFaqs';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","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=AWSKendraFrontendService.ListFaqs',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IndexId": "",\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 \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListFaqs")
.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({IndexId: '', NextToken: '', MaxResults: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListFaqs',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {IndexId: '', 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=AWSKendraFrontendService.ListFaqs');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IndexId: '',
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=AWSKendraFrontendService.ListFaqs',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', 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=AWSKendraFrontendService.ListFaqs';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","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 = @{ @"IndexId": @"",
@"NextToken": @"",
@"MaxResults": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListFaqs"]
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=AWSKendraFrontendService.ListFaqs" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListFaqs",
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([
'IndexId' => '',
'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=AWSKendraFrontendService.ListFaqs', [
'body' => '{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListFaqs');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IndexId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IndexId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListFaqs');
$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=AWSKendraFrontendService.ListFaqs' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListFaqs' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListFaqs"
payload = {
"IndexId": "",
"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=AWSKendraFrontendService.ListFaqs"
payload <- "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListFaqs")
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 \"IndexId\": \"\",\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 \"IndexId\": \"\",\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=AWSKendraFrontendService.ListFaqs";
let payload = json!({
"IndexId": "",
"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=AWSKendraFrontendService.ListFaqs' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}'
echo '{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListFaqs' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IndexId": "",\n "NextToken": "",\n "MaxResults": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListFaqs'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"IndexId": "",
"NextToken": "",
"MaxResults": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListFaqs")! 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
ListFeaturedResultsSets
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListFeaturedResultsSets
HEADERS
X-Amz-Target
BODY json
{
"IndexId": "",
"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=AWSKendraFrontendService.ListFeaturedResultsSets");
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 \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListFeaturedResultsSets" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IndexId ""
:NextToken ""
:MaxResults ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListFeaturedResultsSets"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListFeaturedResultsSets"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListFeaturedResultsSets");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListFeaturedResultsSets"
payload := strings.NewReader("{\n \"IndexId\": \"\",\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: 58
{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListFeaturedResultsSets")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListFeaturedResultsSets"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IndexId\": \"\",\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 \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListFeaturedResultsSets")
.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=AWSKendraFrontendService.ListFeaturedResultsSets")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.asString();
const data = JSON.stringify({
IndexId: '',
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=AWSKendraFrontendService.ListFeaturedResultsSets');
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=AWSKendraFrontendService.ListFeaturedResultsSets',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListFeaturedResultsSets';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","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=AWSKendraFrontendService.ListFeaturedResultsSets',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IndexId": "",\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 \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListFeaturedResultsSets")
.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({IndexId: '', NextToken: '', MaxResults: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListFeaturedResultsSets',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {IndexId: '', 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=AWSKendraFrontendService.ListFeaturedResultsSets');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IndexId: '',
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=AWSKendraFrontendService.ListFeaturedResultsSets',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', 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=AWSKendraFrontendService.ListFeaturedResultsSets';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","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 = @{ @"IndexId": @"",
@"NextToken": @"",
@"MaxResults": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListFeaturedResultsSets"]
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=AWSKendraFrontendService.ListFeaturedResultsSets" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListFeaturedResultsSets",
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([
'IndexId' => '',
'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=AWSKendraFrontendService.ListFeaturedResultsSets', [
'body' => '{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListFeaturedResultsSets');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IndexId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IndexId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListFeaturedResultsSets');
$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=AWSKendraFrontendService.ListFeaturedResultsSets' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListFeaturedResultsSets' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListFeaturedResultsSets"
payload = {
"IndexId": "",
"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=AWSKendraFrontendService.ListFeaturedResultsSets"
payload <- "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListFeaturedResultsSets")
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 \"IndexId\": \"\",\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 \"IndexId\": \"\",\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=AWSKendraFrontendService.ListFeaturedResultsSets";
let payload = json!({
"IndexId": "",
"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=AWSKendraFrontendService.ListFeaturedResultsSets' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}'
echo '{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListFeaturedResultsSets' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IndexId": "",\n "NextToken": "",\n "MaxResults": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListFeaturedResultsSets'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"IndexId": "",
"NextToken": "",
"MaxResults": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListFeaturedResultsSets")! 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
ListGroupsOlderThanOrderingId
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListGroupsOlderThanOrderingId
HEADERS
X-Amz-Target
BODY json
{
"IndexId": "",
"DataSourceId": "",
"OrderingId": "",
"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=AWSKendraFrontendService.ListGroupsOlderThanOrderingId");
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 \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"OrderingId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListGroupsOlderThanOrderingId" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IndexId ""
:DataSourceId ""
:OrderingId ""
:NextToken ""
:MaxResults ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListGroupsOlderThanOrderingId"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"OrderingId\": \"\",\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=AWSKendraFrontendService.ListGroupsOlderThanOrderingId"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"OrderingId\": \"\",\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=AWSKendraFrontendService.ListGroupsOlderThanOrderingId");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"OrderingId\": \"\",\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=AWSKendraFrontendService.ListGroupsOlderThanOrderingId"
payload := strings.NewReader("{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"OrderingId\": \"\",\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: 100
{
"IndexId": "",
"DataSourceId": "",
"OrderingId": "",
"NextToken": "",
"MaxResults": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListGroupsOlderThanOrderingId")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"OrderingId\": \"\",\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=AWSKendraFrontendService.ListGroupsOlderThanOrderingId"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"OrderingId\": \"\",\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 \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"OrderingId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListGroupsOlderThanOrderingId")
.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=AWSKendraFrontendService.ListGroupsOlderThanOrderingId")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"OrderingId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.asString();
const data = JSON.stringify({
IndexId: '',
DataSourceId: '',
OrderingId: '',
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=AWSKendraFrontendService.ListGroupsOlderThanOrderingId');
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=AWSKendraFrontendService.ListGroupsOlderThanOrderingId',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', DataSourceId: '', OrderingId: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListGroupsOlderThanOrderingId';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","DataSourceId":"","OrderingId":"","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=AWSKendraFrontendService.ListGroupsOlderThanOrderingId',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IndexId": "",\n "DataSourceId": "",\n "OrderingId": "",\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 \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"OrderingId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListGroupsOlderThanOrderingId")
.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({IndexId: '', DataSourceId: '', OrderingId: '', NextToken: '', MaxResults: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListGroupsOlderThanOrderingId',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {IndexId: '', DataSourceId: '', OrderingId: '', 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=AWSKendraFrontendService.ListGroupsOlderThanOrderingId');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IndexId: '',
DataSourceId: '',
OrderingId: '',
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=AWSKendraFrontendService.ListGroupsOlderThanOrderingId',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', DataSourceId: '', OrderingId: '', 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=AWSKendraFrontendService.ListGroupsOlderThanOrderingId';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","DataSourceId":"","OrderingId":"","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 = @{ @"IndexId": @"",
@"DataSourceId": @"",
@"OrderingId": @"",
@"NextToken": @"",
@"MaxResults": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListGroupsOlderThanOrderingId"]
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=AWSKendraFrontendService.ListGroupsOlderThanOrderingId" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"OrderingId\": \"\",\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=AWSKendraFrontendService.ListGroupsOlderThanOrderingId",
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([
'IndexId' => '',
'DataSourceId' => '',
'OrderingId' => '',
'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=AWSKendraFrontendService.ListGroupsOlderThanOrderingId', [
'body' => '{
"IndexId": "",
"DataSourceId": "",
"OrderingId": "",
"NextToken": "",
"MaxResults": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListGroupsOlderThanOrderingId');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IndexId' => '',
'DataSourceId' => '',
'OrderingId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IndexId' => '',
'DataSourceId' => '',
'OrderingId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListGroupsOlderThanOrderingId');
$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=AWSKendraFrontendService.ListGroupsOlderThanOrderingId' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"DataSourceId": "",
"OrderingId": "",
"NextToken": "",
"MaxResults": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListGroupsOlderThanOrderingId' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"DataSourceId": "",
"OrderingId": "",
"NextToken": "",
"MaxResults": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"OrderingId\": \"\",\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=AWSKendraFrontendService.ListGroupsOlderThanOrderingId"
payload = {
"IndexId": "",
"DataSourceId": "",
"OrderingId": "",
"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=AWSKendraFrontendService.ListGroupsOlderThanOrderingId"
payload <- "{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"OrderingId\": \"\",\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=AWSKendraFrontendService.ListGroupsOlderThanOrderingId")
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 \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"OrderingId\": \"\",\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 \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"OrderingId\": \"\",\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=AWSKendraFrontendService.ListGroupsOlderThanOrderingId";
let payload = json!({
"IndexId": "",
"DataSourceId": "",
"OrderingId": "",
"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=AWSKendraFrontendService.ListGroupsOlderThanOrderingId' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IndexId": "",
"DataSourceId": "",
"OrderingId": "",
"NextToken": "",
"MaxResults": ""
}'
echo '{
"IndexId": "",
"DataSourceId": "",
"OrderingId": "",
"NextToken": "",
"MaxResults": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListGroupsOlderThanOrderingId' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IndexId": "",\n "DataSourceId": "",\n "OrderingId": "",\n "NextToken": "",\n "MaxResults": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListGroupsOlderThanOrderingId'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"IndexId": "",
"DataSourceId": "",
"OrderingId": "",
"NextToken": "",
"MaxResults": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListGroupsOlderThanOrderingId")! 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
ListIndices
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListIndices
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=AWSKendraFrontendService.ListIndices");
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=AWSKendraFrontendService.ListIndices" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:NextToken ""
:MaxResults ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListIndices"
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=AWSKendraFrontendService.ListIndices"),
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=AWSKendraFrontendService.ListIndices");
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=AWSKendraFrontendService.ListIndices"
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=AWSKendraFrontendService.ListIndices")
.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=AWSKendraFrontendService.ListIndices"))
.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=AWSKendraFrontendService.ListIndices")
.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=AWSKendraFrontendService.ListIndices")
.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=AWSKendraFrontendService.ListIndices');
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=AWSKendraFrontendService.ListIndices',
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=AWSKendraFrontendService.ListIndices';
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=AWSKendraFrontendService.ListIndices',
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=AWSKendraFrontendService.ListIndices")
.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=AWSKendraFrontendService.ListIndices',
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=AWSKendraFrontendService.ListIndices');
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=AWSKendraFrontendService.ListIndices',
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=AWSKendraFrontendService.ListIndices';
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=AWSKendraFrontendService.ListIndices"]
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=AWSKendraFrontendService.ListIndices" 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=AWSKendraFrontendService.ListIndices",
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=AWSKendraFrontendService.ListIndices', [
'body' => '{
"NextToken": "",
"MaxResults": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListIndices');
$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=AWSKendraFrontendService.ListIndices');
$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=AWSKendraFrontendService.ListIndices' -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=AWSKendraFrontendService.ListIndices' -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=AWSKendraFrontendService.ListIndices"
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=AWSKendraFrontendService.ListIndices"
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=AWSKendraFrontendService.ListIndices")
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=AWSKendraFrontendService.ListIndices";
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=AWSKendraFrontendService.ListIndices' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"NextToken": "",
"MaxResults": ""
}'
echo '{
"NextToken": "",
"MaxResults": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListIndices' \
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=AWSKendraFrontendService.ListIndices'
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=AWSKendraFrontendService.ListIndices")! 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
ListQuerySuggestionsBlockLists
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListQuerySuggestionsBlockLists
HEADERS
X-Amz-Target
BODY json
{
"IndexId": "",
"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=AWSKendraFrontendService.ListQuerySuggestionsBlockLists");
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 \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListQuerySuggestionsBlockLists" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IndexId ""
:NextToken ""
:MaxResults ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListQuerySuggestionsBlockLists"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListQuerySuggestionsBlockLists"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListQuerySuggestionsBlockLists");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListQuerySuggestionsBlockLists"
payload := strings.NewReader("{\n \"IndexId\": \"\",\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: 58
{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListQuerySuggestionsBlockLists")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListQuerySuggestionsBlockLists"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IndexId\": \"\",\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 \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListQuerySuggestionsBlockLists")
.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=AWSKendraFrontendService.ListQuerySuggestionsBlockLists")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.asString();
const data = JSON.stringify({
IndexId: '',
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=AWSKendraFrontendService.ListQuerySuggestionsBlockLists');
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=AWSKendraFrontendService.ListQuerySuggestionsBlockLists',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListQuerySuggestionsBlockLists';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","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=AWSKendraFrontendService.ListQuerySuggestionsBlockLists',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IndexId": "",\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 \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListQuerySuggestionsBlockLists")
.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({IndexId: '', NextToken: '', MaxResults: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListQuerySuggestionsBlockLists',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {IndexId: '', 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=AWSKendraFrontendService.ListQuerySuggestionsBlockLists');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IndexId: '',
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=AWSKendraFrontendService.ListQuerySuggestionsBlockLists',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', 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=AWSKendraFrontendService.ListQuerySuggestionsBlockLists';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","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 = @{ @"IndexId": @"",
@"NextToken": @"",
@"MaxResults": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListQuerySuggestionsBlockLists"]
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=AWSKendraFrontendService.ListQuerySuggestionsBlockLists" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListQuerySuggestionsBlockLists",
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([
'IndexId' => '',
'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=AWSKendraFrontendService.ListQuerySuggestionsBlockLists', [
'body' => '{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListQuerySuggestionsBlockLists');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IndexId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IndexId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListQuerySuggestionsBlockLists');
$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=AWSKendraFrontendService.ListQuerySuggestionsBlockLists' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListQuerySuggestionsBlockLists' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListQuerySuggestionsBlockLists"
payload = {
"IndexId": "",
"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=AWSKendraFrontendService.ListQuerySuggestionsBlockLists"
payload <- "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListQuerySuggestionsBlockLists")
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 \"IndexId\": \"\",\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 \"IndexId\": \"\",\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=AWSKendraFrontendService.ListQuerySuggestionsBlockLists";
let payload = json!({
"IndexId": "",
"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=AWSKendraFrontendService.ListQuerySuggestionsBlockLists' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}'
echo '{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListQuerySuggestionsBlockLists' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IndexId": "",\n "NextToken": "",\n "MaxResults": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListQuerySuggestionsBlockLists'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"IndexId": "",
"NextToken": "",
"MaxResults": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListQuerySuggestionsBlockLists")! 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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.ListTagsForResource" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ResourceARN ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.ListTagsForResource', [
'body' => '{
"ResourceARN": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.ListTagsForResource' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ResourceARN": ""
}'
echo '{
"ResourceARN": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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
ListThesauri
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListThesauri
HEADERS
X-Amz-Target
BODY json
{
"IndexId": "",
"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=AWSKendraFrontendService.ListThesauri");
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 \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListThesauri" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IndexId ""
:NextToken ""
:MaxResults ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListThesauri"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListThesauri"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListThesauri");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListThesauri"
payload := strings.NewReader("{\n \"IndexId\": \"\",\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: 58
{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListThesauri")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListThesauri"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IndexId\": \"\",\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 \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListThesauri")
.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=AWSKendraFrontendService.ListThesauri")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
.asString();
const data = JSON.stringify({
IndexId: '',
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=AWSKendraFrontendService.ListThesauri');
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=AWSKendraFrontendService.ListThesauri',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', NextToken: '', MaxResults: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListThesauri';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","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=AWSKendraFrontendService.ListThesauri',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IndexId": "",\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 \"IndexId\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListThesauri")
.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({IndexId: '', NextToken: '', MaxResults: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListThesauri',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {IndexId: '', 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=AWSKendraFrontendService.ListThesauri');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IndexId: '',
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=AWSKendraFrontendService.ListThesauri',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', 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=AWSKendraFrontendService.ListThesauri';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","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 = @{ @"IndexId": @"",
@"NextToken": @"",
@"MaxResults": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListThesauri"]
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=AWSKendraFrontendService.ListThesauri" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListThesauri",
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([
'IndexId' => '',
'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=AWSKendraFrontendService.ListThesauri', [
'body' => '{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListThesauri');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IndexId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IndexId' => '',
'NextToken' => '',
'MaxResults' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListThesauri');
$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=AWSKendraFrontendService.ListThesauri' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListThesauri' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListThesauri"
payload = {
"IndexId": "",
"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=AWSKendraFrontendService.ListThesauri"
payload <- "{\n \"IndexId\": \"\",\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=AWSKendraFrontendService.ListThesauri")
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 \"IndexId\": \"\",\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 \"IndexId\": \"\",\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=AWSKendraFrontendService.ListThesauri";
let payload = json!({
"IndexId": "",
"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=AWSKendraFrontendService.ListThesauri' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}'
echo '{
"IndexId": "",
"NextToken": "",
"MaxResults": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListThesauri' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IndexId": "",\n "NextToken": "",\n "MaxResults": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListThesauri'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"IndexId": "",
"NextToken": "",
"MaxResults": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.ListThesauri")! 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
PutPrincipalMapping
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.PutPrincipalMapping
HEADERS
X-Amz-Target
BODY json
{
"IndexId": "",
"DataSourceId": "",
"GroupId": "",
"GroupMembers": "",
"OrderingId": "",
"RoleArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.PutPrincipalMapping");
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 \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"GroupId\": \"\",\n \"GroupMembers\": \"\",\n \"OrderingId\": \"\",\n \"RoleArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.PutPrincipalMapping" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IndexId ""
:DataSourceId ""
:GroupId ""
:GroupMembers ""
:OrderingId ""
:RoleArn ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.PutPrincipalMapping"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"GroupId\": \"\",\n \"GroupMembers\": \"\",\n \"OrderingId\": \"\",\n \"RoleArn\": \"\"\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=AWSKendraFrontendService.PutPrincipalMapping"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"GroupId\": \"\",\n \"GroupMembers\": \"\",\n \"OrderingId\": \"\",\n \"RoleArn\": \"\"\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=AWSKendraFrontendService.PutPrincipalMapping");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"GroupId\": \"\",\n \"GroupMembers\": \"\",\n \"OrderingId\": \"\",\n \"RoleArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.PutPrincipalMapping"
payload := strings.NewReader("{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"GroupId\": \"\",\n \"GroupMembers\": \"\",\n \"OrderingId\": \"\",\n \"RoleArn\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 117
{
"IndexId": "",
"DataSourceId": "",
"GroupId": "",
"GroupMembers": "",
"OrderingId": "",
"RoleArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.PutPrincipalMapping")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"GroupId\": \"\",\n \"GroupMembers\": \"\",\n \"OrderingId\": \"\",\n \"RoleArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.PutPrincipalMapping"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"GroupId\": \"\",\n \"GroupMembers\": \"\",\n \"OrderingId\": \"\",\n \"RoleArn\": \"\"\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 \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"GroupId\": \"\",\n \"GroupMembers\": \"\",\n \"OrderingId\": \"\",\n \"RoleArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.PutPrincipalMapping")
.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=AWSKendraFrontendService.PutPrincipalMapping")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"GroupId\": \"\",\n \"GroupMembers\": \"\",\n \"OrderingId\": \"\",\n \"RoleArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
IndexId: '',
DataSourceId: '',
GroupId: '',
GroupMembers: '',
OrderingId: '',
RoleArn: ''
});
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=AWSKendraFrontendService.PutPrincipalMapping');
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=AWSKendraFrontendService.PutPrincipalMapping',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
IndexId: '',
DataSourceId: '',
GroupId: '',
GroupMembers: '',
OrderingId: '',
RoleArn: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.PutPrincipalMapping';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","DataSourceId":"","GroupId":"","GroupMembers":"","OrderingId":"","RoleArn":""}'
};
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=AWSKendraFrontendService.PutPrincipalMapping',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IndexId": "",\n "DataSourceId": "",\n "GroupId": "",\n "GroupMembers": "",\n "OrderingId": "",\n "RoleArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"GroupId\": \"\",\n \"GroupMembers\": \"\",\n \"OrderingId\": \"\",\n \"RoleArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.PutPrincipalMapping")
.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({
IndexId: '',
DataSourceId: '',
GroupId: '',
GroupMembers: '',
OrderingId: '',
RoleArn: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.PutPrincipalMapping',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
IndexId: '',
DataSourceId: '',
GroupId: '',
GroupMembers: '',
OrderingId: '',
RoleArn: ''
},
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=AWSKendraFrontendService.PutPrincipalMapping');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IndexId: '',
DataSourceId: '',
GroupId: '',
GroupMembers: '',
OrderingId: '',
RoleArn: ''
});
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=AWSKendraFrontendService.PutPrincipalMapping',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
IndexId: '',
DataSourceId: '',
GroupId: '',
GroupMembers: '',
OrderingId: '',
RoleArn: ''
}
};
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=AWSKendraFrontendService.PutPrincipalMapping';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","DataSourceId":"","GroupId":"","GroupMembers":"","OrderingId":"","RoleArn":""}'
};
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 = @{ @"IndexId": @"",
@"DataSourceId": @"",
@"GroupId": @"",
@"GroupMembers": @"",
@"OrderingId": @"",
@"RoleArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.PutPrincipalMapping"]
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=AWSKendraFrontendService.PutPrincipalMapping" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"GroupId\": \"\",\n \"GroupMembers\": \"\",\n \"OrderingId\": \"\",\n \"RoleArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.PutPrincipalMapping",
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([
'IndexId' => '',
'DataSourceId' => '',
'GroupId' => '',
'GroupMembers' => '',
'OrderingId' => '',
'RoleArn' => ''
]),
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=AWSKendraFrontendService.PutPrincipalMapping', [
'body' => '{
"IndexId": "",
"DataSourceId": "",
"GroupId": "",
"GroupMembers": "",
"OrderingId": "",
"RoleArn": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.PutPrincipalMapping');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IndexId' => '',
'DataSourceId' => '',
'GroupId' => '',
'GroupMembers' => '',
'OrderingId' => '',
'RoleArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IndexId' => '',
'DataSourceId' => '',
'GroupId' => '',
'GroupMembers' => '',
'OrderingId' => '',
'RoleArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.PutPrincipalMapping');
$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=AWSKendraFrontendService.PutPrincipalMapping' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"DataSourceId": "",
"GroupId": "",
"GroupMembers": "",
"OrderingId": "",
"RoleArn": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.PutPrincipalMapping' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"DataSourceId": "",
"GroupId": "",
"GroupMembers": "",
"OrderingId": "",
"RoleArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"GroupId\": \"\",\n \"GroupMembers\": \"\",\n \"OrderingId\": \"\",\n \"RoleArn\": \"\"\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=AWSKendraFrontendService.PutPrincipalMapping"
payload = {
"IndexId": "",
"DataSourceId": "",
"GroupId": "",
"GroupMembers": "",
"OrderingId": "",
"RoleArn": ""
}
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=AWSKendraFrontendService.PutPrincipalMapping"
payload <- "{\n \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"GroupId\": \"\",\n \"GroupMembers\": \"\",\n \"OrderingId\": \"\",\n \"RoleArn\": \"\"\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=AWSKendraFrontendService.PutPrincipalMapping")
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 \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"GroupId\": \"\",\n \"GroupMembers\": \"\",\n \"OrderingId\": \"\",\n \"RoleArn\": \"\"\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 \"IndexId\": \"\",\n \"DataSourceId\": \"\",\n \"GroupId\": \"\",\n \"GroupMembers\": \"\",\n \"OrderingId\": \"\",\n \"RoleArn\": \"\"\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=AWSKendraFrontendService.PutPrincipalMapping";
let payload = json!({
"IndexId": "",
"DataSourceId": "",
"GroupId": "",
"GroupMembers": "",
"OrderingId": "",
"RoleArn": ""
});
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=AWSKendraFrontendService.PutPrincipalMapping' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IndexId": "",
"DataSourceId": "",
"GroupId": "",
"GroupMembers": "",
"OrderingId": "",
"RoleArn": ""
}'
echo '{
"IndexId": "",
"DataSourceId": "",
"GroupId": "",
"GroupMembers": "",
"OrderingId": "",
"RoleArn": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.PutPrincipalMapping' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IndexId": "",\n "DataSourceId": "",\n "GroupId": "",\n "GroupMembers": "",\n "OrderingId": "",\n "RoleArn": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.PutPrincipalMapping'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"IndexId": "",
"DataSourceId": "",
"GroupId": "",
"GroupMembers": "",
"OrderingId": "",
"RoleArn": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.PutPrincipalMapping")! 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
Query
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.Query
HEADERS
X-Amz-Target
BODY json
{
"IndexId": "",
"QueryText": "",
"AttributeFilter": "",
"Facets": "",
"RequestedDocumentAttributes": "",
"QueryResultTypeFilter": "",
"DocumentRelevanceOverrideConfigurations": "",
"PageNumber": "",
"PageSize": "",
"SortingConfiguration": "",
"UserContext": "",
"VisitorId": "",
"SpellCorrectionConfiguration": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.Query");
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 \"IndexId\": \"\",\n \"QueryText\": \"\",\n \"AttributeFilter\": \"\",\n \"Facets\": \"\",\n \"RequestedDocumentAttributes\": \"\",\n \"QueryResultTypeFilter\": \"\",\n \"DocumentRelevanceOverrideConfigurations\": \"\",\n \"PageNumber\": \"\",\n \"PageSize\": \"\",\n \"SortingConfiguration\": \"\",\n \"UserContext\": \"\",\n \"VisitorId\": \"\",\n \"SpellCorrectionConfiguration\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.Query" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IndexId ""
:QueryText ""
:AttributeFilter ""
:Facets ""
:RequestedDocumentAttributes ""
:QueryResultTypeFilter ""
:DocumentRelevanceOverrideConfigurations ""
:PageNumber ""
:PageSize ""
:SortingConfiguration ""
:UserContext ""
:VisitorId ""
:SpellCorrectionConfiguration ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.Query"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IndexId\": \"\",\n \"QueryText\": \"\",\n \"AttributeFilter\": \"\",\n \"Facets\": \"\",\n \"RequestedDocumentAttributes\": \"\",\n \"QueryResultTypeFilter\": \"\",\n \"DocumentRelevanceOverrideConfigurations\": \"\",\n \"PageNumber\": \"\",\n \"PageSize\": \"\",\n \"SortingConfiguration\": \"\",\n \"UserContext\": \"\",\n \"VisitorId\": \"\",\n \"SpellCorrectionConfiguration\": \"\"\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=AWSKendraFrontendService.Query"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IndexId\": \"\",\n \"QueryText\": \"\",\n \"AttributeFilter\": \"\",\n \"Facets\": \"\",\n \"RequestedDocumentAttributes\": \"\",\n \"QueryResultTypeFilter\": \"\",\n \"DocumentRelevanceOverrideConfigurations\": \"\",\n \"PageNumber\": \"\",\n \"PageSize\": \"\",\n \"SortingConfiguration\": \"\",\n \"UserContext\": \"\",\n \"VisitorId\": \"\",\n \"SpellCorrectionConfiguration\": \"\"\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=AWSKendraFrontendService.Query");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IndexId\": \"\",\n \"QueryText\": \"\",\n \"AttributeFilter\": \"\",\n \"Facets\": \"\",\n \"RequestedDocumentAttributes\": \"\",\n \"QueryResultTypeFilter\": \"\",\n \"DocumentRelevanceOverrideConfigurations\": \"\",\n \"PageNumber\": \"\",\n \"PageSize\": \"\",\n \"SortingConfiguration\": \"\",\n \"UserContext\": \"\",\n \"VisitorId\": \"\",\n \"SpellCorrectionConfiguration\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.Query"
payload := strings.NewReader("{\n \"IndexId\": \"\",\n \"QueryText\": \"\",\n \"AttributeFilter\": \"\",\n \"Facets\": \"\",\n \"RequestedDocumentAttributes\": \"\",\n \"QueryResultTypeFilter\": \"\",\n \"DocumentRelevanceOverrideConfigurations\": \"\",\n \"PageNumber\": \"\",\n \"PageSize\": \"\",\n \"SortingConfiguration\": \"\",\n \"UserContext\": \"\",\n \"VisitorId\": \"\",\n \"SpellCorrectionConfiguration\": \"\"\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: 342
{
"IndexId": "",
"QueryText": "",
"AttributeFilter": "",
"Facets": "",
"RequestedDocumentAttributes": "",
"QueryResultTypeFilter": "",
"DocumentRelevanceOverrideConfigurations": "",
"PageNumber": "",
"PageSize": "",
"SortingConfiguration": "",
"UserContext": "",
"VisitorId": "",
"SpellCorrectionConfiguration": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.Query")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IndexId\": \"\",\n \"QueryText\": \"\",\n \"AttributeFilter\": \"\",\n \"Facets\": \"\",\n \"RequestedDocumentAttributes\": \"\",\n \"QueryResultTypeFilter\": \"\",\n \"DocumentRelevanceOverrideConfigurations\": \"\",\n \"PageNumber\": \"\",\n \"PageSize\": \"\",\n \"SortingConfiguration\": \"\",\n \"UserContext\": \"\",\n \"VisitorId\": \"\",\n \"SpellCorrectionConfiguration\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.Query"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IndexId\": \"\",\n \"QueryText\": \"\",\n \"AttributeFilter\": \"\",\n \"Facets\": \"\",\n \"RequestedDocumentAttributes\": \"\",\n \"QueryResultTypeFilter\": \"\",\n \"DocumentRelevanceOverrideConfigurations\": \"\",\n \"PageNumber\": \"\",\n \"PageSize\": \"\",\n \"SortingConfiguration\": \"\",\n \"UserContext\": \"\",\n \"VisitorId\": \"\",\n \"SpellCorrectionConfiguration\": \"\"\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 \"IndexId\": \"\",\n \"QueryText\": \"\",\n \"AttributeFilter\": \"\",\n \"Facets\": \"\",\n \"RequestedDocumentAttributes\": \"\",\n \"QueryResultTypeFilter\": \"\",\n \"DocumentRelevanceOverrideConfigurations\": \"\",\n \"PageNumber\": \"\",\n \"PageSize\": \"\",\n \"SortingConfiguration\": \"\",\n \"UserContext\": \"\",\n \"VisitorId\": \"\",\n \"SpellCorrectionConfiguration\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.Query")
.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=AWSKendraFrontendService.Query")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IndexId\": \"\",\n \"QueryText\": \"\",\n \"AttributeFilter\": \"\",\n \"Facets\": \"\",\n \"RequestedDocumentAttributes\": \"\",\n \"QueryResultTypeFilter\": \"\",\n \"DocumentRelevanceOverrideConfigurations\": \"\",\n \"PageNumber\": \"\",\n \"PageSize\": \"\",\n \"SortingConfiguration\": \"\",\n \"UserContext\": \"\",\n \"VisitorId\": \"\",\n \"SpellCorrectionConfiguration\": \"\"\n}")
.asString();
const data = JSON.stringify({
IndexId: '',
QueryText: '',
AttributeFilter: '',
Facets: '',
RequestedDocumentAttributes: '',
QueryResultTypeFilter: '',
DocumentRelevanceOverrideConfigurations: '',
PageNumber: '',
PageSize: '',
SortingConfiguration: '',
UserContext: '',
VisitorId: '',
SpellCorrectionConfiguration: ''
});
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=AWSKendraFrontendService.Query');
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=AWSKendraFrontendService.Query',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
IndexId: '',
QueryText: '',
AttributeFilter: '',
Facets: '',
RequestedDocumentAttributes: '',
QueryResultTypeFilter: '',
DocumentRelevanceOverrideConfigurations: '',
PageNumber: '',
PageSize: '',
SortingConfiguration: '',
UserContext: '',
VisitorId: '',
SpellCorrectionConfiguration: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.Query';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","QueryText":"","AttributeFilter":"","Facets":"","RequestedDocumentAttributes":"","QueryResultTypeFilter":"","DocumentRelevanceOverrideConfigurations":"","PageNumber":"","PageSize":"","SortingConfiguration":"","UserContext":"","VisitorId":"","SpellCorrectionConfiguration":""}'
};
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=AWSKendraFrontendService.Query',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IndexId": "",\n "QueryText": "",\n "AttributeFilter": "",\n "Facets": "",\n "RequestedDocumentAttributes": "",\n "QueryResultTypeFilter": "",\n "DocumentRelevanceOverrideConfigurations": "",\n "PageNumber": "",\n "PageSize": "",\n "SortingConfiguration": "",\n "UserContext": "",\n "VisitorId": "",\n "SpellCorrectionConfiguration": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"IndexId\": \"\",\n \"QueryText\": \"\",\n \"AttributeFilter\": \"\",\n \"Facets\": \"\",\n \"RequestedDocumentAttributes\": \"\",\n \"QueryResultTypeFilter\": \"\",\n \"DocumentRelevanceOverrideConfigurations\": \"\",\n \"PageNumber\": \"\",\n \"PageSize\": \"\",\n \"SortingConfiguration\": \"\",\n \"UserContext\": \"\",\n \"VisitorId\": \"\",\n \"SpellCorrectionConfiguration\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.Query")
.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({
IndexId: '',
QueryText: '',
AttributeFilter: '',
Facets: '',
RequestedDocumentAttributes: '',
QueryResultTypeFilter: '',
DocumentRelevanceOverrideConfigurations: '',
PageNumber: '',
PageSize: '',
SortingConfiguration: '',
UserContext: '',
VisitorId: '',
SpellCorrectionConfiguration: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.Query',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
IndexId: '',
QueryText: '',
AttributeFilter: '',
Facets: '',
RequestedDocumentAttributes: '',
QueryResultTypeFilter: '',
DocumentRelevanceOverrideConfigurations: '',
PageNumber: '',
PageSize: '',
SortingConfiguration: '',
UserContext: '',
VisitorId: '',
SpellCorrectionConfiguration: ''
},
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=AWSKendraFrontendService.Query');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IndexId: '',
QueryText: '',
AttributeFilter: '',
Facets: '',
RequestedDocumentAttributes: '',
QueryResultTypeFilter: '',
DocumentRelevanceOverrideConfigurations: '',
PageNumber: '',
PageSize: '',
SortingConfiguration: '',
UserContext: '',
VisitorId: '',
SpellCorrectionConfiguration: ''
});
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=AWSKendraFrontendService.Query',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
IndexId: '',
QueryText: '',
AttributeFilter: '',
Facets: '',
RequestedDocumentAttributes: '',
QueryResultTypeFilter: '',
DocumentRelevanceOverrideConfigurations: '',
PageNumber: '',
PageSize: '',
SortingConfiguration: '',
UserContext: '',
VisitorId: '',
SpellCorrectionConfiguration: ''
}
};
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=AWSKendraFrontendService.Query';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","QueryText":"","AttributeFilter":"","Facets":"","RequestedDocumentAttributes":"","QueryResultTypeFilter":"","DocumentRelevanceOverrideConfigurations":"","PageNumber":"","PageSize":"","SortingConfiguration":"","UserContext":"","VisitorId":"","SpellCorrectionConfiguration":""}'
};
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 = @{ @"IndexId": @"",
@"QueryText": @"",
@"AttributeFilter": @"",
@"Facets": @"",
@"RequestedDocumentAttributes": @"",
@"QueryResultTypeFilter": @"",
@"DocumentRelevanceOverrideConfigurations": @"",
@"PageNumber": @"",
@"PageSize": @"",
@"SortingConfiguration": @"",
@"UserContext": @"",
@"VisitorId": @"",
@"SpellCorrectionConfiguration": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.Query"]
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=AWSKendraFrontendService.Query" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IndexId\": \"\",\n \"QueryText\": \"\",\n \"AttributeFilter\": \"\",\n \"Facets\": \"\",\n \"RequestedDocumentAttributes\": \"\",\n \"QueryResultTypeFilter\": \"\",\n \"DocumentRelevanceOverrideConfigurations\": \"\",\n \"PageNumber\": \"\",\n \"PageSize\": \"\",\n \"SortingConfiguration\": \"\",\n \"UserContext\": \"\",\n \"VisitorId\": \"\",\n \"SpellCorrectionConfiguration\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.Query",
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([
'IndexId' => '',
'QueryText' => '',
'AttributeFilter' => '',
'Facets' => '',
'RequestedDocumentAttributes' => '',
'QueryResultTypeFilter' => '',
'DocumentRelevanceOverrideConfigurations' => '',
'PageNumber' => '',
'PageSize' => '',
'SortingConfiguration' => '',
'UserContext' => '',
'VisitorId' => '',
'SpellCorrectionConfiguration' => ''
]),
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=AWSKendraFrontendService.Query', [
'body' => '{
"IndexId": "",
"QueryText": "",
"AttributeFilter": "",
"Facets": "",
"RequestedDocumentAttributes": "",
"QueryResultTypeFilter": "",
"DocumentRelevanceOverrideConfigurations": "",
"PageNumber": "",
"PageSize": "",
"SortingConfiguration": "",
"UserContext": "",
"VisitorId": "",
"SpellCorrectionConfiguration": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.Query');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IndexId' => '',
'QueryText' => '',
'AttributeFilter' => '',
'Facets' => '',
'RequestedDocumentAttributes' => '',
'QueryResultTypeFilter' => '',
'DocumentRelevanceOverrideConfigurations' => '',
'PageNumber' => '',
'PageSize' => '',
'SortingConfiguration' => '',
'UserContext' => '',
'VisitorId' => '',
'SpellCorrectionConfiguration' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IndexId' => '',
'QueryText' => '',
'AttributeFilter' => '',
'Facets' => '',
'RequestedDocumentAttributes' => '',
'QueryResultTypeFilter' => '',
'DocumentRelevanceOverrideConfigurations' => '',
'PageNumber' => '',
'PageSize' => '',
'SortingConfiguration' => '',
'UserContext' => '',
'VisitorId' => '',
'SpellCorrectionConfiguration' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.Query');
$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=AWSKendraFrontendService.Query' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"QueryText": "",
"AttributeFilter": "",
"Facets": "",
"RequestedDocumentAttributes": "",
"QueryResultTypeFilter": "",
"DocumentRelevanceOverrideConfigurations": "",
"PageNumber": "",
"PageSize": "",
"SortingConfiguration": "",
"UserContext": "",
"VisitorId": "",
"SpellCorrectionConfiguration": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.Query' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"QueryText": "",
"AttributeFilter": "",
"Facets": "",
"RequestedDocumentAttributes": "",
"QueryResultTypeFilter": "",
"DocumentRelevanceOverrideConfigurations": "",
"PageNumber": "",
"PageSize": "",
"SortingConfiguration": "",
"UserContext": "",
"VisitorId": "",
"SpellCorrectionConfiguration": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IndexId\": \"\",\n \"QueryText\": \"\",\n \"AttributeFilter\": \"\",\n \"Facets\": \"\",\n \"RequestedDocumentAttributes\": \"\",\n \"QueryResultTypeFilter\": \"\",\n \"DocumentRelevanceOverrideConfigurations\": \"\",\n \"PageNumber\": \"\",\n \"PageSize\": \"\",\n \"SortingConfiguration\": \"\",\n \"UserContext\": \"\",\n \"VisitorId\": \"\",\n \"SpellCorrectionConfiguration\": \"\"\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=AWSKendraFrontendService.Query"
payload = {
"IndexId": "",
"QueryText": "",
"AttributeFilter": "",
"Facets": "",
"RequestedDocumentAttributes": "",
"QueryResultTypeFilter": "",
"DocumentRelevanceOverrideConfigurations": "",
"PageNumber": "",
"PageSize": "",
"SortingConfiguration": "",
"UserContext": "",
"VisitorId": "",
"SpellCorrectionConfiguration": ""
}
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=AWSKendraFrontendService.Query"
payload <- "{\n \"IndexId\": \"\",\n \"QueryText\": \"\",\n \"AttributeFilter\": \"\",\n \"Facets\": \"\",\n \"RequestedDocumentAttributes\": \"\",\n \"QueryResultTypeFilter\": \"\",\n \"DocumentRelevanceOverrideConfigurations\": \"\",\n \"PageNumber\": \"\",\n \"PageSize\": \"\",\n \"SortingConfiguration\": \"\",\n \"UserContext\": \"\",\n \"VisitorId\": \"\",\n \"SpellCorrectionConfiguration\": \"\"\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=AWSKendraFrontendService.Query")
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 \"IndexId\": \"\",\n \"QueryText\": \"\",\n \"AttributeFilter\": \"\",\n \"Facets\": \"\",\n \"RequestedDocumentAttributes\": \"\",\n \"QueryResultTypeFilter\": \"\",\n \"DocumentRelevanceOverrideConfigurations\": \"\",\n \"PageNumber\": \"\",\n \"PageSize\": \"\",\n \"SortingConfiguration\": \"\",\n \"UserContext\": \"\",\n \"VisitorId\": \"\",\n \"SpellCorrectionConfiguration\": \"\"\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 \"IndexId\": \"\",\n \"QueryText\": \"\",\n \"AttributeFilter\": \"\",\n \"Facets\": \"\",\n \"RequestedDocumentAttributes\": \"\",\n \"QueryResultTypeFilter\": \"\",\n \"DocumentRelevanceOverrideConfigurations\": \"\",\n \"PageNumber\": \"\",\n \"PageSize\": \"\",\n \"SortingConfiguration\": \"\",\n \"UserContext\": \"\",\n \"VisitorId\": \"\",\n \"SpellCorrectionConfiguration\": \"\"\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=AWSKendraFrontendService.Query";
let payload = json!({
"IndexId": "",
"QueryText": "",
"AttributeFilter": "",
"Facets": "",
"RequestedDocumentAttributes": "",
"QueryResultTypeFilter": "",
"DocumentRelevanceOverrideConfigurations": "",
"PageNumber": "",
"PageSize": "",
"SortingConfiguration": "",
"UserContext": "",
"VisitorId": "",
"SpellCorrectionConfiguration": ""
});
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=AWSKendraFrontendService.Query' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IndexId": "",
"QueryText": "",
"AttributeFilter": "",
"Facets": "",
"RequestedDocumentAttributes": "",
"QueryResultTypeFilter": "",
"DocumentRelevanceOverrideConfigurations": "",
"PageNumber": "",
"PageSize": "",
"SortingConfiguration": "",
"UserContext": "",
"VisitorId": "",
"SpellCorrectionConfiguration": ""
}'
echo '{
"IndexId": "",
"QueryText": "",
"AttributeFilter": "",
"Facets": "",
"RequestedDocumentAttributes": "",
"QueryResultTypeFilter": "",
"DocumentRelevanceOverrideConfigurations": "",
"PageNumber": "",
"PageSize": "",
"SortingConfiguration": "",
"UserContext": "",
"VisitorId": "",
"SpellCorrectionConfiguration": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.Query' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IndexId": "",\n "QueryText": "",\n "AttributeFilter": "",\n "Facets": "",\n "RequestedDocumentAttributes": "",\n "QueryResultTypeFilter": "",\n "DocumentRelevanceOverrideConfigurations": "",\n "PageNumber": "",\n "PageSize": "",\n "SortingConfiguration": "",\n "UserContext": "",\n "VisitorId": "",\n "SpellCorrectionConfiguration": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.Query'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"IndexId": "",
"QueryText": "",
"AttributeFilter": "",
"Facets": "",
"RequestedDocumentAttributes": "",
"QueryResultTypeFilter": "",
"DocumentRelevanceOverrideConfigurations": "",
"PageNumber": "",
"PageSize": "",
"SortingConfiguration": "",
"UserContext": "",
"VisitorId": "",
"SpellCorrectionConfiguration": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.Query")! 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
StartDataSourceSyncJob
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.StartDataSourceSyncJob
HEADERS
X-Amz-Target
BODY json
{
"Id": "",
"IndexId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.StartDataSourceSyncJob");
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 \"Id\": \"\",\n \"IndexId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.StartDataSourceSyncJob" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Id ""
:IndexId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.StartDataSourceSyncJob"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.StartDataSourceSyncJob"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.StartDataSourceSyncJob");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.StartDataSourceSyncJob"
payload := strings.NewReader("{\n \"Id\": \"\",\n \"IndexId\": \"\"\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: 31
{
"Id": "",
"IndexId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.StartDataSourceSyncJob")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.StartDataSourceSyncJob"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Id\": \"\",\n \"IndexId\": \"\"\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 \"Id\": \"\",\n \"IndexId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.StartDataSourceSyncJob")
.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=AWSKendraFrontendService.StartDataSourceSyncJob")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}")
.asString();
const data = JSON.stringify({
Id: '',
IndexId: ''
});
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=AWSKendraFrontendService.StartDataSourceSyncJob');
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=AWSKendraFrontendService.StartDataSourceSyncJob',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Id: '', IndexId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.StartDataSourceSyncJob';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","IndexId":""}'
};
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=AWSKendraFrontendService.StartDataSourceSyncJob',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Id": "",\n "IndexId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.StartDataSourceSyncJob")
.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({Id: '', IndexId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.StartDataSourceSyncJob',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Id: '', IndexId: ''},
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=AWSKendraFrontendService.StartDataSourceSyncJob');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Id: '',
IndexId: ''
});
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=AWSKendraFrontendService.StartDataSourceSyncJob',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Id: '', IndexId: ''}
};
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=AWSKendraFrontendService.StartDataSourceSyncJob';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","IndexId":""}'
};
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 = @{ @"Id": @"",
@"IndexId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.StartDataSourceSyncJob"]
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=AWSKendraFrontendService.StartDataSourceSyncJob" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.StartDataSourceSyncJob",
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([
'Id' => '',
'IndexId' => ''
]),
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=AWSKendraFrontendService.StartDataSourceSyncJob', [
'body' => '{
"Id": "",
"IndexId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.StartDataSourceSyncJob');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Id' => '',
'IndexId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Id' => '',
'IndexId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.StartDataSourceSyncJob');
$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=AWSKendraFrontendService.StartDataSourceSyncJob' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"IndexId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.StartDataSourceSyncJob' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"IndexId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.StartDataSourceSyncJob"
payload = {
"Id": "",
"IndexId": ""
}
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=AWSKendraFrontendService.StartDataSourceSyncJob"
payload <- "{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.StartDataSourceSyncJob")
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 \"Id\": \"\",\n \"IndexId\": \"\"\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 \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.StartDataSourceSyncJob";
let payload = json!({
"Id": "",
"IndexId": ""
});
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=AWSKendraFrontendService.StartDataSourceSyncJob' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Id": "",
"IndexId": ""
}'
echo '{
"Id": "",
"IndexId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.StartDataSourceSyncJob' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Id": "",\n "IndexId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.StartDataSourceSyncJob'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Id": "",
"IndexId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.StartDataSourceSyncJob")! 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
StopDataSourceSyncJob
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.StopDataSourceSyncJob
HEADERS
X-Amz-Target
BODY json
{
"Id": "",
"IndexId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.StopDataSourceSyncJob");
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 \"Id\": \"\",\n \"IndexId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.StopDataSourceSyncJob" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Id ""
:IndexId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.StopDataSourceSyncJob"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.StopDataSourceSyncJob"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.StopDataSourceSyncJob");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.StopDataSourceSyncJob"
payload := strings.NewReader("{\n \"Id\": \"\",\n \"IndexId\": \"\"\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: 31
{
"Id": "",
"IndexId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.StopDataSourceSyncJob")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.StopDataSourceSyncJob"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Id\": \"\",\n \"IndexId\": \"\"\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 \"Id\": \"\",\n \"IndexId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.StopDataSourceSyncJob")
.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=AWSKendraFrontendService.StopDataSourceSyncJob")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}")
.asString();
const data = JSON.stringify({
Id: '',
IndexId: ''
});
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=AWSKendraFrontendService.StopDataSourceSyncJob');
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=AWSKendraFrontendService.StopDataSourceSyncJob',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Id: '', IndexId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.StopDataSourceSyncJob';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","IndexId":""}'
};
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=AWSKendraFrontendService.StopDataSourceSyncJob',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Id": "",\n "IndexId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.StopDataSourceSyncJob")
.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({Id: '', IndexId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.StopDataSourceSyncJob',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Id: '', IndexId: ''},
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=AWSKendraFrontendService.StopDataSourceSyncJob');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Id: '',
IndexId: ''
});
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=AWSKendraFrontendService.StopDataSourceSyncJob',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Id: '', IndexId: ''}
};
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=AWSKendraFrontendService.StopDataSourceSyncJob';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","IndexId":""}'
};
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 = @{ @"Id": @"",
@"IndexId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.StopDataSourceSyncJob"]
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=AWSKendraFrontendService.StopDataSourceSyncJob" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Id\": \"\",\n \"IndexId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.StopDataSourceSyncJob",
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([
'Id' => '',
'IndexId' => ''
]),
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=AWSKendraFrontendService.StopDataSourceSyncJob', [
'body' => '{
"Id": "",
"IndexId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.StopDataSourceSyncJob');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Id' => '',
'IndexId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Id' => '',
'IndexId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.StopDataSourceSyncJob');
$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=AWSKendraFrontendService.StopDataSourceSyncJob' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"IndexId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.StopDataSourceSyncJob' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"IndexId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.StopDataSourceSyncJob"
payload = {
"Id": "",
"IndexId": ""
}
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=AWSKendraFrontendService.StopDataSourceSyncJob"
payload <- "{\n \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.StopDataSourceSyncJob")
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 \"Id\": \"\",\n \"IndexId\": \"\"\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 \"Id\": \"\",\n \"IndexId\": \"\"\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=AWSKendraFrontendService.StopDataSourceSyncJob";
let payload = json!({
"Id": "",
"IndexId": ""
});
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=AWSKendraFrontendService.StopDataSourceSyncJob' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Id": "",
"IndexId": ""
}'
echo '{
"Id": "",
"IndexId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.StopDataSourceSyncJob' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Id": "",\n "IndexId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.StopDataSourceSyncJob'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Id": "",
"IndexId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.StopDataSourceSyncJob")! 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
SubmitFeedback
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.SubmitFeedback
HEADERS
X-Amz-Target
BODY json
{
"IndexId": "",
"QueryId": "",
"ClickFeedbackItems": "",
"RelevanceFeedbackItems": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.SubmitFeedback");
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 \"IndexId\": \"\",\n \"QueryId\": \"\",\n \"ClickFeedbackItems\": \"\",\n \"RelevanceFeedbackItems\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.SubmitFeedback" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IndexId ""
:QueryId ""
:ClickFeedbackItems ""
:RelevanceFeedbackItems ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.SubmitFeedback"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IndexId\": \"\",\n \"QueryId\": \"\",\n \"ClickFeedbackItems\": \"\",\n \"RelevanceFeedbackItems\": \"\"\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=AWSKendraFrontendService.SubmitFeedback"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IndexId\": \"\",\n \"QueryId\": \"\",\n \"ClickFeedbackItems\": \"\",\n \"RelevanceFeedbackItems\": \"\"\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=AWSKendraFrontendService.SubmitFeedback");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IndexId\": \"\",\n \"QueryId\": \"\",\n \"ClickFeedbackItems\": \"\",\n \"RelevanceFeedbackItems\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.SubmitFeedback"
payload := strings.NewReader("{\n \"IndexId\": \"\",\n \"QueryId\": \"\",\n \"ClickFeedbackItems\": \"\",\n \"RelevanceFeedbackItems\": \"\"\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: 96
{
"IndexId": "",
"QueryId": "",
"ClickFeedbackItems": "",
"RelevanceFeedbackItems": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.SubmitFeedback")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IndexId\": \"\",\n \"QueryId\": \"\",\n \"ClickFeedbackItems\": \"\",\n \"RelevanceFeedbackItems\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.SubmitFeedback"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IndexId\": \"\",\n \"QueryId\": \"\",\n \"ClickFeedbackItems\": \"\",\n \"RelevanceFeedbackItems\": \"\"\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 \"IndexId\": \"\",\n \"QueryId\": \"\",\n \"ClickFeedbackItems\": \"\",\n \"RelevanceFeedbackItems\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.SubmitFeedback")
.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=AWSKendraFrontendService.SubmitFeedback")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IndexId\": \"\",\n \"QueryId\": \"\",\n \"ClickFeedbackItems\": \"\",\n \"RelevanceFeedbackItems\": \"\"\n}")
.asString();
const data = JSON.stringify({
IndexId: '',
QueryId: '',
ClickFeedbackItems: '',
RelevanceFeedbackItems: ''
});
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=AWSKendraFrontendService.SubmitFeedback');
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=AWSKendraFrontendService.SubmitFeedback',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', QueryId: '', ClickFeedbackItems: '', RelevanceFeedbackItems: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.SubmitFeedback';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","QueryId":"","ClickFeedbackItems":"","RelevanceFeedbackItems":""}'
};
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=AWSKendraFrontendService.SubmitFeedback',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IndexId": "",\n "QueryId": "",\n "ClickFeedbackItems": "",\n "RelevanceFeedbackItems": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"IndexId\": \"\",\n \"QueryId\": \"\",\n \"ClickFeedbackItems\": \"\",\n \"RelevanceFeedbackItems\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.SubmitFeedback")
.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({IndexId: '', QueryId: '', ClickFeedbackItems: '', RelevanceFeedbackItems: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.SubmitFeedback',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {IndexId: '', QueryId: '', ClickFeedbackItems: '', RelevanceFeedbackItems: ''},
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=AWSKendraFrontendService.SubmitFeedback');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IndexId: '',
QueryId: '',
ClickFeedbackItems: '',
RelevanceFeedbackItems: ''
});
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=AWSKendraFrontendService.SubmitFeedback',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', QueryId: '', ClickFeedbackItems: '', RelevanceFeedbackItems: ''}
};
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=AWSKendraFrontendService.SubmitFeedback';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","QueryId":"","ClickFeedbackItems":"","RelevanceFeedbackItems":""}'
};
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 = @{ @"IndexId": @"",
@"QueryId": @"",
@"ClickFeedbackItems": @"",
@"RelevanceFeedbackItems": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.SubmitFeedback"]
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=AWSKendraFrontendService.SubmitFeedback" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IndexId\": \"\",\n \"QueryId\": \"\",\n \"ClickFeedbackItems\": \"\",\n \"RelevanceFeedbackItems\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.SubmitFeedback",
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([
'IndexId' => '',
'QueryId' => '',
'ClickFeedbackItems' => '',
'RelevanceFeedbackItems' => ''
]),
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=AWSKendraFrontendService.SubmitFeedback', [
'body' => '{
"IndexId": "",
"QueryId": "",
"ClickFeedbackItems": "",
"RelevanceFeedbackItems": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.SubmitFeedback');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IndexId' => '',
'QueryId' => '',
'ClickFeedbackItems' => '',
'RelevanceFeedbackItems' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IndexId' => '',
'QueryId' => '',
'ClickFeedbackItems' => '',
'RelevanceFeedbackItems' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.SubmitFeedback');
$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=AWSKendraFrontendService.SubmitFeedback' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"QueryId": "",
"ClickFeedbackItems": "",
"RelevanceFeedbackItems": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.SubmitFeedback' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"QueryId": "",
"ClickFeedbackItems": "",
"RelevanceFeedbackItems": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IndexId\": \"\",\n \"QueryId\": \"\",\n \"ClickFeedbackItems\": \"\",\n \"RelevanceFeedbackItems\": \"\"\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=AWSKendraFrontendService.SubmitFeedback"
payload = {
"IndexId": "",
"QueryId": "",
"ClickFeedbackItems": "",
"RelevanceFeedbackItems": ""
}
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=AWSKendraFrontendService.SubmitFeedback"
payload <- "{\n \"IndexId\": \"\",\n \"QueryId\": \"\",\n \"ClickFeedbackItems\": \"\",\n \"RelevanceFeedbackItems\": \"\"\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=AWSKendraFrontendService.SubmitFeedback")
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 \"IndexId\": \"\",\n \"QueryId\": \"\",\n \"ClickFeedbackItems\": \"\",\n \"RelevanceFeedbackItems\": \"\"\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 \"IndexId\": \"\",\n \"QueryId\": \"\",\n \"ClickFeedbackItems\": \"\",\n \"RelevanceFeedbackItems\": \"\"\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=AWSKendraFrontendService.SubmitFeedback";
let payload = json!({
"IndexId": "",
"QueryId": "",
"ClickFeedbackItems": "",
"RelevanceFeedbackItems": ""
});
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=AWSKendraFrontendService.SubmitFeedback' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IndexId": "",
"QueryId": "",
"ClickFeedbackItems": "",
"RelevanceFeedbackItems": ""
}'
echo '{
"IndexId": "",
"QueryId": "",
"ClickFeedbackItems": "",
"RelevanceFeedbackItems": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.SubmitFeedback' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IndexId": "",\n "QueryId": "",\n "ClickFeedbackItems": "",\n "RelevanceFeedbackItems": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.SubmitFeedback'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"IndexId": "",
"QueryId": "",
"ClickFeedbackItems": "",
"RelevanceFeedbackItems": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.SubmitFeedback")! 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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.TagResource" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ResourceARN ""
:Tags ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.TagResource', [
'body' => '{
"ResourceARN": "",
"Tags": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.TagResource' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ResourceARN": "",
"Tags": ""
}'
echo '{
"ResourceARN": "",
"Tags": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.TagResource")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
UntagResource
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.UntagResource" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ResourceARN ""
:TagKeys ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.UntagResource', [
'body' => '{
"ResourceARN": "",
"TagKeys": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.UntagResource' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ResourceARN": "",
"TagKeys": ""
}'
echo '{
"ResourceARN": "",
"TagKeys": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.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=AWSKendraFrontendService.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=AWSKendraFrontendService.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
UpdateAccessControlConfiguration
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateAccessControlConfiguration
HEADERS
X-Amz-Target
BODY json
{
"IndexId": "",
"Id": "",
"Name": "",
"Description": "",
"AccessControlList": "",
"HierarchicalAccessControlList": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateAccessControlConfiguration");
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 \"IndexId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"AccessControlList\": \"\",\n \"HierarchicalAccessControlList\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateAccessControlConfiguration" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IndexId ""
:Id ""
:Name ""
:Description ""
:AccessControlList ""
:HierarchicalAccessControlList ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateAccessControlConfiguration"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IndexId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"AccessControlList\": \"\",\n \"HierarchicalAccessControlList\": \"\"\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=AWSKendraFrontendService.UpdateAccessControlConfiguration"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IndexId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"AccessControlList\": \"\",\n \"HierarchicalAccessControlList\": \"\"\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=AWSKendraFrontendService.UpdateAccessControlConfiguration");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IndexId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"AccessControlList\": \"\",\n \"HierarchicalAccessControlList\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateAccessControlConfiguration"
payload := strings.NewReader("{\n \"IndexId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"AccessControlList\": \"\",\n \"HierarchicalAccessControlList\": \"\"\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: 132
{
"IndexId": "",
"Id": "",
"Name": "",
"Description": "",
"AccessControlList": "",
"HierarchicalAccessControlList": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateAccessControlConfiguration")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IndexId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"AccessControlList\": \"\",\n \"HierarchicalAccessControlList\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateAccessControlConfiguration"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IndexId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"AccessControlList\": \"\",\n \"HierarchicalAccessControlList\": \"\"\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 \"IndexId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"AccessControlList\": \"\",\n \"HierarchicalAccessControlList\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateAccessControlConfiguration")
.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=AWSKendraFrontendService.UpdateAccessControlConfiguration")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IndexId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"AccessControlList\": \"\",\n \"HierarchicalAccessControlList\": \"\"\n}")
.asString();
const data = JSON.stringify({
IndexId: '',
Id: '',
Name: '',
Description: '',
AccessControlList: '',
HierarchicalAccessControlList: ''
});
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=AWSKendraFrontendService.UpdateAccessControlConfiguration');
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=AWSKendraFrontendService.UpdateAccessControlConfiguration',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
IndexId: '',
Id: '',
Name: '',
Description: '',
AccessControlList: '',
HierarchicalAccessControlList: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateAccessControlConfiguration';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","Id":"","Name":"","Description":"","AccessControlList":"","HierarchicalAccessControlList":""}'
};
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=AWSKendraFrontendService.UpdateAccessControlConfiguration',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IndexId": "",\n "Id": "",\n "Name": "",\n "Description": "",\n "AccessControlList": "",\n "HierarchicalAccessControlList": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"IndexId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"AccessControlList\": \"\",\n \"HierarchicalAccessControlList\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateAccessControlConfiguration")
.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({
IndexId: '',
Id: '',
Name: '',
Description: '',
AccessControlList: '',
HierarchicalAccessControlList: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateAccessControlConfiguration',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
IndexId: '',
Id: '',
Name: '',
Description: '',
AccessControlList: '',
HierarchicalAccessControlList: ''
},
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=AWSKendraFrontendService.UpdateAccessControlConfiguration');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IndexId: '',
Id: '',
Name: '',
Description: '',
AccessControlList: '',
HierarchicalAccessControlList: ''
});
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=AWSKendraFrontendService.UpdateAccessControlConfiguration',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
IndexId: '',
Id: '',
Name: '',
Description: '',
AccessControlList: '',
HierarchicalAccessControlList: ''
}
};
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=AWSKendraFrontendService.UpdateAccessControlConfiguration';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","Id":"","Name":"","Description":"","AccessControlList":"","HierarchicalAccessControlList":""}'
};
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 = @{ @"IndexId": @"",
@"Id": @"",
@"Name": @"",
@"Description": @"",
@"AccessControlList": @"",
@"HierarchicalAccessControlList": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateAccessControlConfiguration"]
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=AWSKendraFrontendService.UpdateAccessControlConfiguration" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IndexId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"AccessControlList\": \"\",\n \"HierarchicalAccessControlList\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateAccessControlConfiguration",
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([
'IndexId' => '',
'Id' => '',
'Name' => '',
'Description' => '',
'AccessControlList' => '',
'HierarchicalAccessControlList' => ''
]),
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=AWSKendraFrontendService.UpdateAccessControlConfiguration', [
'body' => '{
"IndexId": "",
"Id": "",
"Name": "",
"Description": "",
"AccessControlList": "",
"HierarchicalAccessControlList": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateAccessControlConfiguration');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IndexId' => '',
'Id' => '',
'Name' => '',
'Description' => '',
'AccessControlList' => '',
'HierarchicalAccessControlList' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IndexId' => '',
'Id' => '',
'Name' => '',
'Description' => '',
'AccessControlList' => '',
'HierarchicalAccessControlList' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateAccessControlConfiguration');
$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=AWSKendraFrontendService.UpdateAccessControlConfiguration' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"Id": "",
"Name": "",
"Description": "",
"AccessControlList": "",
"HierarchicalAccessControlList": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateAccessControlConfiguration' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"Id": "",
"Name": "",
"Description": "",
"AccessControlList": "",
"HierarchicalAccessControlList": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IndexId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"AccessControlList\": \"\",\n \"HierarchicalAccessControlList\": \"\"\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=AWSKendraFrontendService.UpdateAccessControlConfiguration"
payload = {
"IndexId": "",
"Id": "",
"Name": "",
"Description": "",
"AccessControlList": "",
"HierarchicalAccessControlList": ""
}
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=AWSKendraFrontendService.UpdateAccessControlConfiguration"
payload <- "{\n \"IndexId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"AccessControlList\": \"\",\n \"HierarchicalAccessControlList\": \"\"\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=AWSKendraFrontendService.UpdateAccessControlConfiguration")
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 \"IndexId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"AccessControlList\": \"\",\n \"HierarchicalAccessControlList\": \"\"\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 \"IndexId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"AccessControlList\": \"\",\n \"HierarchicalAccessControlList\": \"\"\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=AWSKendraFrontendService.UpdateAccessControlConfiguration";
let payload = json!({
"IndexId": "",
"Id": "",
"Name": "",
"Description": "",
"AccessControlList": "",
"HierarchicalAccessControlList": ""
});
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=AWSKendraFrontendService.UpdateAccessControlConfiguration' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IndexId": "",
"Id": "",
"Name": "",
"Description": "",
"AccessControlList": "",
"HierarchicalAccessControlList": ""
}'
echo '{
"IndexId": "",
"Id": "",
"Name": "",
"Description": "",
"AccessControlList": "",
"HierarchicalAccessControlList": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateAccessControlConfiguration' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IndexId": "",\n "Id": "",\n "Name": "",\n "Description": "",\n "AccessControlList": "",\n "HierarchicalAccessControlList": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateAccessControlConfiguration'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"IndexId": "",
"Id": "",
"Name": "",
"Description": "",
"AccessControlList": "",
"HierarchicalAccessControlList": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateAccessControlConfiguration")! 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
UpdateDataSource
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateDataSource
HEADERS
X-Amz-Target
BODY json
{
"Id": "",
"Name": "",
"IndexId": "",
"Configuration": "",
"VpcConfiguration": "",
"Description": "",
"Schedule": "",
"RoleArn": "",
"LanguageCode": "",
"CustomDocumentEnrichmentConfiguration": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateDataSource");
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 \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Configuration\": \"\",\n \"VpcConfiguration\": \"\",\n \"Description\": \"\",\n \"Schedule\": \"\",\n \"RoleArn\": \"\",\n \"LanguageCode\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateDataSource" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Id ""
:Name ""
:IndexId ""
:Configuration ""
:VpcConfiguration ""
:Description ""
:Schedule ""
:RoleArn ""
:LanguageCode ""
:CustomDocumentEnrichmentConfiguration ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateDataSource"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Configuration\": \"\",\n \"VpcConfiguration\": \"\",\n \"Description\": \"\",\n \"Schedule\": \"\",\n \"RoleArn\": \"\",\n \"LanguageCode\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\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=AWSKendraFrontendService.UpdateDataSource"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Configuration\": \"\",\n \"VpcConfiguration\": \"\",\n \"Description\": \"\",\n \"Schedule\": \"\",\n \"RoleArn\": \"\",\n \"LanguageCode\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\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=AWSKendraFrontendService.UpdateDataSource");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Configuration\": \"\",\n \"VpcConfiguration\": \"\",\n \"Description\": \"\",\n \"Schedule\": \"\",\n \"RoleArn\": \"\",\n \"LanguageCode\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateDataSource"
payload := strings.NewReader("{\n \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Configuration\": \"\",\n \"VpcConfiguration\": \"\",\n \"Description\": \"\",\n \"Schedule\": \"\",\n \"RoleArn\": \"\",\n \"LanguageCode\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\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: 219
{
"Id": "",
"Name": "",
"IndexId": "",
"Configuration": "",
"VpcConfiguration": "",
"Description": "",
"Schedule": "",
"RoleArn": "",
"LanguageCode": "",
"CustomDocumentEnrichmentConfiguration": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateDataSource")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Configuration\": \"\",\n \"VpcConfiguration\": \"\",\n \"Description\": \"\",\n \"Schedule\": \"\",\n \"RoleArn\": \"\",\n \"LanguageCode\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateDataSource"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Configuration\": \"\",\n \"VpcConfiguration\": \"\",\n \"Description\": \"\",\n \"Schedule\": \"\",\n \"RoleArn\": \"\",\n \"LanguageCode\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\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 \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Configuration\": \"\",\n \"VpcConfiguration\": \"\",\n \"Description\": \"\",\n \"Schedule\": \"\",\n \"RoleArn\": \"\",\n \"LanguageCode\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateDataSource")
.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=AWSKendraFrontendService.UpdateDataSource")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Configuration\": \"\",\n \"VpcConfiguration\": \"\",\n \"Description\": \"\",\n \"Schedule\": \"\",\n \"RoleArn\": \"\",\n \"LanguageCode\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\n}")
.asString();
const data = JSON.stringify({
Id: '',
Name: '',
IndexId: '',
Configuration: '',
VpcConfiguration: '',
Description: '',
Schedule: '',
RoleArn: '',
LanguageCode: '',
CustomDocumentEnrichmentConfiguration: ''
});
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=AWSKendraFrontendService.UpdateDataSource');
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=AWSKendraFrontendService.UpdateDataSource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Id: '',
Name: '',
IndexId: '',
Configuration: '',
VpcConfiguration: '',
Description: '',
Schedule: '',
RoleArn: '',
LanguageCode: '',
CustomDocumentEnrichmentConfiguration: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateDataSource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","Name":"","IndexId":"","Configuration":"","VpcConfiguration":"","Description":"","Schedule":"","RoleArn":"","LanguageCode":"","CustomDocumentEnrichmentConfiguration":""}'
};
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=AWSKendraFrontendService.UpdateDataSource',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Id": "",\n "Name": "",\n "IndexId": "",\n "Configuration": "",\n "VpcConfiguration": "",\n "Description": "",\n "Schedule": "",\n "RoleArn": "",\n "LanguageCode": "",\n "CustomDocumentEnrichmentConfiguration": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Configuration\": \"\",\n \"VpcConfiguration\": \"\",\n \"Description\": \"\",\n \"Schedule\": \"\",\n \"RoleArn\": \"\",\n \"LanguageCode\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateDataSource")
.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({
Id: '',
Name: '',
IndexId: '',
Configuration: '',
VpcConfiguration: '',
Description: '',
Schedule: '',
RoleArn: '',
LanguageCode: '',
CustomDocumentEnrichmentConfiguration: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateDataSource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
Id: '',
Name: '',
IndexId: '',
Configuration: '',
VpcConfiguration: '',
Description: '',
Schedule: '',
RoleArn: '',
LanguageCode: '',
CustomDocumentEnrichmentConfiguration: ''
},
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=AWSKendraFrontendService.UpdateDataSource');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Id: '',
Name: '',
IndexId: '',
Configuration: '',
VpcConfiguration: '',
Description: '',
Schedule: '',
RoleArn: '',
LanguageCode: '',
CustomDocumentEnrichmentConfiguration: ''
});
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=AWSKendraFrontendService.UpdateDataSource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Id: '',
Name: '',
IndexId: '',
Configuration: '',
VpcConfiguration: '',
Description: '',
Schedule: '',
RoleArn: '',
LanguageCode: '',
CustomDocumentEnrichmentConfiguration: ''
}
};
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=AWSKendraFrontendService.UpdateDataSource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","Name":"","IndexId":"","Configuration":"","VpcConfiguration":"","Description":"","Schedule":"","RoleArn":"","LanguageCode":"","CustomDocumentEnrichmentConfiguration":""}'
};
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 = @{ @"Id": @"",
@"Name": @"",
@"IndexId": @"",
@"Configuration": @"",
@"VpcConfiguration": @"",
@"Description": @"",
@"Schedule": @"",
@"RoleArn": @"",
@"LanguageCode": @"",
@"CustomDocumentEnrichmentConfiguration": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateDataSource"]
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=AWSKendraFrontendService.UpdateDataSource" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Configuration\": \"\",\n \"VpcConfiguration\": \"\",\n \"Description\": \"\",\n \"Schedule\": \"\",\n \"RoleArn\": \"\",\n \"LanguageCode\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateDataSource",
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([
'Id' => '',
'Name' => '',
'IndexId' => '',
'Configuration' => '',
'VpcConfiguration' => '',
'Description' => '',
'Schedule' => '',
'RoleArn' => '',
'LanguageCode' => '',
'CustomDocumentEnrichmentConfiguration' => ''
]),
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=AWSKendraFrontendService.UpdateDataSource', [
'body' => '{
"Id": "",
"Name": "",
"IndexId": "",
"Configuration": "",
"VpcConfiguration": "",
"Description": "",
"Schedule": "",
"RoleArn": "",
"LanguageCode": "",
"CustomDocumentEnrichmentConfiguration": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateDataSource');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Id' => '',
'Name' => '',
'IndexId' => '',
'Configuration' => '',
'VpcConfiguration' => '',
'Description' => '',
'Schedule' => '',
'RoleArn' => '',
'LanguageCode' => '',
'CustomDocumentEnrichmentConfiguration' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Id' => '',
'Name' => '',
'IndexId' => '',
'Configuration' => '',
'VpcConfiguration' => '',
'Description' => '',
'Schedule' => '',
'RoleArn' => '',
'LanguageCode' => '',
'CustomDocumentEnrichmentConfiguration' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateDataSource');
$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=AWSKendraFrontendService.UpdateDataSource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"Name": "",
"IndexId": "",
"Configuration": "",
"VpcConfiguration": "",
"Description": "",
"Schedule": "",
"RoleArn": "",
"LanguageCode": "",
"CustomDocumentEnrichmentConfiguration": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateDataSource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"Name": "",
"IndexId": "",
"Configuration": "",
"VpcConfiguration": "",
"Description": "",
"Schedule": "",
"RoleArn": "",
"LanguageCode": "",
"CustomDocumentEnrichmentConfiguration": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Configuration\": \"\",\n \"VpcConfiguration\": \"\",\n \"Description\": \"\",\n \"Schedule\": \"\",\n \"RoleArn\": \"\",\n \"LanguageCode\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\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=AWSKendraFrontendService.UpdateDataSource"
payload = {
"Id": "",
"Name": "",
"IndexId": "",
"Configuration": "",
"VpcConfiguration": "",
"Description": "",
"Schedule": "",
"RoleArn": "",
"LanguageCode": "",
"CustomDocumentEnrichmentConfiguration": ""
}
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=AWSKendraFrontendService.UpdateDataSource"
payload <- "{\n \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Configuration\": \"\",\n \"VpcConfiguration\": \"\",\n \"Description\": \"\",\n \"Schedule\": \"\",\n \"RoleArn\": \"\",\n \"LanguageCode\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\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=AWSKendraFrontendService.UpdateDataSource")
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 \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Configuration\": \"\",\n \"VpcConfiguration\": \"\",\n \"Description\": \"\",\n \"Schedule\": \"\",\n \"RoleArn\": \"\",\n \"LanguageCode\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\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 \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Configuration\": \"\",\n \"VpcConfiguration\": \"\",\n \"Description\": \"\",\n \"Schedule\": \"\",\n \"RoleArn\": \"\",\n \"LanguageCode\": \"\",\n \"CustomDocumentEnrichmentConfiguration\": \"\"\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=AWSKendraFrontendService.UpdateDataSource";
let payload = json!({
"Id": "",
"Name": "",
"IndexId": "",
"Configuration": "",
"VpcConfiguration": "",
"Description": "",
"Schedule": "",
"RoleArn": "",
"LanguageCode": "",
"CustomDocumentEnrichmentConfiguration": ""
});
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=AWSKendraFrontendService.UpdateDataSource' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Id": "",
"Name": "",
"IndexId": "",
"Configuration": "",
"VpcConfiguration": "",
"Description": "",
"Schedule": "",
"RoleArn": "",
"LanguageCode": "",
"CustomDocumentEnrichmentConfiguration": ""
}'
echo '{
"Id": "",
"Name": "",
"IndexId": "",
"Configuration": "",
"VpcConfiguration": "",
"Description": "",
"Schedule": "",
"RoleArn": "",
"LanguageCode": "",
"CustomDocumentEnrichmentConfiguration": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateDataSource' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Id": "",\n "Name": "",\n "IndexId": "",\n "Configuration": "",\n "VpcConfiguration": "",\n "Description": "",\n "Schedule": "",\n "RoleArn": "",\n "LanguageCode": "",\n "CustomDocumentEnrichmentConfiguration": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateDataSource'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Id": "",
"Name": "",
"IndexId": "",
"Configuration": "",
"VpcConfiguration": "",
"Description": "",
"Schedule": "",
"RoleArn": "",
"LanguageCode": "",
"CustomDocumentEnrichmentConfiguration": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateDataSource")! 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
UpdateExperience
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateExperience
HEADERS
X-Amz-Target
BODY json
{
"Id": "",
"Name": "",
"IndexId": "",
"RoleArn": "",
"Configuration": "",
"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=AWSKendraFrontendService.UpdateExperience");
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 \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Configuration\": \"\",\n \"Description\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateExperience" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Id ""
:Name ""
:IndexId ""
:RoleArn ""
:Configuration ""
:Description ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateExperience"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Configuration\": \"\",\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=AWSKendraFrontendService.UpdateExperience"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Configuration\": \"\",\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=AWSKendraFrontendService.UpdateExperience");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Configuration\": \"\",\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=AWSKendraFrontendService.UpdateExperience"
payload := strings.NewReader("{\n \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Configuration\": \"\",\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: 106
{
"Id": "",
"Name": "",
"IndexId": "",
"RoleArn": "",
"Configuration": "",
"Description": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateExperience")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Configuration\": \"\",\n \"Description\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateExperience"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Configuration\": \"\",\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 \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Configuration\": \"\",\n \"Description\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateExperience")
.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=AWSKendraFrontendService.UpdateExperience")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Configuration\": \"\",\n \"Description\": \"\"\n}")
.asString();
const data = JSON.stringify({
Id: '',
Name: '',
IndexId: '',
RoleArn: '',
Configuration: '',
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=AWSKendraFrontendService.UpdateExperience');
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=AWSKendraFrontendService.UpdateExperience',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Id: '', Name: '', IndexId: '', RoleArn: '', Configuration: '', Description: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateExperience';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","Name":"","IndexId":"","RoleArn":"","Configuration":"","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=AWSKendraFrontendService.UpdateExperience',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Id": "",\n "Name": "",\n "IndexId": "",\n "RoleArn": "",\n "Configuration": "",\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 \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Configuration\": \"\",\n \"Description\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateExperience")
.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({Id: '', Name: '', IndexId: '', RoleArn: '', Configuration: '', Description: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateExperience',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Id: '', Name: '', IndexId: '', RoleArn: '', Configuration: '', 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=AWSKendraFrontendService.UpdateExperience');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Id: '',
Name: '',
IndexId: '',
RoleArn: '',
Configuration: '',
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=AWSKendraFrontendService.UpdateExperience',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Id: '', Name: '', IndexId: '', RoleArn: '', Configuration: '', 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=AWSKendraFrontendService.UpdateExperience';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","Name":"","IndexId":"","RoleArn":"","Configuration":"","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 = @{ @"Id": @"",
@"Name": @"",
@"IndexId": @"",
@"RoleArn": @"",
@"Configuration": @"",
@"Description": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateExperience"]
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=AWSKendraFrontendService.UpdateExperience" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Configuration\": \"\",\n \"Description\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateExperience",
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([
'Id' => '',
'Name' => '',
'IndexId' => '',
'RoleArn' => '',
'Configuration' => '',
'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=AWSKendraFrontendService.UpdateExperience', [
'body' => '{
"Id": "",
"Name": "",
"IndexId": "",
"RoleArn": "",
"Configuration": "",
"Description": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateExperience');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Id' => '',
'Name' => '',
'IndexId' => '',
'RoleArn' => '',
'Configuration' => '',
'Description' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Id' => '',
'Name' => '',
'IndexId' => '',
'RoleArn' => '',
'Configuration' => '',
'Description' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateExperience');
$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=AWSKendraFrontendService.UpdateExperience' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"Name": "",
"IndexId": "",
"RoleArn": "",
"Configuration": "",
"Description": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateExperience' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"Name": "",
"IndexId": "",
"RoleArn": "",
"Configuration": "",
"Description": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Configuration\": \"\",\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=AWSKendraFrontendService.UpdateExperience"
payload = {
"Id": "",
"Name": "",
"IndexId": "",
"RoleArn": "",
"Configuration": "",
"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=AWSKendraFrontendService.UpdateExperience"
payload <- "{\n \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Configuration\": \"\",\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=AWSKendraFrontendService.UpdateExperience")
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 \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Configuration\": \"\",\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 \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"RoleArn\": \"\",\n \"Configuration\": \"\",\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=AWSKendraFrontendService.UpdateExperience";
let payload = json!({
"Id": "",
"Name": "",
"IndexId": "",
"RoleArn": "",
"Configuration": "",
"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=AWSKendraFrontendService.UpdateExperience' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Id": "",
"Name": "",
"IndexId": "",
"RoleArn": "",
"Configuration": "",
"Description": ""
}'
echo '{
"Id": "",
"Name": "",
"IndexId": "",
"RoleArn": "",
"Configuration": "",
"Description": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateExperience' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Id": "",\n "Name": "",\n "IndexId": "",\n "RoleArn": "",\n "Configuration": "",\n "Description": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateExperience'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Id": "",
"Name": "",
"IndexId": "",
"RoleArn": "",
"Configuration": "",
"Description": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateExperience")! 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
UpdateFeaturedResultsSet
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateFeaturedResultsSet
HEADERS
X-Amz-Target
BODY json
{
"IndexId": "",
"FeaturedResultsSetId": "",
"FeaturedResultsSetName": "",
"Description": "",
"Status": "",
"QueryTexts": "",
"FeaturedDocuments": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateFeaturedResultsSet");
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 \"IndexId\": \"\",\n \"FeaturedResultsSetId\": \"\",\n \"FeaturedResultsSetName\": \"\",\n \"Description\": \"\",\n \"Status\": \"\",\n \"QueryTexts\": \"\",\n \"FeaturedDocuments\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateFeaturedResultsSet" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IndexId ""
:FeaturedResultsSetId ""
:FeaturedResultsSetName ""
:Description ""
:Status ""
:QueryTexts ""
:FeaturedDocuments ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateFeaturedResultsSet"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IndexId\": \"\",\n \"FeaturedResultsSetId\": \"\",\n \"FeaturedResultsSetName\": \"\",\n \"Description\": \"\",\n \"Status\": \"\",\n \"QueryTexts\": \"\",\n \"FeaturedDocuments\": \"\"\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=AWSKendraFrontendService.UpdateFeaturedResultsSet"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IndexId\": \"\",\n \"FeaturedResultsSetId\": \"\",\n \"FeaturedResultsSetName\": \"\",\n \"Description\": \"\",\n \"Status\": \"\",\n \"QueryTexts\": \"\",\n \"FeaturedDocuments\": \"\"\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=AWSKendraFrontendService.UpdateFeaturedResultsSet");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IndexId\": \"\",\n \"FeaturedResultsSetId\": \"\",\n \"FeaturedResultsSetName\": \"\",\n \"Description\": \"\",\n \"Status\": \"\",\n \"QueryTexts\": \"\",\n \"FeaturedDocuments\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateFeaturedResultsSet"
payload := strings.NewReader("{\n \"IndexId\": \"\",\n \"FeaturedResultsSetId\": \"\",\n \"FeaturedResultsSetName\": \"\",\n \"Description\": \"\",\n \"Status\": \"\",\n \"QueryTexts\": \"\",\n \"FeaturedDocuments\": \"\"\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: 165
{
"IndexId": "",
"FeaturedResultsSetId": "",
"FeaturedResultsSetName": "",
"Description": "",
"Status": "",
"QueryTexts": "",
"FeaturedDocuments": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateFeaturedResultsSet")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IndexId\": \"\",\n \"FeaturedResultsSetId\": \"\",\n \"FeaturedResultsSetName\": \"\",\n \"Description\": \"\",\n \"Status\": \"\",\n \"QueryTexts\": \"\",\n \"FeaturedDocuments\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateFeaturedResultsSet"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IndexId\": \"\",\n \"FeaturedResultsSetId\": \"\",\n \"FeaturedResultsSetName\": \"\",\n \"Description\": \"\",\n \"Status\": \"\",\n \"QueryTexts\": \"\",\n \"FeaturedDocuments\": \"\"\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 \"IndexId\": \"\",\n \"FeaturedResultsSetId\": \"\",\n \"FeaturedResultsSetName\": \"\",\n \"Description\": \"\",\n \"Status\": \"\",\n \"QueryTexts\": \"\",\n \"FeaturedDocuments\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateFeaturedResultsSet")
.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=AWSKendraFrontendService.UpdateFeaturedResultsSet")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IndexId\": \"\",\n \"FeaturedResultsSetId\": \"\",\n \"FeaturedResultsSetName\": \"\",\n \"Description\": \"\",\n \"Status\": \"\",\n \"QueryTexts\": \"\",\n \"FeaturedDocuments\": \"\"\n}")
.asString();
const data = JSON.stringify({
IndexId: '',
FeaturedResultsSetId: '',
FeaturedResultsSetName: '',
Description: '',
Status: '',
QueryTexts: '',
FeaturedDocuments: ''
});
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=AWSKendraFrontendService.UpdateFeaturedResultsSet');
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=AWSKendraFrontendService.UpdateFeaturedResultsSet',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
IndexId: '',
FeaturedResultsSetId: '',
FeaturedResultsSetName: '',
Description: '',
Status: '',
QueryTexts: '',
FeaturedDocuments: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateFeaturedResultsSet';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","FeaturedResultsSetId":"","FeaturedResultsSetName":"","Description":"","Status":"","QueryTexts":"","FeaturedDocuments":""}'
};
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=AWSKendraFrontendService.UpdateFeaturedResultsSet',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IndexId": "",\n "FeaturedResultsSetId": "",\n "FeaturedResultsSetName": "",\n "Description": "",\n "Status": "",\n "QueryTexts": "",\n "FeaturedDocuments": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"IndexId\": \"\",\n \"FeaturedResultsSetId\": \"\",\n \"FeaturedResultsSetName\": \"\",\n \"Description\": \"\",\n \"Status\": \"\",\n \"QueryTexts\": \"\",\n \"FeaturedDocuments\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateFeaturedResultsSet")
.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({
IndexId: '',
FeaturedResultsSetId: '',
FeaturedResultsSetName: '',
Description: '',
Status: '',
QueryTexts: '',
FeaturedDocuments: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateFeaturedResultsSet',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
IndexId: '',
FeaturedResultsSetId: '',
FeaturedResultsSetName: '',
Description: '',
Status: '',
QueryTexts: '',
FeaturedDocuments: ''
},
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=AWSKendraFrontendService.UpdateFeaturedResultsSet');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IndexId: '',
FeaturedResultsSetId: '',
FeaturedResultsSetName: '',
Description: '',
Status: '',
QueryTexts: '',
FeaturedDocuments: ''
});
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=AWSKendraFrontendService.UpdateFeaturedResultsSet',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
IndexId: '',
FeaturedResultsSetId: '',
FeaturedResultsSetName: '',
Description: '',
Status: '',
QueryTexts: '',
FeaturedDocuments: ''
}
};
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=AWSKendraFrontendService.UpdateFeaturedResultsSet';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","FeaturedResultsSetId":"","FeaturedResultsSetName":"","Description":"","Status":"","QueryTexts":"","FeaturedDocuments":""}'
};
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 = @{ @"IndexId": @"",
@"FeaturedResultsSetId": @"",
@"FeaturedResultsSetName": @"",
@"Description": @"",
@"Status": @"",
@"QueryTexts": @"",
@"FeaturedDocuments": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateFeaturedResultsSet"]
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=AWSKendraFrontendService.UpdateFeaturedResultsSet" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IndexId\": \"\",\n \"FeaturedResultsSetId\": \"\",\n \"FeaturedResultsSetName\": \"\",\n \"Description\": \"\",\n \"Status\": \"\",\n \"QueryTexts\": \"\",\n \"FeaturedDocuments\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateFeaturedResultsSet",
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([
'IndexId' => '',
'FeaturedResultsSetId' => '',
'FeaturedResultsSetName' => '',
'Description' => '',
'Status' => '',
'QueryTexts' => '',
'FeaturedDocuments' => ''
]),
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=AWSKendraFrontendService.UpdateFeaturedResultsSet', [
'body' => '{
"IndexId": "",
"FeaturedResultsSetId": "",
"FeaturedResultsSetName": "",
"Description": "",
"Status": "",
"QueryTexts": "",
"FeaturedDocuments": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateFeaturedResultsSet');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IndexId' => '',
'FeaturedResultsSetId' => '',
'FeaturedResultsSetName' => '',
'Description' => '',
'Status' => '',
'QueryTexts' => '',
'FeaturedDocuments' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IndexId' => '',
'FeaturedResultsSetId' => '',
'FeaturedResultsSetName' => '',
'Description' => '',
'Status' => '',
'QueryTexts' => '',
'FeaturedDocuments' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateFeaturedResultsSet');
$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=AWSKendraFrontendService.UpdateFeaturedResultsSet' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"FeaturedResultsSetId": "",
"FeaturedResultsSetName": "",
"Description": "",
"Status": "",
"QueryTexts": "",
"FeaturedDocuments": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateFeaturedResultsSet' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"FeaturedResultsSetId": "",
"FeaturedResultsSetName": "",
"Description": "",
"Status": "",
"QueryTexts": "",
"FeaturedDocuments": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IndexId\": \"\",\n \"FeaturedResultsSetId\": \"\",\n \"FeaturedResultsSetName\": \"\",\n \"Description\": \"\",\n \"Status\": \"\",\n \"QueryTexts\": \"\",\n \"FeaturedDocuments\": \"\"\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=AWSKendraFrontendService.UpdateFeaturedResultsSet"
payload = {
"IndexId": "",
"FeaturedResultsSetId": "",
"FeaturedResultsSetName": "",
"Description": "",
"Status": "",
"QueryTexts": "",
"FeaturedDocuments": ""
}
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=AWSKendraFrontendService.UpdateFeaturedResultsSet"
payload <- "{\n \"IndexId\": \"\",\n \"FeaturedResultsSetId\": \"\",\n \"FeaturedResultsSetName\": \"\",\n \"Description\": \"\",\n \"Status\": \"\",\n \"QueryTexts\": \"\",\n \"FeaturedDocuments\": \"\"\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=AWSKendraFrontendService.UpdateFeaturedResultsSet")
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 \"IndexId\": \"\",\n \"FeaturedResultsSetId\": \"\",\n \"FeaturedResultsSetName\": \"\",\n \"Description\": \"\",\n \"Status\": \"\",\n \"QueryTexts\": \"\",\n \"FeaturedDocuments\": \"\"\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 \"IndexId\": \"\",\n \"FeaturedResultsSetId\": \"\",\n \"FeaturedResultsSetName\": \"\",\n \"Description\": \"\",\n \"Status\": \"\",\n \"QueryTexts\": \"\",\n \"FeaturedDocuments\": \"\"\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=AWSKendraFrontendService.UpdateFeaturedResultsSet";
let payload = json!({
"IndexId": "",
"FeaturedResultsSetId": "",
"FeaturedResultsSetName": "",
"Description": "",
"Status": "",
"QueryTexts": "",
"FeaturedDocuments": ""
});
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=AWSKendraFrontendService.UpdateFeaturedResultsSet' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IndexId": "",
"FeaturedResultsSetId": "",
"FeaturedResultsSetName": "",
"Description": "",
"Status": "",
"QueryTexts": "",
"FeaturedDocuments": ""
}'
echo '{
"IndexId": "",
"FeaturedResultsSetId": "",
"FeaturedResultsSetName": "",
"Description": "",
"Status": "",
"QueryTexts": "",
"FeaturedDocuments": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateFeaturedResultsSet' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IndexId": "",\n "FeaturedResultsSetId": "",\n "FeaturedResultsSetName": "",\n "Description": "",\n "Status": "",\n "QueryTexts": "",\n "FeaturedDocuments": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateFeaturedResultsSet'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"IndexId": "",
"FeaturedResultsSetId": "",
"FeaturedResultsSetName": "",
"Description": "",
"Status": "",
"QueryTexts": "",
"FeaturedDocuments": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateFeaturedResultsSet")! 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
UpdateIndex
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateIndex
HEADERS
X-Amz-Target
BODY json
{
"Id": "",
"Name": "",
"RoleArn": "",
"Description": "",
"DocumentMetadataConfigurationUpdates": "",
"CapacityUnits": "",
"UserTokenConfigurations": "",
"UserContextPolicy": "",
"UserGroupResolutionConfiguration": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateIndex");
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 \"Id\": \"\",\n \"Name\": \"\",\n \"RoleArn\": \"\",\n \"Description\": \"\",\n \"DocumentMetadataConfigurationUpdates\": \"\",\n \"CapacityUnits\": \"\",\n \"UserTokenConfigurations\": \"\",\n \"UserContextPolicy\": \"\",\n \"UserGroupResolutionConfiguration\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateIndex" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Id ""
:Name ""
:RoleArn ""
:Description ""
:DocumentMetadataConfigurationUpdates ""
:CapacityUnits ""
:UserTokenConfigurations ""
:UserContextPolicy ""
:UserGroupResolutionConfiguration ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateIndex"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Id\": \"\",\n \"Name\": \"\",\n \"RoleArn\": \"\",\n \"Description\": \"\",\n \"DocumentMetadataConfigurationUpdates\": \"\",\n \"CapacityUnits\": \"\",\n \"UserTokenConfigurations\": \"\",\n \"UserContextPolicy\": \"\",\n \"UserGroupResolutionConfiguration\": \"\"\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=AWSKendraFrontendService.UpdateIndex"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Id\": \"\",\n \"Name\": \"\",\n \"RoleArn\": \"\",\n \"Description\": \"\",\n \"DocumentMetadataConfigurationUpdates\": \"\",\n \"CapacityUnits\": \"\",\n \"UserTokenConfigurations\": \"\",\n \"UserContextPolicy\": \"\",\n \"UserGroupResolutionConfiguration\": \"\"\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=AWSKendraFrontendService.UpdateIndex");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Id\": \"\",\n \"Name\": \"\",\n \"RoleArn\": \"\",\n \"Description\": \"\",\n \"DocumentMetadataConfigurationUpdates\": \"\",\n \"CapacityUnits\": \"\",\n \"UserTokenConfigurations\": \"\",\n \"UserContextPolicy\": \"\",\n \"UserGroupResolutionConfiguration\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateIndex"
payload := strings.NewReader("{\n \"Id\": \"\",\n \"Name\": \"\",\n \"RoleArn\": \"\",\n \"Description\": \"\",\n \"DocumentMetadataConfigurationUpdates\": \"\",\n \"CapacityUnits\": \"\",\n \"UserTokenConfigurations\": \"\",\n \"UserContextPolicy\": \"\",\n \"UserGroupResolutionConfiguration\": \"\"\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: 237
{
"Id": "",
"Name": "",
"RoleArn": "",
"Description": "",
"DocumentMetadataConfigurationUpdates": "",
"CapacityUnits": "",
"UserTokenConfigurations": "",
"UserContextPolicy": "",
"UserGroupResolutionConfiguration": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateIndex")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Id\": \"\",\n \"Name\": \"\",\n \"RoleArn\": \"\",\n \"Description\": \"\",\n \"DocumentMetadataConfigurationUpdates\": \"\",\n \"CapacityUnits\": \"\",\n \"UserTokenConfigurations\": \"\",\n \"UserContextPolicy\": \"\",\n \"UserGroupResolutionConfiguration\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateIndex"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Id\": \"\",\n \"Name\": \"\",\n \"RoleArn\": \"\",\n \"Description\": \"\",\n \"DocumentMetadataConfigurationUpdates\": \"\",\n \"CapacityUnits\": \"\",\n \"UserTokenConfigurations\": \"\",\n \"UserContextPolicy\": \"\",\n \"UserGroupResolutionConfiguration\": \"\"\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 \"Id\": \"\",\n \"Name\": \"\",\n \"RoleArn\": \"\",\n \"Description\": \"\",\n \"DocumentMetadataConfigurationUpdates\": \"\",\n \"CapacityUnits\": \"\",\n \"UserTokenConfigurations\": \"\",\n \"UserContextPolicy\": \"\",\n \"UserGroupResolutionConfiguration\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateIndex")
.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=AWSKendraFrontendService.UpdateIndex")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Id\": \"\",\n \"Name\": \"\",\n \"RoleArn\": \"\",\n \"Description\": \"\",\n \"DocumentMetadataConfigurationUpdates\": \"\",\n \"CapacityUnits\": \"\",\n \"UserTokenConfigurations\": \"\",\n \"UserContextPolicy\": \"\",\n \"UserGroupResolutionConfiguration\": \"\"\n}")
.asString();
const data = JSON.stringify({
Id: '',
Name: '',
RoleArn: '',
Description: '',
DocumentMetadataConfigurationUpdates: '',
CapacityUnits: '',
UserTokenConfigurations: '',
UserContextPolicy: '',
UserGroupResolutionConfiguration: ''
});
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=AWSKendraFrontendService.UpdateIndex');
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=AWSKendraFrontendService.UpdateIndex',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Id: '',
Name: '',
RoleArn: '',
Description: '',
DocumentMetadataConfigurationUpdates: '',
CapacityUnits: '',
UserTokenConfigurations: '',
UserContextPolicy: '',
UserGroupResolutionConfiguration: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateIndex';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","Name":"","RoleArn":"","Description":"","DocumentMetadataConfigurationUpdates":"","CapacityUnits":"","UserTokenConfigurations":"","UserContextPolicy":"","UserGroupResolutionConfiguration":""}'
};
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=AWSKendraFrontendService.UpdateIndex',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Id": "",\n "Name": "",\n "RoleArn": "",\n "Description": "",\n "DocumentMetadataConfigurationUpdates": "",\n "CapacityUnits": "",\n "UserTokenConfigurations": "",\n "UserContextPolicy": "",\n "UserGroupResolutionConfiguration": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Id\": \"\",\n \"Name\": \"\",\n \"RoleArn\": \"\",\n \"Description\": \"\",\n \"DocumentMetadataConfigurationUpdates\": \"\",\n \"CapacityUnits\": \"\",\n \"UserTokenConfigurations\": \"\",\n \"UserContextPolicy\": \"\",\n \"UserGroupResolutionConfiguration\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateIndex")
.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({
Id: '',
Name: '',
RoleArn: '',
Description: '',
DocumentMetadataConfigurationUpdates: '',
CapacityUnits: '',
UserTokenConfigurations: '',
UserContextPolicy: '',
UserGroupResolutionConfiguration: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateIndex',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
Id: '',
Name: '',
RoleArn: '',
Description: '',
DocumentMetadataConfigurationUpdates: '',
CapacityUnits: '',
UserTokenConfigurations: '',
UserContextPolicy: '',
UserGroupResolutionConfiguration: ''
},
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=AWSKendraFrontendService.UpdateIndex');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Id: '',
Name: '',
RoleArn: '',
Description: '',
DocumentMetadataConfigurationUpdates: '',
CapacityUnits: '',
UserTokenConfigurations: '',
UserContextPolicy: '',
UserGroupResolutionConfiguration: ''
});
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=AWSKendraFrontendService.UpdateIndex',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Id: '',
Name: '',
RoleArn: '',
Description: '',
DocumentMetadataConfigurationUpdates: '',
CapacityUnits: '',
UserTokenConfigurations: '',
UserContextPolicy: '',
UserGroupResolutionConfiguration: ''
}
};
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=AWSKendraFrontendService.UpdateIndex';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","Name":"","RoleArn":"","Description":"","DocumentMetadataConfigurationUpdates":"","CapacityUnits":"","UserTokenConfigurations":"","UserContextPolicy":"","UserGroupResolutionConfiguration":""}'
};
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 = @{ @"Id": @"",
@"Name": @"",
@"RoleArn": @"",
@"Description": @"",
@"DocumentMetadataConfigurationUpdates": @"",
@"CapacityUnits": @"",
@"UserTokenConfigurations": @"",
@"UserContextPolicy": @"",
@"UserGroupResolutionConfiguration": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateIndex"]
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=AWSKendraFrontendService.UpdateIndex" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Id\": \"\",\n \"Name\": \"\",\n \"RoleArn\": \"\",\n \"Description\": \"\",\n \"DocumentMetadataConfigurationUpdates\": \"\",\n \"CapacityUnits\": \"\",\n \"UserTokenConfigurations\": \"\",\n \"UserContextPolicy\": \"\",\n \"UserGroupResolutionConfiguration\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateIndex",
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([
'Id' => '',
'Name' => '',
'RoleArn' => '',
'Description' => '',
'DocumentMetadataConfigurationUpdates' => '',
'CapacityUnits' => '',
'UserTokenConfigurations' => '',
'UserContextPolicy' => '',
'UserGroupResolutionConfiguration' => ''
]),
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=AWSKendraFrontendService.UpdateIndex', [
'body' => '{
"Id": "",
"Name": "",
"RoleArn": "",
"Description": "",
"DocumentMetadataConfigurationUpdates": "",
"CapacityUnits": "",
"UserTokenConfigurations": "",
"UserContextPolicy": "",
"UserGroupResolutionConfiguration": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateIndex');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Id' => '',
'Name' => '',
'RoleArn' => '',
'Description' => '',
'DocumentMetadataConfigurationUpdates' => '',
'CapacityUnits' => '',
'UserTokenConfigurations' => '',
'UserContextPolicy' => '',
'UserGroupResolutionConfiguration' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Id' => '',
'Name' => '',
'RoleArn' => '',
'Description' => '',
'DocumentMetadataConfigurationUpdates' => '',
'CapacityUnits' => '',
'UserTokenConfigurations' => '',
'UserContextPolicy' => '',
'UserGroupResolutionConfiguration' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateIndex');
$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=AWSKendraFrontendService.UpdateIndex' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"Name": "",
"RoleArn": "",
"Description": "",
"DocumentMetadataConfigurationUpdates": "",
"CapacityUnits": "",
"UserTokenConfigurations": "",
"UserContextPolicy": "",
"UserGroupResolutionConfiguration": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateIndex' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"Name": "",
"RoleArn": "",
"Description": "",
"DocumentMetadataConfigurationUpdates": "",
"CapacityUnits": "",
"UserTokenConfigurations": "",
"UserContextPolicy": "",
"UserGroupResolutionConfiguration": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Id\": \"\",\n \"Name\": \"\",\n \"RoleArn\": \"\",\n \"Description\": \"\",\n \"DocumentMetadataConfigurationUpdates\": \"\",\n \"CapacityUnits\": \"\",\n \"UserTokenConfigurations\": \"\",\n \"UserContextPolicy\": \"\",\n \"UserGroupResolutionConfiguration\": \"\"\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=AWSKendraFrontendService.UpdateIndex"
payload = {
"Id": "",
"Name": "",
"RoleArn": "",
"Description": "",
"DocumentMetadataConfigurationUpdates": "",
"CapacityUnits": "",
"UserTokenConfigurations": "",
"UserContextPolicy": "",
"UserGroupResolutionConfiguration": ""
}
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=AWSKendraFrontendService.UpdateIndex"
payload <- "{\n \"Id\": \"\",\n \"Name\": \"\",\n \"RoleArn\": \"\",\n \"Description\": \"\",\n \"DocumentMetadataConfigurationUpdates\": \"\",\n \"CapacityUnits\": \"\",\n \"UserTokenConfigurations\": \"\",\n \"UserContextPolicy\": \"\",\n \"UserGroupResolutionConfiguration\": \"\"\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=AWSKendraFrontendService.UpdateIndex")
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 \"Id\": \"\",\n \"Name\": \"\",\n \"RoleArn\": \"\",\n \"Description\": \"\",\n \"DocumentMetadataConfigurationUpdates\": \"\",\n \"CapacityUnits\": \"\",\n \"UserTokenConfigurations\": \"\",\n \"UserContextPolicy\": \"\",\n \"UserGroupResolutionConfiguration\": \"\"\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 \"Id\": \"\",\n \"Name\": \"\",\n \"RoleArn\": \"\",\n \"Description\": \"\",\n \"DocumentMetadataConfigurationUpdates\": \"\",\n \"CapacityUnits\": \"\",\n \"UserTokenConfigurations\": \"\",\n \"UserContextPolicy\": \"\",\n \"UserGroupResolutionConfiguration\": \"\"\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=AWSKendraFrontendService.UpdateIndex";
let payload = json!({
"Id": "",
"Name": "",
"RoleArn": "",
"Description": "",
"DocumentMetadataConfigurationUpdates": "",
"CapacityUnits": "",
"UserTokenConfigurations": "",
"UserContextPolicy": "",
"UserGroupResolutionConfiguration": ""
});
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=AWSKendraFrontendService.UpdateIndex' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Id": "",
"Name": "",
"RoleArn": "",
"Description": "",
"DocumentMetadataConfigurationUpdates": "",
"CapacityUnits": "",
"UserTokenConfigurations": "",
"UserContextPolicy": "",
"UserGroupResolutionConfiguration": ""
}'
echo '{
"Id": "",
"Name": "",
"RoleArn": "",
"Description": "",
"DocumentMetadataConfigurationUpdates": "",
"CapacityUnits": "",
"UserTokenConfigurations": "",
"UserContextPolicy": "",
"UserGroupResolutionConfiguration": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateIndex' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Id": "",\n "Name": "",\n "RoleArn": "",\n "Description": "",\n "DocumentMetadataConfigurationUpdates": "",\n "CapacityUnits": "",\n "UserTokenConfigurations": "",\n "UserContextPolicy": "",\n "UserGroupResolutionConfiguration": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateIndex'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Id": "",
"Name": "",
"RoleArn": "",
"Description": "",
"DocumentMetadataConfigurationUpdates": "",
"CapacityUnits": "",
"UserTokenConfigurations": "",
"UserContextPolicy": "",
"UserGroupResolutionConfiguration": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateIndex")! 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
UpdateQuerySuggestionsBlockList
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateQuerySuggestionsBlockList
HEADERS
X-Amz-Target
BODY json
{
"IndexId": "",
"Id": "",
"Name": "",
"Description": "",
"SourceS3Path": "",
"RoleArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateQuerySuggestionsBlockList");
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 \"IndexId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"SourceS3Path\": \"\",\n \"RoleArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateQuerySuggestionsBlockList" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IndexId ""
:Id ""
:Name ""
:Description ""
:SourceS3Path ""
:RoleArn ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateQuerySuggestionsBlockList"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IndexId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"SourceS3Path\": \"\",\n \"RoleArn\": \"\"\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=AWSKendraFrontendService.UpdateQuerySuggestionsBlockList"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IndexId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"SourceS3Path\": \"\",\n \"RoleArn\": \"\"\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=AWSKendraFrontendService.UpdateQuerySuggestionsBlockList");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IndexId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"SourceS3Path\": \"\",\n \"RoleArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateQuerySuggestionsBlockList"
payload := strings.NewReader("{\n \"IndexId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"SourceS3Path\": \"\",\n \"RoleArn\": \"\"\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: 105
{
"IndexId": "",
"Id": "",
"Name": "",
"Description": "",
"SourceS3Path": "",
"RoleArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateQuerySuggestionsBlockList")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IndexId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"SourceS3Path\": \"\",\n \"RoleArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateQuerySuggestionsBlockList"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IndexId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"SourceS3Path\": \"\",\n \"RoleArn\": \"\"\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 \"IndexId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"SourceS3Path\": \"\",\n \"RoleArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateQuerySuggestionsBlockList")
.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=AWSKendraFrontendService.UpdateQuerySuggestionsBlockList")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IndexId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"SourceS3Path\": \"\",\n \"RoleArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
IndexId: '',
Id: '',
Name: '',
Description: '',
SourceS3Path: '',
RoleArn: ''
});
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=AWSKendraFrontendService.UpdateQuerySuggestionsBlockList');
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=AWSKendraFrontendService.UpdateQuerySuggestionsBlockList',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', Id: '', Name: '', Description: '', SourceS3Path: '', RoleArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateQuerySuggestionsBlockList';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","Id":"","Name":"","Description":"","SourceS3Path":"","RoleArn":""}'
};
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=AWSKendraFrontendService.UpdateQuerySuggestionsBlockList',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IndexId": "",\n "Id": "",\n "Name": "",\n "Description": "",\n "SourceS3Path": "",\n "RoleArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"IndexId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"SourceS3Path\": \"\",\n \"RoleArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateQuerySuggestionsBlockList")
.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({IndexId: '', Id: '', Name: '', Description: '', SourceS3Path: '', RoleArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateQuerySuggestionsBlockList',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {IndexId: '', Id: '', Name: '', Description: '', SourceS3Path: '', RoleArn: ''},
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=AWSKendraFrontendService.UpdateQuerySuggestionsBlockList');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IndexId: '',
Id: '',
Name: '',
Description: '',
SourceS3Path: '',
RoleArn: ''
});
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=AWSKendraFrontendService.UpdateQuerySuggestionsBlockList',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {IndexId: '', Id: '', Name: '', Description: '', SourceS3Path: '', RoleArn: ''}
};
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=AWSKendraFrontendService.UpdateQuerySuggestionsBlockList';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","Id":"","Name":"","Description":"","SourceS3Path":"","RoleArn":""}'
};
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 = @{ @"IndexId": @"",
@"Id": @"",
@"Name": @"",
@"Description": @"",
@"SourceS3Path": @"",
@"RoleArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateQuerySuggestionsBlockList"]
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=AWSKendraFrontendService.UpdateQuerySuggestionsBlockList" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IndexId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"SourceS3Path\": \"\",\n \"RoleArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateQuerySuggestionsBlockList",
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([
'IndexId' => '',
'Id' => '',
'Name' => '',
'Description' => '',
'SourceS3Path' => '',
'RoleArn' => ''
]),
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=AWSKendraFrontendService.UpdateQuerySuggestionsBlockList', [
'body' => '{
"IndexId": "",
"Id": "",
"Name": "",
"Description": "",
"SourceS3Path": "",
"RoleArn": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateQuerySuggestionsBlockList');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IndexId' => '',
'Id' => '',
'Name' => '',
'Description' => '',
'SourceS3Path' => '',
'RoleArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IndexId' => '',
'Id' => '',
'Name' => '',
'Description' => '',
'SourceS3Path' => '',
'RoleArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateQuerySuggestionsBlockList');
$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=AWSKendraFrontendService.UpdateQuerySuggestionsBlockList' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"Id": "",
"Name": "",
"Description": "",
"SourceS3Path": "",
"RoleArn": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateQuerySuggestionsBlockList' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"Id": "",
"Name": "",
"Description": "",
"SourceS3Path": "",
"RoleArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IndexId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"SourceS3Path\": \"\",\n \"RoleArn\": \"\"\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=AWSKendraFrontendService.UpdateQuerySuggestionsBlockList"
payload = {
"IndexId": "",
"Id": "",
"Name": "",
"Description": "",
"SourceS3Path": "",
"RoleArn": ""
}
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=AWSKendraFrontendService.UpdateQuerySuggestionsBlockList"
payload <- "{\n \"IndexId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"SourceS3Path\": \"\",\n \"RoleArn\": \"\"\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=AWSKendraFrontendService.UpdateQuerySuggestionsBlockList")
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 \"IndexId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"SourceS3Path\": \"\",\n \"RoleArn\": \"\"\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 \"IndexId\": \"\",\n \"Id\": \"\",\n \"Name\": \"\",\n \"Description\": \"\",\n \"SourceS3Path\": \"\",\n \"RoleArn\": \"\"\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=AWSKendraFrontendService.UpdateQuerySuggestionsBlockList";
let payload = json!({
"IndexId": "",
"Id": "",
"Name": "",
"Description": "",
"SourceS3Path": "",
"RoleArn": ""
});
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=AWSKendraFrontendService.UpdateQuerySuggestionsBlockList' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IndexId": "",
"Id": "",
"Name": "",
"Description": "",
"SourceS3Path": "",
"RoleArn": ""
}'
echo '{
"IndexId": "",
"Id": "",
"Name": "",
"Description": "",
"SourceS3Path": "",
"RoleArn": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateQuerySuggestionsBlockList' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IndexId": "",\n "Id": "",\n "Name": "",\n "Description": "",\n "SourceS3Path": "",\n "RoleArn": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateQuerySuggestionsBlockList'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"IndexId": "",
"Id": "",
"Name": "",
"Description": "",
"SourceS3Path": "",
"RoleArn": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateQuerySuggestionsBlockList")! 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
UpdateQuerySuggestionsConfig
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateQuerySuggestionsConfig
HEADERS
X-Amz-Target
BODY json
{
"IndexId": "",
"Mode": "",
"QueryLogLookBackWindowInDays": "",
"IncludeQueriesWithoutUserInformation": "",
"MinimumNumberOfQueryingUsers": "",
"MinimumQueryCount": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateQuerySuggestionsConfig");
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 \"IndexId\": \"\",\n \"Mode\": \"\",\n \"QueryLogLookBackWindowInDays\": \"\",\n \"IncludeQueriesWithoutUserInformation\": \"\",\n \"MinimumNumberOfQueryingUsers\": \"\",\n \"MinimumQueryCount\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateQuerySuggestionsConfig" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:IndexId ""
:Mode ""
:QueryLogLookBackWindowInDays ""
:IncludeQueriesWithoutUserInformation ""
:MinimumNumberOfQueryingUsers ""
:MinimumQueryCount ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateQuerySuggestionsConfig"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"IndexId\": \"\",\n \"Mode\": \"\",\n \"QueryLogLookBackWindowInDays\": \"\",\n \"IncludeQueriesWithoutUserInformation\": \"\",\n \"MinimumNumberOfQueryingUsers\": \"\",\n \"MinimumQueryCount\": \"\"\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=AWSKendraFrontendService.UpdateQuerySuggestionsConfig"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"IndexId\": \"\",\n \"Mode\": \"\",\n \"QueryLogLookBackWindowInDays\": \"\",\n \"IncludeQueriesWithoutUserInformation\": \"\",\n \"MinimumNumberOfQueryingUsers\": \"\",\n \"MinimumQueryCount\": \"\"\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=AWSKendraFrontendService.UpdateQuerySuggestionsConfig");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"IndexId\": \"\",\n \"Mode\": \"\",\n \"QueryLogLookBackWindowInDays\": \"\",\n \"IncludeQueriesWithoutUserInformation\": \"\",\n \"MinimumNumberOfQueryingUsers\": \"\",\n \"MinimumQueryCount\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateQuerySuggestionsConfig"
payload := strings.NewReader("{\n \"IndexId\": \"\",\n \"Mode\": \"\",\n \"QueryLogLookBackWindowInDays\": \"\",\n \"IncludeQueriesWithoutUserInformation\": \"\",\n \"MinimumNumberOfQueryingUsers\": \"\",\n \"MinimumQueryCount\": \"\"\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: 182
{
"IndexId": "",
"Mode": "",
"QueryLogLookBackWindowInDays": "",
"IncludeQueriesWithoutUserInformation": "",
"MinimumNumberOfQueryingUsers": "",
"MinimumQueryCount": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateQuerySuggestionsConfig")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"IndexId\": \"\",\n \"Mode\": \"\",\n \"QueryLogLookBackWindowInDays\": \"\",\n \"IncludeQueriesWithoutUserInformation\": \"\",\n \"MinimumNumberOfQueryingUsers\": \"\",\n \"MinimumQueryCount\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateQuerySuggestionsConfig"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"IndexId\": \"\",\n \"Mode\": \"\",\n \"QueryLogLookBackWindowInDays\": \"\",\n \"IncludeQueriesWithoutUserInformation\": \"\",\n \"MinimumNumberOfQueryingUsers\": \"\",\n \"MinimumQueryCount\": \"\"\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 \"IndexId\": \"\",\n \"Mode\": \"\",\n \"QueryLogLookBackWindowInDays\": \"\",\n \"IncludeQueriesWithoutUserInformation\": \"\",\n \"MinimumNumberOfQueryingUsers\": \"\",\n \"MinimumQueryCount\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateQuerySuggestionsConfig")
.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=AWSKendraFrontendService.UpdateQuerySuggestionsConfig")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"IndexId\": \"\",\n \"Mode\": \"\",\n \"QueryLogLookBackWindowInDays\": \"\",\n \"IncludeQueriesWithoutUserInformation\": \"\",\n \"MinimumNumberOfQueryingUsers\": \"\",\n \"MinimumQueryCount\": \"\"\n}")
.asString();
const data = JSON.stringify({
IndexId: '',
Mode: '',
QueryLogLookBackWindowInDays: '',
IncludeQueriesWithoutUserInformation: '',
MinimumNumberOfQueryingUsers: '',
MinimumQueryCount: ''
});
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=AWSKendraFrontendService.UpdateQuerySuggestionsConfig');
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=AWSKendraFrontendService.UpdateQuerySuggestionsConfig',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
IndexId: '',
Mode: '',
QueryLogLookBackWindowInDays: '',
IncludeQueriesWithoutUserInformation: '',
MinimumNumberOfQueryingUsers: '',
MinimumQueryCount: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateQuerySuggestionsConfig';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","Mode":"","QueryLogLookBackWindowInDays":"","IncludeQueriesWithoutUserInformation":"","MinimumNumberOfQueryingUsers":"","MinimumQueryCount":""}'
};
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=AWSKendraFrontendService.UpdateQuerySuggestionsConfig',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "IndexId": "",\n "Mode": "",\n "QueryLogLookBackWindowInDays": "",\n "IncludeQueriesWithoutUserInformation": "",\n "MinimumNumberOfQueryingUsers": "",\n "MinimumQueryCount": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"IndexId\": \"\",\n \"Mode\": \"\",\n \"QueryLogLookBackWindowInDays\": \"\",\n \"IncludeQueriesWithoutUserInformation\": \"\",\n \"MinimumNumberOfQueryingUsers\": \"\",\n \"MinimumQueryCount\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateQuerySuggestionsConfig")
.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({
IndexId: '',
Mode: '',
QueryLogLookBackWindowInDays: '',
IncludeQueriesWithoutUserInformation: '',
MinimumNumberOfQueryingUsers: '',
MinimumQueryCount: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateQuerySuggestionsConfig',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
IndexId: '',
Mode: '',
QueryLogLookBackWindowInDays: '',
IncludeQueriesWithoutUserInformation: '',
MinimumNumberOfQueryingUsers: '',
MinimumQueryCount: ''
},
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=AWSKendraFrontendService.UpdateQuerySuggestionsConfig');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
IndexId: '',
Mode: '',
QueryLogLookBackWindowInDays: '',
IncludeQueriesWithoutUserInformation: '',
MinimumNumberOfQueryingUsers: '',
MinimumQueryCount: ''
});
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=AWSKendraFrontendService.UpdateQuerySuggestionsConfig',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
IndexId: '',
Mode: '',
QueryLogLookBackWindowInDays: '',
IncludeQueriesWithoutUserInformation: '',
MinimumNumberOfQueryingUsers: '',
MinimumQueryCount: ''
}
};
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=AWSKendraFrontendService.UpdateQuerySuggestionsConfig';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"IndexId":"","Mode":"","QueryLogLookBackWindowInDays":"","IncludeQueriesWithoutUserInformation":"","MinimumNumberOfQueryingUsers":"","MinimumQueryCount":""}'
};
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 = @{ @"IndexId": @"",
@"Mode": @"",
@"QueryLogLookBackWindowInDays": @"",
@"IncludeQueriesWithoutUserInformation": @"",
@"MinimumNumberOfQueryingUsers": @"",
@"MinimumQueryCount": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateQuerySuggestionsConfig"]
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=AWSKendraFrontendService.UpdateQuerySuggestionsConfig" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"IndexId\": \"\",\n \"Mode\": \"\",\n \"QueryLogLookBackWindowInDays\": \"\",\n \"IncludeQueriesWithoutUserInformation\": \"\",\n \"MinimumNumberOfQueryingUsers\": \"\",\n \"MinimumQueryCount\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateQuerySuggestionsConfig",
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([
'IndexId' => '',
'Mode' => '',
'QueryLogLookBackWindowInDays' => '',
'IncludeQueriesWithoutUserInformation' => '',
'MinimumNumberOfQueryingUsers' => '',
'MinimumQueryCount' => ''
]),
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=AWSKendraFrontendService.UpdateQuerySuggestionsConfig', [
'body' => '{
"IndexId": "",
"Mode": "",
"QueryLogLookBackWindowInDays": "",
"IncludeQueriesWithoutUserInformation": "",
"MinimumNumberOfQueryingUsers": "",
"MinimumQueryCount": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateQuerySuggestionsConfig');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'IndexId' => '',
'Mode' => '',
'QueryLogLookBackWindowInDays' => '',
'IncludeQueriesWithoutUserInformation' => '',
'MinimumNumberOfQueryingUsers' => '',
'MinimumQueryCount' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'IndexId' => '',
'Mode' => '',
'QueryLogLookBackWindowInDays' => '',
'IncludeQueriesWithoutUserInformation' => '',
'MinimumNumberOfQueryingUsers' => '',
'MinimumQueryCount' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateQuerySuggestionsConfig');
$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=AWSKendraFrontendService.UpdateQuerySuggestionsConfig' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"Mode": "",
"QueryLogLookBackWindowInDays": "",
"IncludeQueriesWithoutUserInformation": "",
"MinimumNumberOfQueryingUsers": "",
"MinimumQueryCount": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateQuerySuggestionsConfig' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"IndexId": "",
"Mode": "",
"QueryLogLookBackWindowInDays": "",
"IncludeQueriesWithoutUserInformation": "",
"MinimumNumberOfQueryingUsers": "",
"MinimumQueryCount": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"IndexId\": \"\",\n \"Mode\": \"\",\n \"QueryLogLookBackWindowInDays\": \"\",\n \"IncludeQueriesWithoutUserInformation\": \"\",\n \"MinimumNumberOfQueryingUsers\": \"\",\n \"MinimumQueryCount\": \"\"\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=AWSKendraFrontendService.UpdateQuerySuggestionsConfig"
payload = {
"IndexId": "",
"Mode": "",
"QueryLogLookBackWindowInDays": "",
"IncludeQueriesWithoutUserInformation": "",
"MinimumNumberOfQueryingUsers": "",
"MinimumQueryCount": ""
}
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=AWSKendraFrontendService.UpdateQuerySuggestionsConfig"
payload <- "{\n \"IndexId\": \"\",\n \"Mode\": \"\",\n \"QueryLogLookBackWindowInDays\": \"\",\n \"IncludeQueriesWithoutUserInformation\": \"\",\n \"MinimumNumberOfQueryingUsers\": \"\",\n \"MinimumQueryCount\": \"\"\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=AWSKendraFrontendService.UpdateQuerySuggestionsConfig")
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 \"IndexId\": \"\",\n \"Mode\": \"\",\n \"QueryLogLookBackWindowInDays\": \"\",\n \"IncludeQueriesWithoutUserInformation\": \"\",\n \"MinimumNumberOfQueryingUsers\": \"\",\n \"MinimumQueryCount\": \"\"\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 \"IndexId\": \"\",\n \"Mode\": \"\",\n \"QueryLogLookBackWindowInDays\": \"\",\n \"IncludeQueriesWithoutUserInformation\": \"\",\n \"MinimumNumberOfQueryingUsers\": \"\",\n \"MinimumQueryCount\": \"\"\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=AWSKendraFrontendService.UpdateQuerySuggestionsConfig";
let payload = json!({
"IndexId": "",
"Mode": "",
"QueryLogLookBackWindowInDays": "",
"IncludeQueriesWithoutUserInformation": "",
"MinimumNumberOfQueryingUsers": "",
"MinimumQueryCount": ""
});
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=AWSKendraFrontendService.UpdateQuerySuggestionsConfig' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"IndexId": "",
"Mode": "",
"QueryLogLookBackWindowInDays": "",
"IncludeQueriesWithoutUserInformation": "",
"MinimumNumberOfQueryingUsers": "",
"MinimumQueryCount": ""
}'
echo '{
"IndexId": "",
"Mode": "",
"QueryLogLookBackWindowInDays": "",
"IncludeQueriesWithoutUserInformation": "",
"MinimumNumberOfQueryingUsers": "",
"MinimumQueryCount": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateQuerySuggestionsConfig' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "IndexId": "",\n "Mode": "",\n "QueryLogLookBackWindowInDays": "",\n "IncludeQueriesWithoutUserInformation": "",\n "MinimumNumberOfQueryingUsers": "",\n "MinimumQueryCount": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateQuerySuggestionsConfig'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"IndexId": "",
"Mode": "",
"QueryLogLookBackWindowInDays": "",
"IncludeQueriesWithoutUserInformation": "",
"MinimumNumberOfQueryingUsers": "",
"MinimumQueryCount": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateQuerySuggestionsConfig")! 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
UpdateThesaurus
{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateThesaurus
HEADERS
X-Amz-Target
BODY json
{
"Id": "",
"Name": "",
"IndexId": "",
"Description": "",
"RoleArn": "",
"SourceS3Path": {
"Bucket": "",
"Key": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateThesaurus");
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 \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"SourceS3Path\": {\n \"Bucket\": \"\",\n \"Key\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateThesaurus" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Id ""
:Name ""
:IndexId ""
:Description ""
:RoleArn ""
:SourceS3Path {:Bucket ""
:Key ""}}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateThesaurus"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"SourceS3Path\": {\n \"Bucket\": \"\",\n \"Key\": \"\"\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=AWSKendraFrontendService.UpdateThesaurus"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"SourceS3Path\": {\n \"Bucket\": \"\",\n \"Key\": \"\"\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=AWSKendraFrontendService.UpdateThesaurus");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"SourceS3Path\": {\n \"Bucket\": \"\",\n \"Key\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateThesaurus"
payload := strings.NewReader("{\n \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"SourceS3Path\": {\n \"Bucket\": \"\",\n \"Key\": \"\"\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: 140
{
"Id": "",
"Name": "",
"IndexId": "",
"Description": "",
"RoleArn": "",
"SourceS3Path": {
"Bucket": "",
"Key": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateThesaurus")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"SourceS3Path\": {\n \"Bucket\": \"\",\n \"Key\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateThesaurus"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"SourceS3Path\": {\n \"Bucket\": \"\",\n \"Key\": \"\"\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 \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"SourceS3Path\": {\n \"Bucket\": \"\",\n \"Key\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateThesaurus")
.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=AWSKendraFrontendService.UpdateThesaurus")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"SourceS3Path\": {\n \"Bucket\": \"\",\n \"Key\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
Id: '',
Name: '',
IndexId: '',
Description: '',
RoleArn: '',
SourceS3Path: {
Bucket: '',
Key: ''
}
});
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=AWSKendraFrontendService.UpdateThesaurus');
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=AWSKendraFrontendService.UpdateThesaurus',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Id: '',
Name: '',
IndexId: '',
Description: '',
RoleArn: '',
SourceS3Path: {Bucket: '', Key: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateThesaurus';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","Name":"","IndexId":"","Description":"","RoleArn":"","SourceS3Path":{"Bucket":"","Key":""}}'
};
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=AWSKendraFrontendService.UpdateThesaurus',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Id": "",\n "Name": "",\n "IndexId": "",\n "Description": "",\n "RoleArn": "",\n "SourceS3Path": {\n "Bucket": "",\n "Key": ""\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 \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"SourceS3Path\": {\n \"Bucket\": \"\",\n \"Key\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateThesaurus")
.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({
Id: '',
Name: '',
IndexId: '',
Description: '',
RoleArn: '',
SourceS3Path: {Bucket: '', Key: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateThesaurus',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
Id: '',
Name: '',
IndexId: '',
Description: '',
RoleArn: '',
SourceS3Path: {Bucket: '', Key: ''}
},
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=AWSKendraFrontendService.UpdateThesaurus');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Id: '',
Name: '',
IndexId: '',
Description: '',
RoleArn: '',
SourceS3Path: {
Bucket: '',
Key: ''
}
});
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=AWSKendraFrontendService.UpdateThesaurus',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
Id: '',
Name: '',
IndexId: '',
Description: '',
RoleArn: '',
SourceS3Path: {Bucket: '', Key: ''}
}
};
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=AWSKendraFrontendService.UpdateThesaurus';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Id":"","Name":"","IndexId":"","Description":"","RoleArn":"","SourceS3Path":{"Bucket":"","Key":""}}'
};
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 = @{ @"Id": @"",
@"Name": @"",
@"IndexId": @"",
@"Description": @"",
@"RoleArn": @"",
@"SourceS3Path": @{ @"Bucket": @"", @"Key": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateThesaurus"]
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=AWSKendraFrontendService.UpdateThesaurus" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"SourceS3Path\": {\n \"Bucket\": \"\",\n \"Key\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateThesaurus",
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([
'Id' => '',
'Name' => '',
'IndexId' => '',
'Description' => '',
'RoleArn' => '',
'SourceS3Path' => [
'Bucket' => '',
'Key' => ''
]
]),
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=AWSKendraFrontendService.UpdateThesaurus', [
'body' => '{
"Id": "",
"Name": "",
"IndexId": "",
"Description": "",
"RoleArn": "",
"SourceS3Path": {
"Bucket": "",
"Key": ""
}
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateThesaurus');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Id' => '',
'Name' => '',
'IndexId' => '',
'Description' => '',
'RoleArn' => '',
'SourceS3Path' => [
'Bucket' => '',
'Key' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Id' => '',
'Name' => '',
'IndexId' => '',
'Description' => '',
'RoleArn' => '',
'SourceS3Path' => [
'Bucket' => '',
'Key' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateThesaurus');
$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=AWSKendraFrontendService.UpdateThesaurus' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"Name": "",
"IndexId": "",
"Description": "",
"RoleArn": "",
"SourceS3Path": {
"Bucket": "",
"Key": ""
}
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateThesaurus' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Id": "",
"Name": "",
"IndexId": "",
"Description": "",
"RoleArn": "",
"SourceS3Path": {
"Bucket": "",
"Key": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"SourceS3Path\": {\n \"Bucket\": \"\",\n \"Key\": \"\"\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=AWSKendraFrontendService.UpdateThesaurus"
payload = {
"Id": "",
"Name": "",
"IndexId": "",
"Description": "",
"RoleArn": "",
"SourceS3Path": {
"Bucket": "",
"Key": ""
}
}
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=AWSKendraFrontendService.UpdateThesaurus"
payload <- "{\n \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"SourceS3Path\": {\n \"Bucket\": \"\",\n \"Key\": \"\"\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=AWSKendraFrontendService.UpdateThesaurus")
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 \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"SourceS3Path\": {\n \"Bucket\": \"\",\n \"Key\": \"\"\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 \"Id\": \"\",\n \"Name\": \"\",\n \"IndexId\": \"\",\n \"Description\": \"\",\n \"RoleArn\": \"\",\n \"SourceS3Path\": {\n \"Bucket\": \"\",\n \"Key\": \"\"\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=AWSKendraFrontendService.UpdateThesaurus";
let payload = json!({
"Id": "",
"Name": "",
"IndexId": "",
"Description": "",
"RoleArn": "",
"SourceS3Path": json!({
"Bucket": "",
"Key": ""
})
});
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=AWSKendraFrontendService.UpdateThesaurus' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Id": "",
"Name": "",
"IndexId": "",
"Description": "",
"RoleArn": "",
"SourceS3Path": {
"Bucket": "",
"Key": ""
}
}'
echo '{
"Id": "",
"Name": "",
"IndexId": "",
"Description": "",
"RoleArn": "",
"SourceS3Path": {
"Bucket": "",
"Key": ""
}
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateThesaurus' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Id": "",\n "Name": "",\n "IndexId": "",\n "Description": "",\n "RoleArn": "",\n "SourceS3Path": {\n "Bucket": "",\n "Key": ""\n }\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateThesaurus'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Id": "",
"Name": "",
"IndexId": "",
"Description": "",
"RoleArn": "",
"SourceS3Path": [
"Bucket": "",
"Key": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AWSKendraFrontendService.UpdateThesaurus")! 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()