Amazon Machine Learning
POST
AddTags
{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.AddTags
HEADERS
X-Amz-Target
BODY json
{
"Tags": "",
"ResourceId": "",
"ResourceType": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.AddTags");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"Tags\": \"\",\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.AddTags" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:Tags ""
:ResourceId ""
:ResourceType ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.AddTags"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"Tags\": \"\",\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.AddTags"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"Tags\": \"\",\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.AddTags");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"Tags\": \"\",\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.AddTags"
payload := strings.NewReader("{\n \"Tags\": \"\",\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
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
{
"Tags": "",
"ResourceId": "",
"ResourceType": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.AddTags")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"Tags\": \"\",\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.AddTags"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"Tags\": \"\",\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"Tags\": \"\",\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.AddTags")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.AddTags")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"Tags\": \"\",\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}")
.asString();
const data = JSON.stringify({
Tags: '',
ResourceId: '',
ResourceType: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.AddTags');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.AddTags',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Tags: '', ResourceId: '', ResourceType: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.AddTags';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Tags":"","ResourceId":"","ResourceType":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.AddTags',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "Tags": "",\n "ResourceId": "",\n "ResourceType": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"Tags\": \"\",\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.AddTags")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({Tags: '', ResourceId: '', ResourceType: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.AddTags',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {Tags: '', ResourceId: '', ResourceType: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.AddTags');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
Tags: '',
ResourceId: '',
ResourceType: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.AddTags',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {Tags: '', ResourceId: '', ResourceType: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.AddTags';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"Tags":"","ResourceId":"","ResourceType":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"Tags": @"",
@"ResourceId": @"",
@"ResourceType": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.AddTags"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.AddTags" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"Tags\": \"\",\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.AddTags",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'Tags' => '',
'ResourceId' => '',
'ResourceType' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.AddTags', [
'body' => '{
"Tags": "",
"ResourceId": "",
"ResourceType": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.AddTags');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'Tags' => '',
'ResourceId' => '',
'ResourceType' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'Tags' => '',
'ResourceId' => '',
'ResourceType' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.AddTags');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.AddTags' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Tags": "",
"ResourceId": "",
"ResourceType": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.AddTags' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"Tags": "",
"ResourceId": "",
"ResourceType": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"Tags\": \"\",\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.AddTags"
payload = {
"Tags": "",
"ResourceId": "",
"ResourceType": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.AddTags"
payload <- "{\n \"Tags\": \"\",\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.AddTags")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"Tags\": \"\",\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"Tags\": \"\",\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.AddTags";
let payload = json!({
"Tags": "",
"ResourceId": "",
"ResourceType": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.AddTags' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"Tags": "",
"ResourceId": "",
"ResourceType": ""
}'
echo '{
"Tags": "",
"ResourceId": "",
"ResourceType": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.AddTags' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "Tags": "",\n "ResourceId": "",\n "ResourceType": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.AddTags'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"Tags": "",
"ResourceId": "",
"ResourceType": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.AddTags")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
CreateBatchPrediction
{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateBatchPrediction
HEADERS
X-Amz-Target
BODY json
{
"BatchPredictionId": "",
"BatchPredictionName": "",
"MLModelId": "",
"BatchPredictionDataSourceId": "",
"OutputUri": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateBatchPrediction");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"BatchPredictionId\": \"\",\n \"BatchPredictionName\": \"\",\n \"MLModelId\": \"\",\n \"BatchPredictionDataSourceId\": \"\",\n \"OutputUri\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateBatchPrediction" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:BatchPredictionId ""
:BatchPredictionName ""
:MLModelId ""
:BatchPredictionDataSourceId ""
:OutputUri ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateBatchPrediction"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"BatchPredictionId\": \"\",\n \"BatchPredictionName\": \"\",\n \"MLModelId\": \"\",\n \"BatchPredictionDataSourceId\": \"\",\n \"OutputUri\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateBatchPrediction"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"BatchPredictionId\": \"\",\n \"BatchPredictionName\": \"\",\n \"MLModelId\": \"\",\n \"BatchPredictionDataSourceId\": \"\",\n \"OutputUri\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateBatchPrediction");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"BatchPredictionId\": \"\",\n \"BatchPredictionName\": \"\",\n \"MLModelId\": \"\",\n \"BatchPredictionDataSourceId\": \"\",\n \"OutputUri\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateBatchPrediction"
payload := strings.NewReader("{\n \"BatchPredictionId\": \"\",\n \"BatchPredictionName\": \"\",\n \"MLModelId\": \"\",\n \"BatchPredictionDataSourceId\": \"\",\n \"OutputUri\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 133
{
"BatchPredictionId": "",
"BatchPredictionName": "",
"MLModelId": "",
"BatchPredictionDataSourceId": "",
"OutputUri": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateBatchPrediction")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"BatchPredictionId\": \"\",\n \"BatchPredictionName\": \"\",\n \"MLModelId\": \"\",\n \"BatchPredictionDataSourceId\": \"\",\n \"OutputUri\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateBatchPrediction"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"BatchPredictionId\": \"\",\n \"BatchPredictionName\": \"\",\n \"MLModelId\": \"\",\n \"BatchPredictionDataSourceId\": \"\",\n \"OutputUri\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"BatchPredictionId\": \"\",\n \"BatchPredictionName\": \"\",\n \"MLModelId\": \"\",\n \"BatchPredictionDataSourceId\": \"\",\n \"OutputUri\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateBatchPrediction")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateBatchPrediction")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"BatchPredictionId\": \"\",\n \"BatchPredictionName\": \"\",\n \"MLModelId\": \"\",\n \"BatchPredictionDataSourceId\": \"\",\n \"OutputUri\": \"\"\n}")
.asString();
const data = JSON.stringify({
BatchPredictionId: '',
BatchPredictionName: '',
MLModelId: '',
BatchPredictionDataSourceId: '',
OutputUri: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateBatchPrediction');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateBatchPrediction',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
BatchPredictionId: '',
BatchPredictionName: '',
MLModelId: '',
BatchPredictionDataSourceId: '',
OutputUri: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateBatchPrediction';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"BatchPredictionId":"","BatchPredictionName":"","MLModelId":"","BatchPredictionDataSourceId":"","OutputUri":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateBatchPrediction',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "BatchPredictionId": "",\n "BatchPredictionName": "",\n "MLModelId": "",\n "BatchPredictionDataSourceId": "",\n "OutputUri": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"BatchPredictionId\": \"\",\n \"BatchPredictionName\": \"\",\n \"MLModelId\": \"\",\n \"BatchPredictionDataSourceId\": \"\",\n \"OutputUri\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateBatchPrediction")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
BatchPredictionId: '',
BatchPredictionName: '',
MLModelId: '',
BatchPredictionDataSourceId: '',
OutputUri: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateBatchPrediction',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
BatchPredictionId: '',
BatchPredictionName: '',
MLModelId: '',
BatchPredictionDataSourceId: '',
OutputUri: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateBatchPrediction');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
BatchPredictionId: '',
BatchPredictionName: '',
MLModelId: '',
BatchPredictionDataSourceId: '',
OutputUri: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateBatchPrediction',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
BatchPredictionId: '',
BatchPredictionName: '',
MLModelId: '',
BatchPredictionDataSourceId: '',
OutputUri: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateBatchPrediction';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"BatchPredictionId":"","BatchPredictionName":"","MLModelId":"","BatchPredictionDataSourceId":"","OutputUri":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"BatchPredictionId": @"",
@"BatchPredictionName": @"",
@"MLModelId": @"",
@"BatchPredictionDataSourceId": @"",
@"OutputUri": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateBatchPrediction"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateBatchPrediction" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"BatchPredictionId\": \"\",\n \"BatchPredictionName\": \"\",\n \"MLModelId\": \"\",\n \"BatchPredictionDataSourceId\": \"\",\n \"OutputUri\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateBatchPrediction",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'BatchPredictionId' => '',
'BatchPredictionName' => '',
'MLModelId' => '',
'BatchPredictionDataSourceId' => '',
'OutputUri' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateBatchPrediction', [
'body' => '{
"BatchPredictionId": "",
"BatchPredictionName": "",
"MLModelId": "",
"BatchPredictionDataSourceId": "",
"OutputUri": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateBatchPrediction');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'BatchPredictionId' => '',
'BatchPredictionName' => '',
'MLModelId' => '',
'BatchPredictionDataSourceId' => '',
'OutputUri' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'BatchPredictionId' => '',
'BatchPredictionName' => '',
'MLModelId' => '',
'BatchPredictionDataSourceId' => '',
'OutputUri' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateBatchPrediction');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateBatchPrediction' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"BatchPredictionId": "",
"BatchPredictionName": "",
"MLModelId": "",
"BatchPredictionDataSourceId": "",
"OutputUri": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateBatchPrediction' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"BatchPredictionId": "",
"BatchPredictionName": "",
"MLModelId": "",
"BatchPredictionDataSourceId": "",
"OutputUri": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"BatchPredictionId\": \"\",\n \"BatchPredictionName\": \"\",\n \"MLModelId\": \"\",\n \"BatchPredictionDataSourceId\": \"\",\n \"OutputUri\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateBatchPrediction"
payload = {
"BatchPredictionId": "",
"BatchPredictionName": "",
"MLModelId": "",
"BatchPredictionDataSourceId": "",
"OutputUri": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateBatchPrediction"
payload <- "{\n \"BatchPredictionId\": \"\",\n \"BatchPredictionName\": \"\",\n \"MLModelId\": \"\",\n \"BatchPredictionDataSourceId\": \"\",\n \"OutputUri\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateBatchPrediction")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"BatchPredictionId\": \"\",\n \"BatchPredictionName\": \"\",\n \"MLModelId\": \"\",\n \"BatchPredictionDataSourceId\": \"\",\n \"OutputUri\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"BatchPredictionId\": \"\",\n \"BatchPredictionName\": \"\",\n \"MLModelId\": \"\",\n \"BatchPredictionDataSourceId\": \"\",\n \"OutputUri\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateBatchPrediction";
let payload = json!({
"BatchPredictionId": "",
"BatchPredictionName": "",
"MLModelId": "",
"BatchPredictionDataSourceId": "",
"OutputUri": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateBatchPrediction' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"BatchPredictionId": "",
"BatchPredictionName": "",
"MLModelId": "",
"BatchPredictionDataSourceId": "",
"OutputUri": ""
}'
echo '{
"BatchPredictionId": "",
"BatchPredictionName": "",
"MLModelId": "",
"BatchPredictionDataSourceId": "",
"OutputUri": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateBatchPrediction' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "BatchPredictionId": "",\n "BatchPredictionName": "",\n "MLModelId": "",\n "BatchPredictionDataSourceId": "",\n "OutputUri": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateBatchPrediction'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"BatchPredictionId": "",
"BatchPredictionName": "",
"MLModelId": "",
"BatchPredictionDataSourceId": "",
"OutputUri": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateBatchPrediction")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
CreateDataSourceFromRDS
{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRDS
HEADERS
X-Amz-Target
BODY json
{
"DataSourceId": "",
"DataSourceName": "",
"RDSData": "",
"RoleARN": "",
"ComputeStatistics": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRDS");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"RDSData\": \"\",\n \"RoleARN\": \"\",\n \"ComputeStatistics\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRDS" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DataSourceId ""
:DataSourceName ""
:RDSData ""
:RoleARN ""
:ComputeStatistics ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRDS"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"RDSData\": \"\",\n \"RoleARN\": \"\",\n \"ComputeStatistics\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRDS"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"RDSData\": \"\",\n \"RoleARN\": \"\",\n \"ComputeStatistics\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRDS");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"RDSData\": \"\",\n \"RoleARN\": \"\",\n \"ComputeStatistics\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRDS"
payload := strings.NewReader("{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"RDSData\": \"\",\n \"RoleARN\": \"\",\n \"ComputeStatistics\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 109
{
"DataSourceId": "",
"DataSourceName": "",
"RDSData": "",
"RoleARN": "",
"ComputeStatistics": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRDS")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"RDSData\": \"\",\n \"RoleARN\": \"\",\n \"ComputeStatistics\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRDS"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"RDSData\": \"\",\n \"RoleARN\": \"\",\n \"ComputeStatistics\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"RDSData\": \"\",\n \"RoleARN\": \"\",\n \"ComputeStatistics\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRDS")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRDS")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"RDSData\": \"\",\n \"RoleARN\": \"\",\n \"ComputeStatistics\": \"\"\n}")
.asString();
const data = JSON.stringify({
DataSourceId: '',
DataSourceName: '',
RDSData: '',
RoleARN: '',
ComputeStatistics: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRDS');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRDS',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
DataSourceId: '',
DataSourceName: '',
RDSData: '',
RoleARN: '',
ComputeStatistics: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRDS';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DataSourceId":"","DataSourceName":"","RDSData":"","RoleARN":"","ComputeStatistics":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRDS',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DataSourceId": "",\n "DataSourceName": "",\n "RDSData": "",\n "RoleARN": "",\n "ComputeStatistics": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"RDSData\": \"\",\n \"RoleARN\": \"\",\n \"ComputeStatistics\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRDS")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
DataSourceId: '',
DataSourceName: '',
RDSData: '',
RoleARN: '',
ComputeStatistics: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRDS',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
DataSourceId: '',
DataSourceName: '',
RDSData: '',
RoleARN: '',
ComputeStatistics: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRDS');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DataSourceId: '',
DataSourceName: '',
RDSData: '',
RoleARN: '',
ComputeStatistics: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRDS',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
DataSourceId: '',
DataSourceName: '',
RDSData: '',
RoleARN: '',
ComputeStatistics: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRDS';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DataSourceId":"","DataSourceName":"","RDSData":"","RoleARN":"","ComputeStatistics":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DataSourceId": @"",
@"DataSourceName": @"",
@"RDSData": @"",
@"RoleARN": @"",
@"ComputeStatistics": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRDS"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRDS" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"RDSData\": \"\",\n \"RoleARN\": \"\",\n \"ComputeStatistics\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRDS",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DataSourceId' => '',
'DataSourceName' => '',
'RDSData' => '',
'RoleARN' => '',
'ComputeStatistics' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRDS', [
'body' => '{
"DataSourceId": "",
"DataSourceName": "",
"RDSData": "",
"RoleARN": "",
"ComputeStatistics": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRDS');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DataSourceId' => '',
'DataSourceName' => '',
'RDSData' => '',
'RoleARN' => '',
'ComputeStatistics' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DataSourceId' => '',
'DataSourceName' => '',
'RDSData' => '',
'RoleARN' => '',
'ComputeStatistics' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRDS');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRDS' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DataSourceId": "",
"DataSourceName": "",
"RDSData": "",
"RoleARN": "",
"ComputeStatistics": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRDS' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DataSourceId": "",
"DataSourceName": "",
"RDSData": "",
"RoleARN": "",
"ComputeStatistics": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"RDSData\": \"\",\n \"RoleARN\": \"\",\n \"ComputeStatistics\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRDS"
payload = {
"DataSourceId": "",
"DataSourceName": "",
"RDSData": "",
"RoleARN": "",
"ComputeStatistics": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRDS"
payload <- "{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"RDSData\": \"\",\n \"RoleARN\": \"\",\n \"ComputeStatistics\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRDS")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"RDSData\": \"\",\n \"RoleARN\": \"\",\n \"ComputeStatistics\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"RDSData\": \"\",\n \"RoleARN\": \"\",\n \"ComputeStatistics\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRDS";
let payload = json!({
"DataSourceId": "",
"DataSourceName": "",
"RDSData": "",
"RoleARN": "",
"ComputeStatistics": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRDS' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DataSourceId": "",
"DataSourceName": "",
"RDSData": "",
"RoleARN": "",
"ComputeStatistics": ""
}'
echo '{
"DataSourceId": "",
"DataSourceName": "",
"RDSData": "",
"RoleARN": "",
"ComputeStatistics": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRDS' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DataSourceId": "",\n "DataSourceName": "",\n "RDSData": "",\n "RoleARN": "",\n "ComputeStatistics": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRDS'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DataSourceId": "",
"DataSourceName": "",
"RDSData": "",
"RoleARN": "",
"ComputeStatistics": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRDS")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
CreateDataSourceFromRedshift
{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRedshift
HEADERS
X-Amz-Target
BODY json
{
"DataSourceId": "",
"DataSourceName": "",
"DataSpec": "",
"RoleARN": "",
"ComputeStatistics": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRedshift");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"DataSpec\": \"\",\n \"RoleARN\": \"\",\n \"ComputeStatistics\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRedshift" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DataSourceId ""
:DataSourceName ""
:DataSpec ""
:RoleARN ""
:ComputeStatistics ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRedshift"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"DataSpec\": \"\",\n \"RoleARN\": \"\",\n \"ComputeStatistics\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRedshift"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"DataSpec\": \"\",\n \"RoleARN\": \"\",\n \"ComputeStatistics\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRedshift");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"DataSpec\": \"\",\n \"RoleARN\": \"\",\n \"ComputeStatistics\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRedshift"
payload := strings.NewReader("{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"DataSpec\": \"\",\n \"RoleARN\": \"\",\n \"ComputeStatistics\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 110
{
"DataSourceId": "",
"DataSourceName": "",
"DataSpec": "",
"RoleARN": "",
"ComputeStatistics": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRedshift")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"DataSpec\": \"\",\n \"RoleARN\": \"\",\n \"ComputeStatistics\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRedshift"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"DataSpec\": \"\",\n \"RoleARN\": \"\",\n \"ComputeStatistics\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"DataSpec\": \"\",\n \"RoleARN\": \"\",\n \"ComputeStatistics\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRedshift")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRedshift")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"DataSpec\": \"\",\n \"RoleARN\": \"\",\n \"ComputeStatistics\": \"\"\n}")
.asString();
const data = JSON.stringify({
DataSourceId: '',
DataSourceName: '',
DataSpec: '',
RoleARN: '',
ComputeStatistics: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRedshift');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRedshift',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
DataSourceId: '',
DataSourceName: '',
DataSpec: '',
RoleARN: '',
ComputeStatistics: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRedshift';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DataSourceId":"","DataSourceName":"","DataSpec":"","RoleARN":"","ComputeStatistics":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRedshift',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DataSourceId": "",\n "DataSourceName": "",\n "DataSpec": "",\n "RoleARN": "",\n "ComputeStatistics": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"DataSpec\": \"\",\n \"RoleARN\": \"\",\n \"ComputeStatistics\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRedshift")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
DataSourceId: '',
DataSourceName: '',
DataSpec: '',
RoleARN: '',
ComputeStatistics: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRedshift',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
DataSourceId: '',
DataSourceName: '',
DataSpec: '',
RoleARN: '',
ComputeStatistics: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRedshift');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DataSourceId: '',
DataSourceName: '',
DataSpec: '',
RoleARN: '',
ComputeStatistics: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRedshift',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
DataSourceId: '',
DataSourceName: '',
DataSpec: '',
RoleARN: '',
ComputeStatistics: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRedshift';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DataSourceId":"","DataSourceName":"","DataSpec":"","RoleARN":"","ComputeStatistics":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DataSourceId": @"",
@"DataSourceName": @"",
@"DataSpec": @"",
@"RoleARN": @"",
@"ComputeStatistics": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRedshift"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRedshift" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"DataSpec\": \"\",\n \"RoleARN\": \"\",\n \"ComputeStatistics\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRedshift",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DataSourceId' => '',
'DataSourceName' => '',
'DataSpec' => '',
'RoleARN' => '',
'ComputeStatistics' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRedshift', [
'body' => '{
"DataSourceId": "",
"DataSourceName": "",
"DataSpec": "",
"RoleARN": "",
"ComputeStatistics": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRedshift');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DataSourceId' => '',
'DataSourceName' => '',
'DataSpec' => '',
'RoleARN' => '',
'ComputeStatistics' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DataSourceId' => '',
'DataSourceName' => '',
'DataSpec' => '',
'RoleARN' => '',
'ComputeStatistics' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRedshift');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRedshift' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DataSourceId": "",
"DataSourceName": "",
"DataSpec": "",
"RoleARN": "",
"ComputeStatistics": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRedshift' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DataSourceId": "",
"DataSourceName": "",
"DataSpec": "",
"RoleARN": "",
"ComputeStatistics": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"DataSpec\": \"\",\n \"RoleARN\": \"\",\n \"ComputeStatistics\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRedshift"
payload = {
"DataSourceId": "",
"DataSourceName": "",
"DataSpec": "",
"RoleARN": "",
"ComputeStatistics": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRedshift"
payload <- "{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"DataSpec\": \"\",\n \"RoleARN\": \"\",\n \"ComputeStatistics\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRedshift")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"DataSpec\": \"\",\n \"RoleARN\": \"\",\n \"ComputeStatistics\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"DataSpec\": \"\",\n \"RoleARN\": \"\",\n \"ComputeStatistics\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRedshift";
let payload = json!({
"DataSourceId": "",
"DataSourceName": "",
"DataSpec": "",
"RoleARN": "",
"ComputeStatistics": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRedshift' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DataSourceId": "",
"DataSourceName": "",
"DataSpec": "",
"RoleARN": "",
"ComputeStatistics": ""
}'
echo '{
"DataSourceId": "",
"DataSourceName": "",
"DataSpec": "",
"RoleARN": "",
"ComputeStatistics": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRedshift' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DataSourceId": "",\n "DataSourceName": "",\n "DataSpec": "",\n "RoleARN": "",\n "ComputeStatistics": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRedshift'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DataSourceId": "",
"DataSourceName": "",
"DataSpec": "",
"RoleARN": "",
"ComputeStatistics": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromRedshift")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
CreateDataSourceFromS3
{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromS3
HEADERS
X-Amz-Target
BODY json
{
"DataSourceId": "",
"DataSourceName": "",
"DataSpec": "",
"ComputeStatistics": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromS3");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"DataSpec\": \"\",\n \"ComputeStatistics\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromS3" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DataSourceId ""
:DataSourceName ""
:DataSpec ""
:ComputeStatistics ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromS3"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"DataSpec\": \"\",\n \"ComputeStatistics\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromS3"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"DataSpec\": \"\",\n \"ComputeStatistics\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromS3");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"DataSpec\": \"\",\n \"ComputeStatistics\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromS3"
payload := strings.NewReader("{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"DataSpec\": \"\",\n \"ComputeStatistics\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 93
{
"DataSourceId": "",
"DataSourceName": "",
"DataSpec": "",
"ComputeStatistics": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromS3")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"DataSpec\": \"\",\n \"ComputeStatistics\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromS3"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"DataSpec\": \"\",\n \"ComputeStatistics\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"DataSpec\": \"\",\n \"ComputeStatistics\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromS3")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromS3")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"DataSpec\": \"\",\n \"ComputeStatistics\": \"\"\n}")
.asString();
const data = JSON.stringify({
DataSourceId: '',
DataSourceName: '',
DataSpec: '',
ComputeStatistics: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromS3');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromS3',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DataSourceId: '', DataSourceName: '', DataSpec: '', ComputeStatistics: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromS3';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DataSourceId":"","DataSourceName":"","DataSpec":"","ComputeStatistics":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromS3',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DataSourceId": "",\n "DataSourceName": "",\n "DataSpec": "",\n "ComputeStatistics": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"DataSpec\": \"\",\n \"ComputeStatistics\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromS3")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DataSourceId: '', DataSourceName: '', DataSpec: '', ComputeStatistics: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromS3',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DataSourceId: '', DataSourceName: '', DataSpec: '', ComputeStatistics: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromS3');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DataSourceId: '',
DataSourceName: '',
DataSpec: '',
ComputeStatistics: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromS3',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DataSourceId: '', DataSourceName: '', DataSpec: '', ComputeStatistics: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromS3';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DataSourceId":"","DataSourceName":"","DataSpec":"","ComputeStatistics":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DataSourceId": @"",
@"DataSourceName": @"",
@"DataSpec": @"",
@"ComputeStatistics": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromS3"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromS3" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"DataSpec\": \"\",\n \"ComputeStatistics\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromS3",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DataSourceId' => '',
'DataSourceName' => '',
'DataSpec' => '',
'ComputeStatistics' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromS3', [
'body' => '{
"DataSourceId": "",
"DataSourceName": "",
"DataSpec": "",
"ComputeStatistics": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromS3');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DataSourceId' => '',
'DataSourceName' => '',
'DataSpec' => '',
'ComputeStatistics' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DataSourceId' => '',
'DataSourceName' => '',
'DataSpec' => '',
'ComputeStatistics' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromS3');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromS3' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DataSourceId": "",
"DataSourceName": "",
"DataSpec": "",
"ComputeStatistics": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromS3' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DataSourceId": "",
"DataSourceName": "",
"DataSpec": "",
"ComputeStatistics": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"DataSpec\": \"\",\n \"ComputeStatistics\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromS3"
payload = {
"DataSourceId": "",
"DataSourceName": "",
"DataSpec": "",
"ComputeStatistics": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromS3"
payload <- "{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"DataSpec\": \"\",\n \"ComputeStatistics\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromS3")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"DataSpec\": \"\",\n \"ComputeStatistics\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\",\n \"DataSpec\": \"\",\n \"ComputeStatistics\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromS3";
let payload = json!({
"DataSourceId": "",
"DataSourceName": "",
"DataSpec": "",
"ComputeStatistics": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromS3' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DataSourceId": "",
"DataSourceName": "",
"DataSpec": "",
"ComputeStatistics": ""
}'
echo '{
"DataSourceId": "",
"DataSourceName": "",
"DataSpec": "",
"ComputeStatistics": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromS3' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DataSourceId": "",\n "DataSourceName": "",\n "DataSpec": "",\n "ComputeStatistics": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromS3'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DataSourceId": "",
"DataSourceName": "",
"DataSpec": "",
"ComputeStatistics": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateDataSourceFromS3")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
CreateEvaluation
{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateEvaluation
HEADERS
X-Amz-Target
BODY json
{
"EvaluationId": "",
"EvaluationName": "",
"MLModelId": "",
"EvaluationDataSourceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateEvaluation");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"EvaluationId\": \"\",\n \"EvaluationName\": \"\",\n \"MLModelId\": \"\",\n \"EvaluationDataSourceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateEvaluation" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:EvaluationId ""
:EvaluationName ""
:MLModelId ""
:EvaluationDataSourceId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateEvaluation"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"EvaluationId\": \"\",\n \"EvaluationName\": \"\",\n \"MLModelId\": \"\",\n \"EvaluationDataSourceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateEvaluation"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"EvaluationId\": \"\",\n \"EvaluationName\": \"\",\n \"MLModelId\": \"\",\n \"EvaluationDataSourceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateEvaluation");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"EvaluationId\": \"\",\n \"EvaluationName\": \"\",\n \"MLModelId\": \"\",\n \"EvaluationDataSourceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateEvaluation"
payload := strings.NewReader("{\n \"EvaluationId\": \"\",\n \"EvaluationName\": \"\",\n \"MLModelId\": \"\",\n \"EvaluationDataSourceId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 99
{
"EvaluationId": "",
"EvaluationName": "",
"MLModelId": "",
"EvaluationDataSourceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateEvaluation")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"EvaluationId\": \"\",\n \"EvaluationName\": \"\",\n \"MLModelId\": \"\",\n \"EvaluationDataSourceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateEvaluation"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"EvaluationId\": \"\",\n \"EvaluationName\": \"\",\n \"MLModelId\": \"\",\n \"EvaluationDataSourceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"EvaluationId\": \"\",\n \"EvaluationName\": \"\",\n \"MLModelId\": \"\",\n \"EvaluationDataSourceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateEvaluation")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateEvaluation")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"EvaluationId\": \"\",\n \"EvaluationName\": \"\",\n \"MLModelId\": \"\",\n \"EvaluationDataSourceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
EvaluationId: '',
EvaluationName: '',
MLModelId: '',
EvaluationDataSourceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateEvaluation');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateEvaluation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
EvaluationId: '',
EvaluationName: '',
MLModelId: '',
EvaluationDataSourceId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateEvaluation';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"EvaluationId":"","EvaluationName":"","MLModelId":"","EvaluationDataSourceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateEvaluation',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "EvaluationId": "",\n "EvaluationName": "",\n "MLModelId": "",\n "EvaluationDataSourceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"EvaluationId\": \"\",\n \"EvaluationName\": \"\",\n \"MLModelId\": \"\",\n \"EvaluationDataSourceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateEvaluation")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
EvaluationId: '',
EvaluationName: '',
MLModelId: '',
EvaluationDataSourceId: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateEvaluation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
EvaluationId: '',
EvaluationName: '',
MLModelId: '',
EvaluationDataSourceId: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateEvaluation');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
EvaluationId: '',
EvaluationName: '',
MLModelId: '',
EvaluationDataSourceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateEvaluation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
EvaluationId: '',
EvaluationName: '',
MLModelId: '',
EvaluationDataSourceId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateEvaluation';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"EvaluationId":"","EvaluationName":"","MLModelId":"","EvaluationDataSourceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"EvaluationId": @"",
@"EvaluationName": @"",
@"MLModelId": @"",
@"EvaluationDataSourceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateEvaluation"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateEvaluation" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"EvaluationId\": \"\",\n \"EvaluationName\": \"\",\n \"MLModelId\": \"\",\n \"EvaluationDataSourceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateEvaluation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'EvaluationId' => '',
'EvaluationName' => '',
'MLModelId' => '',
'EvaluationDataSourceId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateEvaluation', [
'body' => '{
"EvaluationId": "",
"EvaluationName": "",
"MLModelId": "",
"EvaluationDataSourceId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateEvaluation');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'EvaluationId' => '',
'EvaluationName' => '',
'MLModelId' => '',
'EvaluationDataSourceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'EvaluationId' => '',
'EvaluationName' => '',
'MLModelId' => '',
'EvaluationDataSourceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateEvaluation');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateEvaluation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EvaluationId": "",
"EvaluationName": "",
"MLModelId": "",
"EvaluationDataSourceId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateEvaluation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EvaluationId": "",
"EvaluationName": "",
"MLModelId": "",
"EvaluationDataSourceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"EvaluationId\": \"\",\n \"EvaluationName\": \"\",\n \"MLModelId\": \"\",\n \"EvaluationDataSourceId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateEvaluation"
payload = {
"EvaluationId": "",
"EvaluationName": "",
"MLModelId": "",
"EvaluationDataSourceId": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateEvaluation"
payload <- "{\n \"EvaluationId\": \"\",\n \"EvaluationName\": \"\",\n \"MLModelId\": \"\",\n \"EvaluationDataSourceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateEvaluation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"EvaluationId\": \"\",\n \"EvaluationName\": \"\",\n \"MLModelId\": \"\",\n \"EvaluationDataSourceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"EvaluationId\": \"\",\n \"EvaluationName\": \"\",\n \"MLModelId\": \"\",\n \"EvaluationDataSourceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateEvaluation";
let payload = json!({
"EvaluationId": "",
"EvaluationName": "",
"MLModelId": "",
"EvaluationDataSourceId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateEvaluation' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"EvaluationId": "",
"EvaluationName": "",
"MLModelId": "",
"EvaluationDataSourceId": ""
}'
echo '{
"EvaluationId": "",
"EvaluationName": "",
"MLModelId": "",
"EvaluationDataSourceId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateEvaluation' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "EvaluationId": "",\n "EvaluationName": "",\n "MLModelId": "",\n "EvaluationDataSourceId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateEvaluation'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"EvaluationId": "",
"EvaluationName": "",
"MLModelId": "",
"EvaluationDataSourceId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateEvaluation")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
CreateMLModel
{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateMLModel
HEADERS
X-Amz-Target
BODY json
{
"MLModelId": "",
"MLModelName": "",
"MLModelType": "",
"Parameters": "",
"TrainingDataSourceId": "",
"Recipe": "",
"RecipeUri": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateMLModel");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"MLModelId\": \"\",\n \"MLModelName\": \"\",\n \"MLModelType\": \"\",\n \"Parameters\": \"\",\n \"TrainingDataSourceId\": \"\",\n \"Recipe\": \"\",\n \"RecipeUri\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateMLModel" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:MLModelId ""
:MLModelName ""
:MLModelType ""
:Parameters ""
:TrainingDataSourceId ""
:Recipe ""
:RecipeUri ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateMLModel"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"MLModelId\": \"\",\n \"MLModelName\": \"\",\n \"MLModelType\": \"\",\n \"Parameters\": \"\",\n \"TrainingDataSourceId\": \"\",\n \"Recipe\": \"\",\n \"RecipeUri\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateMLModel"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"MLModelId\": \"\",\n \"MLModelName\": \"\",\n \"MLModelType\": \"\",\n \"Parameters\": \"\",\n \"TrainingDataSourceId\": \"\",\n \"Recipe\": \"\",\n \"RecipeUri\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateMLModel");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"MLModelId\": \"\",\n \"MLModelName\": \"\",\n \"MLModelType\": \"\",\n \"Parameters\": \"\",\n \"TrainingDataSourceId\": \"\",\n \"Recipe\": \"\",\n \"RecipeUri\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateMLModel"
payload := strings.NewReader("{\n \"MLModelId\": \"\",\n \"MLModelName\": \"\",\n \"MLModelType\": \"\",\n \"Parameters\": \"\",\n \"TrainingDataSourceId\": \"\",\n \"Recipe\": \"\",\n \"RecipeUri\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 148
{
"MLModelId": "",
"MLModelName": "",
"MLModelType": "",
"Parameters": "",
"TrainingDataSourceId": "",
"Recipe": "",
"RecipeUri": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateMLModel")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"MLModelId\": \"\",\n \"MLModelName\": \"\",\n \"MLModelType\": \"\",\n \"Parameters\": \"\",\n \"TrainingDataSourceId\": \"\",\n \"Recipe\": \"\",\n \"RecipeUri\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateMLModel"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"MLModelId\": \"\",\n \"MLModelName\": \"\",\n \"MLModelType\": \"\",\n \"Parameters\": \"\",\n \"TrainingDataSourceId\": \"\",\n \"Recipe\": \"\",\n \"RecipeUri\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"MLModelId\": \"\",\n \"MLModelName\": \"\",\n \"MLModelType\": \"\",\n \"Parameters\": \"\",\n \"TrainingDataSourceId\": \"\",\n \"Recipe\": \"\",\n \"RecipeUri\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateMLModel")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateMLModel")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"MLModelId\": \"\",\n \"MLModelName\": \"\",\n \"MLModelType\": \"\",\n \"Parameters\": \"\",\n \"TrainingDataSourceId\": \"\",\n \"Recipe\": \"\",\n \"RecipeUri\": \"\"\n}")
.asString();
const data = JSON.stringify({
MLModelId: '',
MLModelName: '',
MLModelType: '',
Parameters: '',
TrainingDataSourceId: '',
Recipe: '',
RecipeUri: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateMLModel');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateMLModel',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
MLModelId: '',
MLModelName: '',
MLModelType: '',
Parameters: '',
TrainingDataSourceId: '',
Recipe: '',
RecipeUri: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateMLModel';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"MLModelId":"","MLModelName":"","MLModelType":"","Parameters":"","TrainingDataSourceId":"","Recipe":"","RecipeUri":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateMLModel',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "MLModelId": "",\n "MLModelName": "",\n "MLModelType": "",\n "Parameters": "",\n "TrainingDataSourceId": "",\n "Recipe": "",\n "RecipeUri": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"MLModelId\": \"\",\n \"MLModelName\": \"\",\n \"MLModelType\": \"\",\n \"Parameters\": \"\",\n \"TrainingDataSourceId\": \"\",\n \"Recipe\": \"\",\n \"RecipeUri\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateMLModel")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
MLModelId: '',
MLModelName: '',
MLModelType: '',
Parameters: '',
TrainingDataSourceId: '',
Recipe: '',
RecipeUri: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateMLModel',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
MLModelId: '',
MLModelName: '',
MLModelType: '',
Parameters: '',
TrainingDataSourceId: '',
Recipe: '',
RecipeUri: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateMLModel');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
MLModelId: '',
MLModelName: '',
MLModelType: '',
Parameters: '',
TrainingDataSourceId: '',
Recipe: '',
RecipeUri: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateMLModel',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
MLModelId: '',
MLModelName: '',
MLModelType: '',
Parameters: '',
TrainingDataSourceId: '',
Recipe: '',
RecipeUri: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateMLModel';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"MLModelId":"","MLModelName":"","MLModelType":"","Parameters":"","TrainingDataSourceId":"","Recipe":"","RecipeUri":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"MLModelId": @"",
@"MLModelName": @"",
@"MLModelType": @"",
@"Parameters": @"",
@"TrainingDataSourceId": @"",
@"Recipe": @"",
@"RecipeUri": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateMLModel"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateMLModel" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"MLModelId\": \"\",\n \"MLModelName\": \"\",\n \"MLModelType\": \"\",\n \"Parameters\": \"\",\n \"TrainingDataSourceId\": \"\",\n \"Recipe\": \"\",\n \"RecipeUri\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateMLModel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'MLModelId' => '',
'MLModelName' => '',
'MLModelType' => '',
'Parameters' => '',
'TrainingDataSourceId' => '',
'Recipe' => '',
'RecipeUri' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateMLModel', [
'body' => '{
"MLModelId": "",
"MLModelName": "",
"MLModelType": "",
"Parameters": "",
"TrainingDataSourceId": "",
"Recipe": "",
"RecipeUri": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateMLModel');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'MLModelId' => '',
'MLModelName' => '',
'MLModelType' => '',
'Parameters' => '',
'TrainingDataSourceId' => '',
'Recipe' => '',
'RecipeUri' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'MLModelId' => '',
'MLModelName' => '',
'MLModelType' => '',
'Parameters' => '',
'TrainingDataSourceId' => '',
'Recipe' => '',
'RecipeUri' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateMLModel');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateMLModel' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"MLModelId": "",
"MLModelName": "",
"MLModelType": "",
"Parameters": "",
"TrainingDataSourceId": "",
"Recipe": "",
"RecipeUri": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateMLModel' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"MLModelId": "",
"MLModelName": "",
"MLModelType": "",
"Parameters": "",
"TrainingDataSourceId": "",
"Recipe": "",
"RecipeUri": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"MLModelId\": \"\",\n \"MLModelName\": \"\",\n \"MLModelType\": \"\",\n \"Parameters\": \"\",\n \"TrainingDataSourceId\": \"\",\n \"Recipe\": \"\",\n \"RecipeUri\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateMLModel"
payload = {
"MLModelId": "",
"MLModelName": "",
"MLModelType": "",
"Parameters": "",
"TrainingDataSourceId": "",
"Recipe": "",
"RecipeUri": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateMLModel"
payload <- "{\n \"MLModelId\": \"\",\n \"MLModelName\": \"\",\n \"MLModelType\": \"\",\n \"Parameters\": \"\",\n \"TrainingDataSourceId\": \"\",\n \"Recipe\": \"\",\n \"RecipeUri\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateMLModel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"MLModelId\": \"\",\n \"MLModelName\": \"\",\n \"MLModelType\": \"\",\n \"Parameters\": \"\",\n \"TrainingDataSourceId\": \"\",\n \"Recipe\": \"\",\n \"RecipeUri\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"MLModelId\": \"\",\n \"MLModelName\": \"\",\n \"MLModelType\": \"\",\n \"Parameters\": \"\",\n \"TrainingDataSourceId\": \"\",\n \"Recipe\": \"\",\n \"RecipeUri\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateMLModel";
let payload = json!({
"MLModelId": "",
"MLModelName": "",
"MLModelType": "",
"Parameters": "",
"TrainingDataSourceId": "",
"Recipe": "",
"RecipeUri": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateMLModel' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"MLModelId": "",
"MLModelName": "",
"MLModelType": "",
"Parameters": "",
"TrainingDataSourceId": "",
"Recipe": "",
"RecipeUri": ""
}'
echo '{
"MLModelId": "",
"MLModelName": "",
"MLModelType": "",
"Parameters": "",
"TrainingDataSourceId": "",
"Recipe": "",
"RecipeUri": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateMLModel' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "MLModelId": "",\n "MLModelName": "",\n "MLModelType": "",\n "Parameters": "",\n "TrainingDataSourceId": "",\n "Recipe": "",\n "RecipeUri": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateMLModel'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"MLModelId": "",
"MLModelName": "",
"MLModelType": "",
"Parameters": "",
"TrainingDataSourceId": "",
"Recipe": "",
"RecipeUri": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateMLModel")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
CreateRealtimeEndpoint
{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateRealtimeEndpoint
HEADERS
X-Amz-Target
BODY json
{
"MLModelId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateRealtimeEndpoint");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"MLModelId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateRealtimeEndpoint" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:MLModelId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateRealtimeEndpoint"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"MLModelId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateRealtimeEndpoint"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"MLModelId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateRealtimeEndpoint");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"MLModelId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateRealtimeEndpoint"
payload := strings.NewReader("{\n \"MLModelId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 21
{
"MLModelId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateRealtimeEndpoint")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"MLModelId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateRealtimeEndpoint"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"MLModelId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"MLModelId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateRealtimeEndpoint")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateRealtimeEndpoint")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"MLModelId\": \"\"\n}")
.asString();
const data = JSON.stringify({
MLModelId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateRealtimeEndpoint');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateRealtimeEndpoint',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {MLModelId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateRealtimeEndpoint';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"MLModelId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateRealtimeEndpoint',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "MLModelId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"MLModelId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateRealtimeEndpoint")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({MLModelId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateRealtimeEndpoint',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {MLModelId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateRealtimeEndpoint');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
MLModelId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateRealtimeEndpoint',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {MLModelId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateRealtimeEndpoint';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"MLModelId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"MLModelId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateRealtimeEndpoint"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateRealtimeEndpoint" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"MLModelId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateRealtimeEndpoint",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'MLModelId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateRealtimeEndpoint', [
'body' => '{
"MLModelId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateRealtimeEndpoint');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'MLModelId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'MLModelId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateRealtimeEndpoint');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateRealtimeEndpoint' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"MLModelId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateRealtimeEndpoint' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"MLModelId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"MLModelId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateRealtimeEndpoint"
payload = { "MLModelId": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateRealtimeEndpoint"
payload <- "{\n \"MLModelId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateRealtimeEndpoint")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"MLModelId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"MLModelId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateRealtimeEndpoint";
let payload = json!({"MLModelId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateRealtimeEndpoint' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"MLModelId": ""
}'
echo '{
"MLModelId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateRealtimeEndpoint' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "MLModelId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateRealtimeEndpoint'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["MLModelId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.CreateRealtimeEndpoint")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DeleteBatchPrediction
{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteBatchPrediction
HEADERS
X-Amz-Target
BODY json
{
"BatchPredictionId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteBatchPrediction");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"BatchPredictionId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteBatchPrediction" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:BatchPredictionId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteBatchPrediction"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"BatchPredictionId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteBatchPrediction"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"BatchPredictionId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteBatchPrediction");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"BatchPredictionId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteBatchPrediction"
payload := strings.NewReader("{\n \"BatchPredictionId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 29
{
"BatchPredictionId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteBatchPrediction")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"BatchPredictionId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteBatchPrediction"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"BatchPredictionId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"BatchPredictionId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteBatchPrediction")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteBatchPrediction")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"BatchPredictionId\": \"\"\n}")
.asString();
const data = JSON.stringify({
BatchPredictionId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteBatchPrediction');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteBatchPrediction',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {BatchPredictionId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteBatchPrediction';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"BatchPredictionId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteBatchPrediction',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "BatchPredictionId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"BatchPredictionId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteBatchPrediction")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({BatchPredictionId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteBatchPrediction',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {BatchPredictionId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteBatchPrediction');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
BatchPredictionId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteBatchPrediction',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {BatchPredictionId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteBatchPrediction';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"BatchPredictionId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"BatchPredictionId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteBatchPrediction"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteBatchPrediction" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"BatchPredictionId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteBatchPrediction",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'BatchPredictionId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteBatchPrediction', [
'body' => '{
"BatchPredictionId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteBatchPrediction');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'BatchPredictionId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'BatchPredictionId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteBatchPrediction');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteBatchPrediction' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"BatchPredictionId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteBatchPrediction' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"BatchPredictionId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"BatchPredictionId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteBatchPrediction"
payload = { "BatchPredictionId": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteBatchPrediction"
payload <- "{\n \"BatchPredictionId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteBatchPrediction")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"BatchPredictionId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"BatchPredictionId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteBatchPrediction";
let payload = json!({"BatchPredictionId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteBatchPrediction' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"BatchPredictionId": ""
}'
echo '{
"BatchPredictionId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteBatchPrediction' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "BatchPredictionId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteBatchPrediction'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["BatchPredictionId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteBatchPrediction")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, 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=AmazonML_20141212.DeleteDataSource
HEADERS
X-Amz-Target
BODY json
{
"DataSourceId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.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 \"DataSourceId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteDataSource" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DataSourceId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteDataSource"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DataSourceId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteDataSource"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DataSourceId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteDataSource");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DataSourceId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteDataSource"
payload := strings.NewReader("{\n \"DataSourceId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 24
{
"DataSourceId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteDataSource")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DataSourceId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteDataSource"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DataSourceId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DataSourceId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.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=AmazonML_20141212.DeleteDataSource")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DataSourceId\": \"\"\n}")
.asString();
const data = JSON.stringify({
DataSourceId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.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=AmazonML_20141212.DeleteDataSource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DataSourceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteDataSource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DataSourceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteDataSource',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DataSourceId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DataSourceId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.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({DataSourceId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteDataSource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DataSourceId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteDataSource');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DataSourceId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteDataSource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DataSourceId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteDataSource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DataSourceId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DataSourceId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.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=AmazonML_20141212.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 \"DataSourceId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.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([
'DataSourceId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteDataSource', [
'body' => '{
"DataSourceId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteDataSource');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DataSourceId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DataSourceId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.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=AmazonML_20141212.DeleteDataSource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DataSourceId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteDataSource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DataSourceId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DataSourceId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteDataSource"
payload = { "DataSourceId": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteDataSource"
payload <- "{\n \"DataSourceId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.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 \"DataSourceId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DataSourceId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteDataSource";
let payload = json!({"DataSourceId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteDataSource' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DataSourceId": ""
}'
echo '{
"DataSourceId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteDataSource' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DataSourceId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteDataSource'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["DataSourceId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.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
DeleteEvaluation
{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteEvaluation
HEADERS
X-Amz-Target
BODY json
{
"EvaluationId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteEvaluation");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"EvaluationId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteEvaluation" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:EvaluationId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteEvaluation"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"EvaluationId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteEvaluation"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"EvaluationId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteEvaluation");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"EvaluationId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteEvaluation"
payload := strings.NewReader("{\n \"EvaluationId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 24
{
"EvaluationId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteEvaluation")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"EvaluationId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteEvaluation"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"EvaluationId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"EvaluationId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteEvaluation")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteEvaluation")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"EvaluationId\": \"\"\n}")
.asString();
const data = JSON.stringify({
EvaluationId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteEvaluation');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteEvaluation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {EvaluationId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteEvaluation';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"EvaluationId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteEvaluation',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "EvaluationId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"EvaluationId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteEvaluation")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({EvaluationId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteEvaluation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {EvaluationId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteEvaluation');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
EvaluationId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteEvaluation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {EvaluationId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteEvaluation';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"EvaluationId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"EvaluationId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteEvaluation"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteEvaluation" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"EvaluationId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteEvaluation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'EvaluationId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteEvaluation', [
'body' => '{
"EvaluationId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteEvaluation');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'EvaluationId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'EvaluationId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteEvaluation');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteEvaluation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EvaluationId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteEvaluation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EvaluationId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"EvaluationId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteEvaluation"
payload = { "EvaluationId": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteEvaluation"
payload <- "{\n \"EvaluationId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteEvaluation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"EvaluationId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"EvaluationId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteEvaluation";
let payload = json!({"EvaluationId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteEvaluation' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"EvaluationId": ""
}'
echo '{
"EvaluationId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteEvaluation' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "EvaluationId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteEvaluation'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["EvaluationId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteEvaluation")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DeleteMLModel
{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteMLModel
HEADERS
X-Amz-Target
BODY json
{
"MLModelId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteMLModel");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"MLModelId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteMLModel" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:MLModelId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteMLModel"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"MLModelId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteMLModel"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"MLModelId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteMLModel");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"MLModelId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteMLModel"
payload := strings.NewReader("{\n \"MLModelId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 21
{
"MLModelId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteMLModel")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"MLModelId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteMLModel"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"MLModelId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"MLModelId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteMLModel")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteMLModel")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"MLModelId\": \"\"\n}")
.asString();
const data = JSON.stringify({
MLModelId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteMLModel');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteMLModel',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {MLModelId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteMLModel';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"MLModelId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteMLModel',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "MLModelId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"MLModelId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteMLModel")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({MLModelId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteMLModel',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {MLModelId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteMLModel');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
MLModelId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteMLModel',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {MLModelId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteMLModel';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"MLModelId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"MLModelId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteMLModel"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteMLModel" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"MLModelId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteMLModel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'MLModelId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteMLModel', [
'body' => '{
"MLModelId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteMLModel');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'MLModelId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'MLModelId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteMLModel');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteMLModel' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"MLModelId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteMLModel' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"MLModelId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"MLModelId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteMLModel"
payload = { "MLModelId": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteMLModel"
payload <- "{\n \"MLModelId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteMLModel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"MLModelId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"MLModelId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteMLModel";
let payload = json!({"MLModelId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteMLModel' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"MLModelId": ""
}'
echo '{
"MLModelId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteMLModel' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "MLModelId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteMLModel'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["MLModelId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteMLModel")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DeleteRealtimeEndpoint
{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteRealtimeEndpoint
HEADERS
X-Amz-Target
BODY json
{
"MLModelId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteRealtimeEndpoint");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"MLModelId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteRealtimeEndpoint" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:MLModelId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteRealtimeEndpoint"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"MLModelId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteRealtimeEndpoint"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"MLModelId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteRealtimeEndpoint");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"MLModelId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteRealtimeEndpoint"
payload := strings.NewReader("{\n \"MLModelId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 21
{
"MLModelId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteRealtimeEndpoint")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"MLModelId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteRealtimeEndpoint"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"MLModelId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"MLModelId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteRealtimeEndpoint")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteRealtimeEndpoint")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"MLModelId\": \"\"\n}")
.asString();
const data = JSON.stringify({
MLModelId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteRealtimeEndpoint');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteRealtimeEndpoint',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {MLModelId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteRealtimeEndpoint';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"MLModelId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteRealtimeEndpoint',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "MLModelId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"MLModelId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteRealtimeEndpoint")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({MLModelId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteRealtimeEndpoint',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {MLModelId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteRealtimeEndpoint');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
MLModelId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteRealtimeEndpoint',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {MLModelId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteRealtimeEndpoint';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"MLModelId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"MLModelId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteRealtimeEndpoint"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteRealtimeEndpoint" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"MLModelId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteRealtimeEndpoint",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'MLModelId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteRealtimeEndpoint', [
'body' => '{
"MLModelId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteRealtimeEndpoint');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'MLModelId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'MLModelId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteRealtimeEndpoint');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteRealtimeEndpoint' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"MLModelId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteRealtimeEndpoint' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"MLModelId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"MLModelId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteRealtimeEndpoint"
payload = { "MLModelId": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteRealtimeEndpoint"
payload <- "{\n \"MLModelId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteRealtimeEndpoint")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"MLModelId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"MLModelId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteRealtimeEndpoint";
let payload = json!({"MLModelId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteRealtimeEndpoint' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"MLModelId": ""
}'
echo '{
"MLModelId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteRealtimeEndpoint' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "MLModelId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteRealtimeEndpoint'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["MLModelId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteRealtimeEndpoint")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DeleteTags
{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteTags
HEADERS
X-Amz-Target
BODY json
{
"TagKeys": "",
"ResourceId": "",
"ResourceType": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteTags");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"TagKeys\": \"\",\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteTags" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:TagKeys ""
:ResourceId ""
:ResourceType ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteTags"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"TagKeys\": \"\",\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteTags"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"TagKeys\": \"\",\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteTags");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"TagKeys\": \"\",\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteTags"
payload := strings.NewReader("{\n \"TagKeys\": \"\",\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 61
{
"TagKeys": "",
"ResourceId": "",
"ResourceType": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteTags")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"TagKeys\": \"\",\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteTags"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"TagKeys\": \"\",\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"TagKeys\": \"\",\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteTags")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteTags")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"TagKeys\": \"\",\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}")
.asString();
const data = JSON.stringify({
TagKeys: '',
ResourceId: '',
ResourceType: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteTags');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteTags',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {TagKeys: '', ResourceId: '', ResourceType: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteTags';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"TagKeys":"","ResourceId":"","ResourceType":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteTags',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "TagKeys": "",\n "ResourceId": "",\n "ResourceType": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"TagKeys\": \"\",\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteTags")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({TagKeys: '', ResourceId: '', ResourceType: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteTags',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {TagKeys: '', ResourceId: '', ResourceType: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteTags');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
TagKeys: '',
ResourceId: '',
ResourceType: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteTags',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {TagKeys: '', ResourceId: '', ResourceType: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteTags';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"TagKeys":"","ResourceId":"","ResourceType":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"TagKeys": @"",
@"ResourceId": @"",
@"ResourceType": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteTags"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteTags" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"TagKeys\": \"\",\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteTags",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'TagKeys' => '',
'ResourceId' => '',
'ResourceType' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteTags', [
'body' => '{
"TagKeys": "",
"ResourceId": "",
"ResourceType": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteTags');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'TagKeys' => '',
'ResourceId' => '',
'ResourceType' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'TagKeys' => '',
'ResourceId' => '',
'ResourceType' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteTags');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteTags' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"TagKeys": "",
"ResourceId": "",
"ResourceType": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteTags' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"TagKeys": "",
"ResourceId": "",
"ResourceType": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"TagKeys\": \"\",\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteTags"
payload = {
"TagKeys": "",
"ResourceId": "",
"ResourceType": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteTags"
payload <- "{\n \"TagKeys\": \"\",\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteTags")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"TagKeys\": \"\",\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"TagKeys\": \"\",\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteTags";
let payload = json!({
"TagKeys": "",
"ResourceId": "",
"ResourceType": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteTags' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"TagKeys": "",
"ResourceId": "",
"ResourceType": ""
}'
echo '{
"TagKeys": "",
"ResourceId": "",
"ResourceType": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteTags' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "TagKeys": "",\n "ResourceId": "",\n "ResourceType": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteTags'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"TagKeys": "",
"ResourceId": "",
"ResourceType": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DeleteTags")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DescribeBatchPredictions
{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeBatchPredictions
HEADERS
X-Amz-Target
BODY json
{
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeBatchPredictions");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeBatchPredictions" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:FilterVariable ""
:EQ ""
:GT ""
:LT ""
:GE ""
:LE ""
:NE ""
:Prefix ""
:SortOrder ""
:NextToken ""
:Limit ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeBatchPredictions"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeBatchPredictions"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeBatchPredictions");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeBatchPredictions"
payload := strings.NewReader("{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 167
{
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeBatchPredictions")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeBatchPredictions"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeBatchPredictions")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeBatchPredictions")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
.asString();
const data = JSON.stringify({
FilterVariable: '',
EQ: '',
GT: '',
LT: '',
GE: '',
LE: '',
NE: '',
Prefix: '',
SortOrder: '',
NextToken: '',
Limit: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeBatchPredictions');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeBatchPredictions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
FilterVariable: '',
EQ: '',
GT: '',
LT: '',
GE: '',
LE: '',
NE: '',
Prefix: '',
SortOrder: '',
NextToken: '',
Limit: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeBatchPredictions';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"FilterVariable":"","EQ":"","GT":"","LT":"","GE":"","LE":"","NE":"","Prefix":"","SortOrder":"","NextToken":"","Limit":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeBatchPredictions',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "FilterVariable": "",\n "EQ": "",\n "GT": "",\n "LT": "",\n "GE": "",\n "LE": "",\n "NE": "",\n "Prefix": "",\n "SortOrder": "",\n "NextToken": "",\n "Limit": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeBatchPredictions")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
FilterVariable: '',
EQ: '',
GT: '',
LT: '',
GE: '',
LE: '',
NE: '',
Prefix: '',
SortOrder: '',
NextToken: '',
Limit: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeBatchPredictions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
FilterVariable: '',
EQ: '',
GT: '',
LT: '',
GE: '',
LE: '',
NE: '',
Prefix: '',
SortOrder: '',
NextToken: '',
Limit: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeBatchPredictions');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
FilterVariable: '',
EQ: '',
GT: '',
LT: '',
GE: '',
LE: '',
NE: '',
Prefix: '',
SortOrder: '',
NextToken: '',
Limit: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeBatchPredictions',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
FilterVariable: '',
EQ: '',
GT: '',
LT: '',
GE: '',
LE: '',
NE: '',
Prefix: '',
SortOrder: '',
NextToken: '',
Limit: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeBatchPredictions';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"FilterVariable":"","EQ":"","GT":"","LT":"","GE":"","LE":"","NE":"","Prefix":"","SortOrder":"","NextToken":"","Limit":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"FilterVariable": @"",
@"EQ": @"",
@"GT": @"",
@"LT": @"",
@"GE": @"",
@"LE": @"",
@"NE": @"",
@"Prefix": @"",
@"SortOrder": @"",
@"NextToken": @"",
@"Limit": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeBatchPredictions"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeBatchPredictions" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeBatchPredictions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'FilterVariable' => '',
'EQ' => '',
'GT' => '',
'LT' => '',
'GE' => '',
'LE' => '',
'NE' => '',
'Prefix' => '',
'SortOrder' => '',
'NextToken' => '',
'Limit' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeBatchPredictions', [
'body' => '{
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeBatchPredictions');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'FilterVariable' => '',
'EQ' => '',
'GT' => '',
'LT' => '',
'GE' => '',
'LE' => '',
'NE' => '',
'Prefix' => '',
'SortOrder' => '',
'NextToken' => '',
'Limit' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'FilterVariable' => '',
'EQ' => '',
'GT' => '',
'LT' => '',
'GE' => '',
'LE' => '',
'NE' => '',
'Prefix' => '',
'SortOrder' => '',
'NextToken' => '',
'Limit' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeBatchPredictions');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeBatchPredictions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeBatchPredictions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeBatchPredictions"
payload = {
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeBatchPredictions"
payload <- "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeBatchPredictions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeBatchPredictions";
let payload = json!({
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeBatchPredictions' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
}'
echo '{
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeBatchPredictions' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "FilterVariable": "",\n "EQ": "",\n "GT": "",\n "LT": "",\n "GE": "",\n "LE": "",\n "NE": "",\n "Prefix": "",\n "SortOrder": "",\n "NextToken": "",\n "Limit": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeBatchPredictions'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeBatchPredictions")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DescribeDataSources
{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeDataSources
HEADERS
X-Amz-Target
BODY json
{
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeDataSources");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeDataSources" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:FilterVariable ""
:EQ ""
:GT ""
:LT ""
:GE ""
:LE ""
:NE ""
:Prefix ""
:SortOrder ""
:NextToken ""
:Limit ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeDataSources"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeDataSources"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeDataSources");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeDataSources"
payload := strings.NewReader("{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 167
{
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeDataSources")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeDataSources"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeDataSources")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeDataSources")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
.asString();
const data = JSON.stringify({
FilterVariable: '',
EQ: '',
GT: '',
LT: '',
GE: '',
LE: '',
NE: '',
Prefix: '',
SortOrder: '',
NextToken: '',
Limit: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeDataSources');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeDataSources',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
FilterVariable: '',
EQ: '',
GT: '',
LT: '',
GE: '',
LE: '',
NE: '',
Prefix: '',
SortOrder: '',
NextToken: '',
Limit: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeDataSources';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"FilterVariable":"","EQ":"","GT":"","LT":"","GE":"","LE":"","NE":"","Prefix":"","SortOrder":"","NextToken":"","Limit":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeDataSources',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "FilterVariable": "",\n "EQ": "",\n "GT": "",\n "LT": "",\n "GE": "",\n "LE": "",\n "NE": "",\n "Prefix": "",\n "SortOrder": "",\n "NextToken": "",\n "Limit": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeDataSources")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
FilterVariable: '',
EQ: '',
GT: '',
LT: '',
GE: '',
LE: '',
NE: '',
Prefix: '',
SortOrder: '',
NextToken: '',
Limit: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeDataSources',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
FilterVariable: '',
EQ: '',
GT: '',
LT: '',
GE: '',
LE: '',
NE: '',
Prefix: '',
SortOrder: '',
NextToken: '',
Limit: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeDataSources');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
FilterVariable: '',
EQ: '',
GT: '',
LT: '',
GE: '',
LE: '',
NE: '',
Prefix: '',
SortOrder: '',
NextToken: '',
Limit: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeDataSources',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
FilterVariable: '',
EQ: '',
GT: '',
LT: '',
GE: '',
LE: '',
NE: '',
Prefix: '',
SortOrder: '',
NextToken: '',
Limit: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeDataSources';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"FilterVariable":"","EQ":"","GT":"","LT":"","GE":"","LE":"","NE":"","Prefix":"","SortOrder":"","NextToken":"","Limit":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"FilterVariable": @"",
@"EQ": @"",
@"GT": @"",
@"LT": @"",
@"GE": @"",
@"LE": @"",
@"NE": @"",
@"Prefix": @"",
@"SortOrder": @"",
@"NextToken": @"",
@"Limit": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeDataSources"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeDataSources" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeDataSources",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'FilterVariable' => '',
'EQ' => '',
'GT' => '',
'LT' => '',
'GE' => '',
'LE' => '',
'NE' => '',
'Prefix' => '',
'SortOrder' => '',
'NextToken' => '',
'Limit' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeDataSources', [
'body' => '{
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeDataSources');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'FilterVariable' => '',
'EQ' => '',
'GT' => '',
'LT' => '',
'GE' => '',
'LE' => '',
'NE' => '',
'Prefix' => '',
'SortOrder' => '',
'NextToken' => '',
'Limit' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'FilterVariable' => '',
'EQ' => '',
'GT' => '',
'LT' => '',
'GE' => '',
'LE' => '',
'NE' => '',
'Prefix' => '',
'SortOrder' => '',
'NextToken' => '',
'Limit' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeDataSources');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeDataSources' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeDataSources' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeDataSources"
payload = {
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeDataSources"
payload <- "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeDataSources")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeDataSources";
let payload = json!({
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeDataSources' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
}'
echo '{
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeDataSources' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "FilterVariable": "",\n "EQ": "",\n "GT": "",\n "LT": "",\n "GE": "",\n "LE": "",\n "NE": "",\n "Prefix": "",\n "SortOrder": "",\n "NextToken": "",\n "Limit": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeDataSources'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeDataSources")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DescribeEvaluations
{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeEvaluations
HEADERS
X-Amz-Target
BODY json
{
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeEvaluations");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeEvaluations" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:FilterVariable ""
:EQ ""
:GT ""
:LT ""
:GE ""
:LE ""
:NE ""
:Prefix ""
:SortOrder ""
:NextToken ""
:Limit ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeEvaluations"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeEvaluations"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeEvaluations");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeEvaluations"
payload := strings.NewReader("{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 167
{
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeEvaluations")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeEvaluations"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeEvaluations")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeEvaluations")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
.asString();
const data = JSON.stringify({
FilterVariable: '',
EQ: '',
GT: '',
LT: '',
GE: '',
LE: '',
NE: '',
Prefix: '',
SortOrder: '',
NextToken: '',
Limit: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeEvaluations');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeEvaluations',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
FilterVariable: '',
EQ: '',
GT: '',
LT: '',
GE: '',
LE: '',
NE: '',
Prefix: '',
SortOrder: '',
NextToken: '',
Limit: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeEvaluations';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"FilterVariable":"","EQ":"","GT":"","LT":"","GE":"","LE":"","NE":"","Prefix":"","SortOrder":"","NextToken":"","Limit":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeEvaluations',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "FilterVariable": "",\n "EQ": "",\n "GT": "",\n "LT": "",\n "GE": "",\n "LE": "",\n "NE": "",\n "Prefix": "",\n "SortOrder": "",\n "NextToken": "",\n "Limit": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeEvaluations")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
FilterVariable: '',
EQ: '',
GT: '',
LT: '',
GE: '',
LE: '',
NE: '',
Prefix: '',
SortOrder: '',
NextToken: '',
Limit: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeEvaluations',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
FilterVariable: '',
EQ: '',
GT: '',
LT: '',
GE: '',
LE: '',
NE: '',
Prefix: '',
SortOrder: '',
NextToken: '',
Limit: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeEvaluations');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
FilterVariable: '',
EQ: '',
GT: '',
LT: '',
GE: '',
LE: '',
NE: '',
Prefix: '',
SortOrder: '',
NextToken: '',
Limit: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeEvaluations',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
FilterVariable: '',
EQ: '',
GT: '',
LT: '',
GE: '',
LE: '',
NE: '',
Prefix: '',
SortOrder: '',
NextToken: '',
Limit: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeEvaluations';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"FilterVariable":"","EQ":"","GT":"","LT":"","GE":"","LE":"","NE":"","Prefix":"","SortOrder":"","NextToken":"","Limit":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"FilterVariable": @"",
@"EQ": @"",
@"GT": @"",
@"LT": @"",
@"GE": @"",
@"LE": @"",
@"NE": @"",
@"Prefix": @"",
@"SortOrder": @"",
@"NextToken": @"",
@"Limit": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeEvaluations"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeEvaluations" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeEvaluations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'FilterVariable' => '',
'EQ' => '',
'GT' => '',
'LT' => '',
'GE' => '',
'LE' => '',
'NE' => '',
'Prefix' => '',
'SortOrder' => '',
'NextToken' => '',
'Limit' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeEvaluations', [
'body' => '{
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeEvaluations');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'FilterVariable' => '',
'EQ' => '',
'GT' => '',
'LT' => '',
'GE' => '',
'LE' => '',
'NE' => '',
'Prefix' => '',
'SortOrder' => '',
'NextToken' => '',
'Limit' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'FilterVariable' => '',
'EQ' => '',
'GT' => '',
'LT' => '',
'GE' => '',
'LE' => '',
'NE' => '',
'Prefix' => '',
'SortOrder' => '',
'NextToken' => '',
'Limit' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeEvaluations');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeEvaluations' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeEvaluations' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeEvaluations"
payload = {
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeEvaluations"
payload <- "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeEvaluations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeEvaluations";
let payload = json!({
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeEvaluations' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
}'
echo '{
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeEvaluations' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "FilterVariable": "",\n "EQ": "",\n "GT": "",\n "LT": "",\n "GE": "",\n "LE": "",\n "NE": "",\n "Prefix": "",\n "SortOrder": "",\n "NextToken": "",\n "Limit": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeEvaluations'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeEvaluations")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DescribeMLModels
{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeMLModels
HEADERS
X-Amz-Target
BODY json
{
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeMLModels");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeMLModels" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:FilterVariable ""
:EQ ""
:GT ""
:LT ""
:GE ""
:LE ""
:NE ""
:Prefix ""
:SortOrder ""
:NextToken ""
:Limit ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeMLModels"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeMLModels"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeMLModels");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeMLModels"
payload := strings.NewReader("{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 167
{
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeMLModels")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeMLModels"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeMLModels")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeMLModels")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
.asString();
const data = JSON.stringify({
FilterVariable: '',
EQ: '',
GT: '',
LT: '',
GE: '',
LE: '',
NE: '',
Prefix: '',
SortOrder: '',
NextToken: '',
Limit: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeMLModels');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeMLModels',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
FilterVariable: '',
EQ: '',
GT: '',
LT: '',
GE: '',
LE: '',
NE: '',
Prefix: '',
SortOrder: '',
NextToken: '',
Limit: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeMLModels';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"FilterVariable":"","EQ":"","GT":"","LT":"","GE":"","LE":"","NE":"","Prefix":"","SortOrder":"","NextToken":"","Limit":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeMLModels',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "FilterVariable": "",\n "EQ": "",\n "GT": "",\n "LT": "",\n "GE": "",\n "LE": "",\n "NE": "",\n "Prefix": "",\n "SortOrder": "",\n "NextToken": "",\n "Limit": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeMLModels")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
FilterVariable: '',
EQ: '',
GT: '',
LT: '',
GE: '',
LE: '',
NE: '',
Prefix: '',
SortOrder: '',
NextToken: '',
Limit: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeMLModels',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {
FilterVariable: '',
EQ: '',
GT: '',
LT: '',
GE: '',
LE: '',
NE: '',
Prefix: '',
SortOrder: '',
NextToken: '',
Limit: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeMLModels');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
FilterVariable: '',
EQ: '',
GT: '',
LT: '',
GE: '',
LE: '',
NE: '',
Prefix: '',
SortOrder: '',
NextToken: '',
Limit: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeMLModels',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {
FilterVariable: '',
EQ: '',
GT: '',
LT: '',
GE: '',
LE: '',
NE: '',
Prefix: '',
SortOrder: '',
NextToken: '',
Limit: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeMLModels';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"FilterVariable":"","EQ":"","GT":"","LT":"","GE":"","LE":"","NE":"","Prefix":"","SortOrder":"","NextToken":"","Limit":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"FilterVariable": @"",
@"EQ": @"",
@"GT": @"",
@"LT": @"",
@"GE": @"",
@"LE": @"",
@"NE": @"",
@"Prefix": @"",
@"SortOrder": @"",
@"NextToken": @"",
@"Limit": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeMLModels"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeMLModels" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeMLModels",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'FilterVariable' => '',
'EQ' => '',
'GT' => '',
'LT' => '',
'GE' => '',
'LE' => '',
'NE' => '',
'Prefix' => '',
'SortOrder' => '',
'NextToken' => '',
'Limit' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeMLModels', [
'body' => '{
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeMLModels');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'FilterVariable' => '',
'EQ' => '',
'GT' => '',
'LT' => '',
'GE' => '',
'LE' => '',
'NE' => '',
'Prefix' => '',
'SortOrder' => '',
'NextToken' => '',
'Limit' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'FilterVariable' => '',
'EQ' => '',
'GT' => '',
'LT' => '',
'GE' => '',
'LE' => '',
'NE' => '',
'Prefix' => '',
'SortOrder' => '',
'NextToken' => '',
'Limit' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeMLModels');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeMLModels' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeMLModels' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeMLModels"
payload = {
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeMLModels"
payload <- "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeMLModels")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"FilterVariable\": \"\",\n \"EQ\": \"\",\n \"GT\": \"\",\n \"LT\": \"\",\n \"GE\": \"\",\n \"LE\": \"\",\n \"NE\": \"\",\n \"Prefix\": \"\",\n \"SortOrder\": \"\",\n \"NextToken\": \"\",\n \"Limit\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeMLModels";
let payload = json!({
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeMLModels' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
}'
echo '{
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeMLModels' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "FilterVariable": "",\n "EQ": "",\n "GT": "",\n "LT": "",\n "GE": "",\n "LE": "",\n "NE": "",\n "Prefix": "",\n "SortOrder": "",\n "NextToken": "",\n "Limit": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeMLModels'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"FilterVariable": "",
"EQ": "",
"GT": "",
"LT": "",
"GE": "",
"LE": "",
"NE": "",
"Prefix": "",
"SortOrder": "",
"NextToken": "",
"Limit": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeMLModels")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DescribeTags
{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeTags
HEADERS
X-Amz-Target
BODY json
{
"ResourceId": "",
"ResourceType": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeTags");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeTags" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ResourceId ""
:ResourceType ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeTags"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeTags"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeTags");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeTags"
payload := strings.NewReader("{\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 44
{
"ResourceId": "",
"ResourceType": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeTags")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeTags"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeTags")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeTags")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}")
.asString();
const data = JSON.stringify({
ResourceId: '',
ResourceType: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeTags');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeTags',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ResourceId: '', ResourceType: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeTags';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ResourceId":"","ResourceType":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeTags',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ResourceId": "",\n "ResourceType": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeTags")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({ResourceId: '', ResourceType: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeTags',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {ResourceId: '', ResourceType: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeTags');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ResourceId: '',
ResourceType: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeTags',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ResourceId: '', ResourceType: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeTags';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ResourceId":"","ResourceType":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"ResourceId": @"",
@"ResourceType": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeTags"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeTags" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeTags",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ResourceId' => '',
'ResourceType' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeTags', [
'body' => '{
"ResourceId": "",
"ResourceType": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeTags');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ResourceId' => '',
'ResourceType' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ResourceId' => '',
'ResourceType' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeTags');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeTags' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ResourceId": "",
"ResourceType": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeTags' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ResourceId": "",
"ResourceType": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeTags"
payload = {
"ResourceId": "",
"ResourceType": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeTags"
payload <- "{\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeTags")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"ResourceId\": \"\",\n \"ResourceType\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeTags";
let payload = json!({
"ResourceId": "",
"ResourceType": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeTags' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ResourceId": "",
"ResourceType": ""
}'
echo '{
"ResourceId": "",
"ResourceType": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeTags' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ResourceId": "",\n "ResourceType": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeTags'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"ResourceId": "",
"ResourceType": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.DescribeTags")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
GetBatchPrediction
{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetBatchPrediction
HEADERS
X-Amz-Target
BODY json
{
"BatchPredictionId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetBatchPrediction");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"BatchPredictionId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetBatchPrediction" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:BatchPredictionId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetBatchPrediction"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"BatchPredictionId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetBatchPrediction"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"BatchPredictionId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetBatchPrediction");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"BatchPredictionId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetBatchPrediction"
payload := strings.NewReader("{\n \"BatchPredictionId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 29
{
"BatchPredictionId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetBatchPrediction")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"BatchPredictionId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetBatchPrediction"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"BatchPredictionId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"BatchPredictionId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetBatchPrediction")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetBatchPrediction")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"BatchPredictionId\": \"\"\n}")
.asString();
const data = JSON.stringify({
BatchPredictionId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetBatchPrediction');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetBatchPrediction',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {BatchPredictionId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetBatchPrediction';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"BatchPredictionId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetBatchPrediction',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "BatchPredictionId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"BatchPredictionId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetBatchPrediction")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({BatchPredictionId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetBatchPrediction',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {BatchPredictionId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetBatchPrediction');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
BatchPredictionId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetBatchPrediction',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {BatchPredictionId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetBatchPrediction';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"BatchPredictionId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"BatchPredictionId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetBatchPrediction"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetBatchPrediction" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"BatchPredictionId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetBatchPrediction",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'BatchPredictionId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetBatchPrediction', [
'body' => '{
"BatchPredictionId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetBatchPrediction');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'BatchPredictionId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'BatchPredictionId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetBatchPrediction');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetBatchPrediction' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"BatchPredictionId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetBatchPrediction' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"BatchPredictionId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"BatchPredictionId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetBatchPrediction"
payload = { "BatchPredictionId": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetBatchPrediction"
payload <- "{\n \"BatchPredictionId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetBatchPrediction")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"BatchPredictionId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"BatchPredictionId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetBatchPrediction";
let payload = json!({"BatchPredictionId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetBatchPrediction' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"BatchPredictionId": ""
}'
echo '{
"BatchPredictionId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetBatchPrediction' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "BatchPredictionId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetBatchPrediction'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["BatchPredictionId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetBatchPrediction")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
GetDataSource
{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetDataSource
HEADERS
X-Amz-Target
BODY json
{
"DataSourceId": "",
"Verbose": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetDataSource");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"DataSourceId\": \"\",\n \"Verbose\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetDataSource" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DataSourceId ""
:Verbose ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetDataSource"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DataSourceId\": \"\",\n \"Verbose\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetDataSource"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DataSourceId\": \"\",\n \"Verbose\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetDataSource");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DataSourceId\": \"\",\n \"Verbose\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetDataSource"
payload := strings.NewReader("{\n \"DataSourceId\": \"\",\n \"Verbose\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
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
{
"DataSourceId": "",
"Verbose": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetDataSource")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DataSourceId\": \"\",\n \"Verbose\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetDataSource"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DataSourceId\": \"\",\n \"Verbose\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DataSourceId\": \"\",\n \"Verbose\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetDataSource")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetDataSource")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DataSourceId\": \"\",\n \"Verbose\": \"\"\n}")
.asString();
const data = JSON.stringify({
DataSourceId: '',
Verbose: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetDataSource');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetDataSource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DataSourceId: '', Verbose: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetDataSource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DataSourceId":"","Verbose":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetDataSource',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DataSourceId": "",\n "Verbose": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DataSourceId\": \"\",\n \"Verbose\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetDataSource")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({DataSourceId: '', Verbose: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetDataSource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DataSourceId: '', Verbose: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetDataSource');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DataSourceId: '',
Verbose: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetDataSource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DataSourceId: '', Verbose: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetDataSource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DataSourceId":"","Verbose":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DataSourceId": @"",
@"Verbose": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetDataSource"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetDataSource" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"DataSourceId\": \"\",\n \"Verbose\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetDataSource",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'DataSourceId' => '',
'Verbose' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetDataSource', [
'body' => '{
"DataSourceId": "",
"Verbose": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetDataSource');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DataSourceId' => '',
'Verbose' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DataSourceId' => '',
'Verbose' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetDataSource');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetDataSource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DataSourceId": "",
"Verbose": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetDataSource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DataSourceId": "",
"Verbose": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DataSourceId\": \"\",\n \"Verbose\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetDataSource"
payload = {
"DataSourceId": "",
"Verbose": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetDataSource"
payload <- "{\n \"DataSourceId\": \"\",\n \"Verbose\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetDataSource")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"DataSourceId\": \"\",\n \"Verbose\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DataSourceId\": \"\",\n \"Verbose\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetDataSource";
let payload = json!({
"DataSourceId": "",
"Verbose": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetDataSource' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DataSourceId": "",
"Verbose": ""
}'
echo '{
"DataSourceId": "",
"Verbose": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetDataSource' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DataSourceId": "",\n "Verbose": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetDataSource'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DataSourceId": "",
"Verbose": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetDataSource")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
GetEvaluation
{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetEvaluation
HEADERS
X-Amz-Target
BODY json
{
"EvaluationId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetEvaluation");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"EvaluationId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetEvaluation" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:EvaluationId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetEvaluation"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"EvaluationId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetEvaluation"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"EvaluationId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetEvaluation");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"EvaluationId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetEvaluation"
payload := strings.NewReader("{\n \"EvaluationId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 24
{
"EvaluationId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetEvaluation")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"EvaluationId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetEvaluation"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"EvaluationId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"EvaluationId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetEvaluation")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetEvaluation")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"EvaluationId\": \"\"\n}")
.asString();
const data = JSON.stringify({
EvaluationId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetEvaluation');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetEvaluation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {EvaluationId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetEvaluation';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"EvaluationId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetEvaluation',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "EvaluationId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"EvaluationId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetEvaluation")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({EvaluationId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetEvaluation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {EvaluationId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetEvaluation');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
EvaluationId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetEvaluation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {EvaluationId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetEvaluation';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"EvaluationId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"EvaluationId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetEvaluation"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetEvaluation" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"EvaluationId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetEvaluation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'EvaluationId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetEvaluation', [
'body' => '{
"EvaluationId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetEvaluation');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'EvaluationId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'EvaluationId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetEvaluation');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetEvaluation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EvaluationId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetEvaluation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EvaluationId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"EvaluationId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetEvaluation"
payload = { "EvaluationId": "" }
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetEvaluation"
payload <- "{\n \"EvaluationId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetEvaluation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"EvaluationId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"EvaluationId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetEvaluation";
let payload = json!({"EvaluationId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetEvaluation' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"EvaluationId": ""
}'
echo '{
"EvaluationId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetEvaluation' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "EvaluationId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetEvaluation'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = ["EvaluationId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetEvaluation")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
GetMLModel
{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetMLModel
HEADERS
X-Amz-Target
BODY json
{
"MLModelId": "",
"Verbose": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetMLModel");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"MLModelId\": \"\",\n \"Verbose\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetMLModel" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:MLModelId ""
:Verbose ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetMLModel"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"MLModelId\": \"\",\n \"Verbose\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetMLModel"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"MLModelId\": \"\",\n \"Verbose\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetMLModel");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"MLModelId\": \"\",\n \"Verbose\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetMLModel"
payload := strings.NewReader("{\n \"MLModelId\": \"\",\n \"Verbose\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 38
{
"MLModelId": "",
"Verbose": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetMLModel")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"MLModelId\": \"\",\n \"Verbose\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetMLModel"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"MLModelId\": \"\",\n \"Verbose\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"MLModelId\": \"\",\n \"Verbose\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetMLModel")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetMLModel")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"MLModelId\": \"\",\n \"Verbose\": \"\"\n}")
.asString();
const data = JSON.stringify({
MLModelId: '',
Verbose: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetMLModel');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetMLModel',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {MLModelId: '', Verbose: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetMLModel';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"MLModelId":"","Verbose":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetMLModel',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "MLModelId": "",\n "Verbose": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"MLModelId\": \"\",\n \"Verbose\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetMLModel")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({MLModelId: '', Verbose: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetMLModel',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {MLModelId: '', Verbose: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetMLModel');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
MLModelId: '',
Verbose: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetMLModel',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {MLModelId: '', Verbose: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetMLModel';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"MLModelId":"","Verbose":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"MLModelId": @"",
@"Verbose": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetMLModel"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetMLModel" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"MLModelId\": \"\",\n \"Verbose\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetMLModel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'MLModelId' => '',
'Verbose' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetMLModel', [
'body' => '{
"MLModelId": "",
"Verbose": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetMLModel');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'MLModelId' => '',
'Verbose' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'MLModelId' => '',
'Verbose' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetMLModel');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetMLModel' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"MLModelId": "",
"Verbose": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetMLModel' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"MLModelId": "",
"Verbose": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"MLModelId\": \"\",\n \"Verbose\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetMLModel"
payload = {
"MLModelId": "",
"Verbose": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetMLModel"
payload <- "{\n \"MLModelId\": \"\",\n \"Verbose\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetMLModel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"MLModelId\": \"\",\n \"Verbose\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"MLModelId\": \"\",\n \"Verbose\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetMLModel";
let payload = json!({
"MLModelId": "",
"Verbose": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetMLModel' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"MLModelId": "",
"Verbose": ""
}'
echo '{
"MLModelId": "",
"Verbose": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetMLModel' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "MLModelId": "",\n "Verbose": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetMLModel'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"MLModelId": "",
"Verbose": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.GetMLModel")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Predict
{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.Predict
HEADERS
X-Amz-Target
BODY json
{
"MLModelId": "",
"Record": {},
"PredictEndpoint": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.Predict");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"MLModelId\": \"\",\n \"Record\": {},\n \"PredictEndpoint\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.Predict" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:MLModelId ""
:Record {}
:PredictEndpoint ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.Predict"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"MLModelId\": \"\",\n \"Record\": {},\n \"PredictEndpoint\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.Predict"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"MLModelId\": \"\",\n \"Record\": {},\n \"PredictEndpoint\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.Predict");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"MLModelId\": \"\",\n \"Record\": {},\n \"PredictEndpoint\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.Predict"
payload := strings.NewReader("{\n \"MLModelId\": \"\",\n \"Record\": {},\n \"PredictEndpoint\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 62
{
"MLModelId": "",
"Record": {},
"PredictEndpoint": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.Predict")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"MLModelId\": \"\",\n \"Record\": {},\n \"PredictEndpoint\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.Predict"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"MLModelId\": \"\",\n \"Record\": {},\n \"PredictEndpoint\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"MLModelId\": \"\",\n \"Record\": {},\n \"PredictEndpoint\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.Predict")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.Predict")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"MLModelId\": \"\",\n \"Record\": {},\n \"PredictEndpoint\": \"\"\n}")
.asString();
const data = JSON.stringify({
MLModelId: '',
Record: {},
PredictEndpoint: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.Predict');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.Predict',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {MLModelId: '', Record: {}, PredictEndpoint: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.Predict';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"MLModelId":"","Record":{},"PredictEndpoint":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.Predict',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "MLModelId": "",\n "Record": {},\n "PredictEndpoint": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"MLModelId\": \"\",\n \"Record\": {},\n \"PredictEndpoint\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.Predict")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({MLModelId: '', Record: {}, PredictEndpoint: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.Predict',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {MLModelId: '', Record: {}, PredictEndpoint: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.Predict');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
MLModelId: '',
Record: {},
PredictEndpoint: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.Predict',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {MLModelId: '', Record: {}, PredictEndpoint: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.Predict';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"MLModelId":"","Record":{},"PredictEndpoint":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"MLModelId": @"",
@"Record": @{ },
@"PredictEndpoint": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.Predict"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.Predict" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"MLModelId\": \"\",\n \"Record\": {},\n \"PredictEndpoint\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.Predict",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'MLModelId' => '',
'Record' => [
],
'PredictEndpoint' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.Predict', [
'body' => '{
"MLModelId": "",
"Record": {},
"PredictEndpoint": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.Predict');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'MLModelId' => '',
'Record' => [
],
'PredictEndpoint' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'MLModelId' => '',
'Record' => [
],
'PredictEndpoint' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.Predict');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.Predict' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"MLModelId": "",
"Record": {},
"PredictEndpoint": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.Predict' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"MLModelId": "",
"Record": {},
"PredictEndpoint": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"MLModelId\": \"\",\n \"Record\": {},\n \"PredictEndpoint\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.Predict"
payload = {
"MLModelId": "",
"Record": {},
"PredictEndpoint": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.Predict"
payload <- "{\n \"MLModelId\": \"\",\n \"Record\": {},\n \"PredictEndpoint\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.Predict")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"MLModelId\": \"\",\n \"Record\": {},\n \"PredictEndpoint\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"MLModelId\": \"\",\n \"Record\": {},\n \"PredictEndpoint\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.Predict";
let payload = json!({
"MLModelId": "",
"Record": json!({}),
"PredictEndpoint": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.Predict' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"MLModelId": "",
"Record": {},
"PredictEndpoint": ""
}'
echo '{
"MLModelId": "",
"Record": {},
"PredictEndpoint": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.Predict' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "MLModelId": "",\n "Record": {},\n "PredictEndpoint": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.Predict'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"MLModelId": "",
"Record": [],
"PredictEndpoint": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.Predict")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
UpdateBatchPrediction
{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateBatchPrediction
HEADERS
X-Amz-Target
BODY json
{
"BatchPredictionId": "",
"BatchPredictionName": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateBatchPrediction");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"BatchPredictionId\": \"\",\n \"BatchPredictionName\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateBatchPrediction" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:BatchPredictionId ""
:BatchPredictionName ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateBatchPrediction"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"BatchPredictionId\": \"\",\n \"BatchPredictionName\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateBatchPrediction"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"BatchPredictionId\": \"\",\n \"BatchPredictionName\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateBatchPrediction");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"BatchPredictionId\": \"\",\n \"BatchPredictionName\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateBatchPrediction"
payload := strings.NewReader("{\n \"BatchPredictionId\": \"\",\n \"BatchPredictionName\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
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
{
"BatchPredictionId": "",
"BatchPredictionName": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateBatchPrediction")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"BatchPredictionId\": \"\",\n \"BatchPredictionName\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateBatchPrediction"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"BatchPredictionId\": \"\",\n \"BatchPredictionName\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"BatchPredictionId\": \"\",\n \"BatchPredictionName\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateBatchPrediction")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateBatchPrediction")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"BatchPredictionId\": \"\",\n \"BatchPredictionName\": \"\"\n}")
.asString();
const data = JSON.stringify({
BatchPredictionId: '',
BatchPredictionName: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateBatchPrediction');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateBatchPrediction',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {BatchPredictionId: '', BatchPredictionName: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateBatchPrediction';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"BatchPredictionId":"","BatchPredictionName":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateBatchPrediction',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "BatchPredictionId": "",\n "BatchPredictionName": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"BatchPredictionId\": \"\",\n \"BatchPredictionName\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateBatchPrediction")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({BatchPredictionId: '', BatchPredictionName: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateBatchPrediction',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {BatchPredictionId: '', BatchPredictionName: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateBatchPrediction');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
BatchPredictionId: '',
BatchPredictionName: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateBatchPrediction',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {BatchPredictionId: '', BatchPredictionName: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateBatchPrediction';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"BatchPredictionId":"","BatchPredictionName":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"BatchPredictionId": @"",
@"BatchPredictionName": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateBatchPrediction"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateBatchPrediction" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"BatchPredictionId\": \"\",\n \"BatchPredictionName\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateBatchPrediction",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'BatchPredictionId' => '',
'BatchPredictionName' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateBatchPrediction', [
'body' => '{
"BatchPredictionId": "",
"BatchPredictionName": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateBatchPrediction');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'BatchPredictionId' => '',
'BatchPredictionName' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'BatchPredictionId' => '',
'BatchPredictionName' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateBatchPrediction');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateBatchPrediction' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"BatchPredictionId": "",
"BatchPredictionName": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateBatchPrediction' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"BatchPredictionId": "",
"BatchPredictionName": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"BatchPredictionId\": \"\",\n \"BatchPredictionName\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateBatchPrediction"
payload = {
"BatchPredictionId": "",
"BatchPredictionName": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateBatchPrediction"
payload <- "{\n \"BatchPredictionId\": \"\",\n \"BatchPredictionName\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateBatchPrediction")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"BatchPredictionId\": \"\",\n \"BatchPredictionName\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"BatchPredictionId\": \"\",\n \"BatchPredictionName\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateBatchPrediction";
let payload = json!({
"BatchPredictionId": "",
"BatchPredictionName": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateBatchPrediction' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"BatchPredictionId": "",
"BatchPredictionName": ""
}'
echo '{
"BatchPredictionId": "",
"BatchPredictionName": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateBatchPrediction' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "BatchPredictionId": "",\n "BatchPredictionName": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateBatchPrediction'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"BatchPredictionId": "",
"BatchPredictionName": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateBatchPrediction")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, 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=AmazonML_20141212.UpdateDataSource
HEADERS
X-Amz-Target
BODY json
{
"DataSourceId": "",
"DataSourceName": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.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 \"DataSourceId\": \"\",\n \"DataSourceName\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateDataSource" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:DataSourceId ""
:DataSourceName ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateDataSource"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateDataSource"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateDataSource");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateDataSource"
payload := strings.NewReader("{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 48
{
"DataSourceId": "",
"DataSourceName": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateDataSource")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateDataSource"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.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=AmazonML_20141212.UpdateDataSource")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\"\n}")
.asString();
const data = JSON.stringify({
DataSourceId: '',
DataSourceName: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.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=AmazonML_20141212.UpdateDataSource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DataSourceId: '', DataSourceName: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateDataSource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DataSourceId":"","DataSourceName":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateDataSource',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "DataSourceId": "",\n "DataSourceName": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.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({DataSourceId: '', DataSourceName: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateDataSource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {DataSourceId: '', DataSourceName: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateDataSource');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
DataSourceId: '',
DataSourceName: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateDataSource',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {DataSourceId: '', DataSourceName: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateDataSource';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"DataSourceId":"","DataSourceName":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"DataSourceId": @"",
@"DataSourceName": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.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=AmazonML_20141212.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 \"DataSourceId\": \"\",\n \"DataSourceName\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.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([
'DataSourceId' => '',
'DataSourceName' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateDataSource', [
'body' => '{
"DataSourceId": "",
"DataSourceName": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateDataSource');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'DataSourceId' => '',
'DataSourceName' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'DataSourceId' => '',
'DataSourceName' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.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=AmazonML_20141212.UpdateDataSource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DataSourceId": "",
"DataSourceName": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateDataSource' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"DataSourceId": "",
"DataSourceName": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateDataSource"
payload = {
"DataSourceId": "",
"DataSourceName": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateDataSource"
payload <- "{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.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 \"DataSourceId\": \"\",\n \"DataSourceName\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"DataSourceId\": \"\",\n \"DataSourceName\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateDataSource";
let payload = json!({
"DataSourceId": "",
"DataSourceName": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateDataSource' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"DataSourceId": "",
"DataSourceName": ""
}'
echo '{
"DataSourceId": "",
"DataSourceName": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateDataSource' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "DataSourceId": "",\n "DataSourceName": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateDataSource'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"DataSourceId": "",
"DataSourceName": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.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
UpdateEvaluation
{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateEvaluation
HEADERS
X-Amz-Target
BODY json
{
"EvaluationId": "",
"EvaluationName": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateEvaluation");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"EvaluationId\": \"\",\n \"EvaluationName\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateEvaluation" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:EvaluationId ""
:EvaluationName ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateEvaluation"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"EvaluationId\": \"\",\n \"EvaluationName\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateEvaluation"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"EvaluationId\": \"\",\n \"EvaluationName\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateEvaluation");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"EvaluationId\": \"\",\n \"EvaluationName\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateEvaluation"
payload := strings.NewReader("{\n \"EvaluationId\": \"\",\n \"EvaluationName\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 48
{
"EvaluationId": "",
"EvaluationName": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateEvaluation")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"EvaluationId\": \"\",\n \"EvaluationName\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateEvaluation"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"EvaluationId\": \"\",\n \"EvaluationName\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"EvaluationId\": \"\",\n \"EvaluationName\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateEvaluation")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateEvaluation")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"EvaluationId\": \"\",\n \"EvaluationName\": \"\"\n}")
.asString();
const data = JSON.stringify({
EvaluationId: '',
EvaluationName: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateEvaluation');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateEvaluation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {EvaluationId: '', EvaluationName: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateEvaluation';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"EvaluationId":"","EvaluationName":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateEvaluation',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "EvaluationId": "",\n "EvaluationName": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"EvaluationId\": \"\",\n \"EvaluationName\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateEvaluation")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({EvaluationId: '', EvaluationName: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateEvaluation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {EvaluationId: '', EvaluationName: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateEvaluation');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
EvaluationId: '',
EvaluationName: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateEvaluation',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {EvaluationId: '', EvaluationName: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateEvaluation';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"EvaluationId":"","EvaluationName":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"EvaluationId": @"",
@"EvaluationName": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateEvaluation"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateEvaluation" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"EvaluationId\": \"\",\n \"EvaluationName\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateEvaluation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'EvaluationId' => '',
'EvaluationName' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateEvaluation', [
'body' => '{
"EvaluationId": "",
"EvaluationName": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateEvaluation');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'EvaluationId' => '',
'EvaluationName' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'EvaluationId' => '',
'EvaluationName' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateEvaluation');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateEvaluation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EvaluationId": "",
"EvaluationName": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateEvaluation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"EvaluationId": "",
"EvaluationName": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"EvaluationId\": \"\",\n \"EvaluationName\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateEvaluation"
payload = {
"EvaluationId": "",
"EvaluationName": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateEvaluation"
payload <- "{\n \"EvaluationId\": \"\",\n \"EvaluationName\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateEvaluation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"EvaluationId\": \"\",\n \"EvaluationName\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"EvaluationId\": \"\",\n \"EvaluationName\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateEvaluation";
let payload = json!({
"EvaluationId": "",
"EvaluationName": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateEvaluation' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"EvaluationId": "",
"EvaluationName": ""
}'
echo '{
"EvaluationId": "",
"EvaluationName": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateEvaluation' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "EvaluationId": "",\n "EvaluationName": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateEvaluation'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"EvaluationId": "",
"EvaluationName": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateEvaluation")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
UpdateMLModel
{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateMLModel
HEADERS
X-Amz-Target
BODY json
{
"MLModelId": "",
"MLModelName": "",
"ScoreThreshold": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateMLModel");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"MLModelId\": \"\",\n \"MLModelName\": \"\",\n \"ScoreThreshold\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateMLModel" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:MLModelId ""
:MLModelName ""
:ScoreThreshold ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateMLModel"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"MLModelId\": \"\",\n \"MLModelName\": \"\",\n \"ScoreThreshold\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateMLModel"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"MLModelId\": \"\",\n \"MLModelName\": \"\",\n \"ScoreThreshold\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateMLModel");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"MLModelId\": \"\",\n \"MLModelName\": \"\",\n \"ScoreThreshold\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateMLModel"
payload := strings.NewReader("{\n \"MLModelId\": \"\",\n \"MLModelName\": \"\",\n \"ScoreThreshold\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 66
{
"MLModelId": "",
"MLModelName": "",
"ScoreThreshold": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateMLModel")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"MLModelId\": \"\",\n \"MLModelName\": \"\",\n \"ScoreThreshold\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateMLModel"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"MLModelId\": \"\",\n \"MLModelName\": \"\",\n \"ScoreThreshold\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"MLModelId\": \"\",\n \"MLModelName\": \"\",\n \"ScoreThreshold\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateMLModel")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateMLModel")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"MLModelId\": \"\",\n \"MLModelName\": \"\",\n \"ScoreThreshold\": \"\"\n}")
.asString();
const data = JSON.stringify({
MLModelId: '',
MLModelName: '',
ScoreThreshold: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateMLModel');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateMLModel',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {MLModelId: '', MLModelName: '', ScoreThreshold: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateMLModel';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"MLModelId":"","MLModelName":"","ScoreThreshold":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateMLModel',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "MLModelId": "",\n "MLModelName": "",\n "ScoreThreshold": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"MLModelId\": \"\",\n \"MLModelName\": \"\",\n \"ScoreThreshold\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateMLModel")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({MLModelId: '', MLModelName: '', ScoreThreshold: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateMLModel',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {MLModelId: '', MLModelName: '', ScoreThreshold: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateMLModel');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
MLModelId: '',
MLModelName: '',
ScoreThreshold: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateMLModel',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {MLModelId: '', MLModelName: '', ScoreThreshold: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateMLModel';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"MLModelId":"","MLModelName":"","ScoreThreshold":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"MLModelId": @"",
@"MLModelName": @"",
@"ScoreThreshold": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateMLModel"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateMLModel" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"MLModelId\": \"\",\n \"MLModelName\": \"\",\n \"ScoreThreshold\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateMLModel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'MLModelId' => '',
'MLModelName' => '',
'ScoreThreshold' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateMLModel', [
'body' => '{
"MLModelId": "",
"MLModelName": "",
"ScoreThreshold": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateMLModel');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'MLModelId' => '',
'MLModelName' => '',
'ScoreThreshold' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'MLModelId' => '',
'MLModelName' => '',
'ScoreThreshold' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateMLModel');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateMLModel' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"MLModelId": "",
"MLModelName": "",
"ScoreThreshold": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateMLModel' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"MLModelId": "",
"MLModelName": "",
"ScoreThreshold": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"MLModelId\": \"\",\n \"MLModelName\": \"\",\n \"ScoreThreshold\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateMLModel"
payload = {
"MLModelId": "",
"MLModelName": "",
"ScoreThreshold": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateMLModel"
payload <- "{\n \"MLModelId\": \"\",\n \"MLModelName\": \"\",\n \"ScoreThreshold\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateMLModel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"MLModelId\": \"\",\n \"MLModelName\": \"\",\n \"ScoreThreshold\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"MLModelId\": \"\",\n \"MLModelName\": \"\",\n \"ScoreThreshold\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateMLModel";
let payload = json!({
"MLModelId": "",
"MLModelName": "",
"ScoreThreshold": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateMLModel' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"MLModelId": "",
"MLModelName": "",
"ScoreThreshold": ""
}'
echo '{
"MLModelId": "",
"MLModelName": "",
"ScoreThreshold": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateMLModel' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "MLModelId": "",\n "MLModelName": "",\n "ScoreThreshold": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateMLModel'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"MLModelId": "",
"MLModelName": "",
"ScoreThreshold": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=AmazonML_20141212.UpdateMLModel")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()