Braket
PUT
CancelJob
{{baseUrl}}/job/:jobArn/cancel
QUERY PARAMS
jobArn
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/job/:jobArn/cancel");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/job/:jobArn/cancel")
require "http/client"
url = "{{baseUrl}}/job/:jobArn/cancel"
response = HTTP::Client.put url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/job/:jobArn/cancel"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/job/:jobArn/cancel");
var request = new RestRequest("", Method.Put);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/job/:jobArn/cancel"
req, _ := http.NewRequest("PUT", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/job/:jobArn/cancel HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/job/:jobArn/cancel")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/job/:jobArn/cancel"))
.method("PUT", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/job/:jobArn/cancel")
.put(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/job/:jobArn/cancel")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/job/:jobArn/cancel');
xhr.send(data);
import axios from 'axios';
const options = {method: 'PUT', url: '{{baseUrl}}/job/:jobArn/cancel'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/job/:jobArn/cancel';
const options = {method: 'PUT'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/job/:jobArn/cancel',
method: 'PUT',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/job/:jobArn/cancel")
.put(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/job/:jobArn/cancel',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'PUT', url: '{{baseUrl}}/job/:jobArn/cancel'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/job/:jobArn/cancel');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'PUT', url: '{{baseUrl}}/job/:jobArn/cancel'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/job/:jobArn/cancel';
const options = {method: 'PUT'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/job/:jobArn/cancel"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/job/:jobArn/cancel" in
Client.call `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/job/:jobArn/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/job/:jobArn/cancel');
echo $response->getBody();
setUrl('{{baseUrl}}/job/:jobArn/cancel');
$request->setMethod(HTTP_METH_PUT);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/job/:jobArn/cancel');
$request->setRequestMethod('PUT');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/job/:jobArn/cancel' -Method PUT
$response = Invoke-RestMethod -Uri '{{baseUrl}}/job/:jobArn/cancel' -Method PUT
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("PUT", "/baseUrl/job/:jobArn/cancel")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/job/:jobArn/cancel"
response = requests.put(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/job/:jobArn/cancel"
response <- VERB("PUT", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/job/:jobArn/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.put('/baseUrl/job/:jobArn/cancel') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/job/:jobArn/cancel";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/job/:jobArn/cancel
http PUT {{baseUrl}}/job/:jobArn/cancel
wget --quiet \
--method PUT \
--output-document \
- {{baseUrl}}/job/:jobArn/cancel
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/job/:jobArn/cancel")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
CancelQuantumTask
{{baseUrl}}/quantum-task/:quantumTaskArn/cancel
QUERY PARAMS
quantumTaskArn
BODY json
{
"clientToken": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/quantum-task/:quantumTaskArn/cancel");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"clientToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/quantum-task/:quantumTaskArn/cancel" {:content-type :json
:form-params {:clientToken ""}})
require "http/client"
url = "{{baseUrl}}/quantum-task/:quantumTaskArn/cancel"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"clientToken\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/quantum-task/:quantumTaskArn/cancel"),
Content = new StringContent("{\n \"clientToken\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/quantum-task/:quantumTaskArn/cancel");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"clientToken\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/quantum-task/:quantumTaskArn/cancel"
payload := strings.NewReader("{\n \"clientToken\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/quantum-task/:quantumTaskArn/cancel HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 23
{
"clientToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/quantum-task/:quantumTaskArn/cancel")
.setHeader("content-type", "application/json")
.setBody("{\n \"clientToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/quantum-task/:quantumTaskArn/cancel"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"clientToken\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"clientToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/quantum-task/:quantumTaskArn/cancel")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/quantum-task/:quantumTaskArn/cancel")
.header("content-type", "application/json")
.body("{\n \"clientToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
clientToken: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/quantum-task/:quantumTaskArn/cancel');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/quantum-task/:quantumTaskArn/cancel',
headers: {'content-type': 'application/json'},
data: {clientToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/quantum-task/:quantumTaskArn/cancel';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"clientToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/quantum-task/:quantumTaskArn/cancel',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "clientToken": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"clientToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/quantum-task/:quantumTaskArn/cancel")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/quantum-task/:quantumTaskArn/cancel',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({clientToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/quantum-task/:quantumTaskArn/cancel',
headers: {'content-type': 'application/json'},
body: {clientToken: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/quantum-task/:quantumTaskArn/cancel');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
clientToken: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/quantum-task/:quantumTaskArn/cancel',
headers: {'content-type': 'application/json'},
data: {clientToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/quantum-task/:quantumTaskArn/cancel';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"clientToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"clientToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/quantum-task/:quantumTaskArn/cancel"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/quantum-task/:quantumTaskArn/cancel" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"clientToken\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/quantum-task/:quantumTaskArn/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'clientToken' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/quantum-task/:quantumTaskArn/cancel', [
'body' => '{
"clientToken": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/quantum-task/:quantumTaskArn/cancel');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'clientToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'clientToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/quantum-task/:quantumTaskArn/cancel');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/quantum-task/:quantumTaskArn/cancel' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"clientToken": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/quantum-task/:quantumTaskArn/cancel' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"clientToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"clientToken\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/quantum-task/:quantumTaskArn/cancel", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/quantum-task/:quantumTaskArn/cancel"
payload = { "clientToken": "" }
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/quantum-task/:quantumTaskArn/cancel"
payload <- "{\n \"clientToken\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/quantum-task/:quantumTaskArn/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"clientToken\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/quantum-task/:quantumTaskArn/cancel') do |req|
req.body = "{\n \"clientToken\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/quantum-task/:quantumTaskArn/cancel";
let payload = json!({"clientToken": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/quantum-task/:quantumTaskArn/cancel \
--header 'content-type: application/json' \
--data '{
"clientToken": ""
}'
echo '{
"clientToken": ""
}' | \
http PUT {{baseUrl}}/quantum-task/:quantumTaskArn/cancel \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "clientToken": ""\n}' \
--output-document \
- {{baseUrl}}/quantum-task/:quantumTaskArn/cancel
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["clientToken": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/quantum-task/:quantumTaskArn/cancel")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
CreateJob
{{baseUrl}}/job
BODY json
{
"algorithmSpecification": {
"containerImage": "",
"scriptModeConfig": ""
},
"checkpointConfig": {
"localPath": "",
"s3Uri": ""
},
"clientToken": "",
"deviceConfig": {
"device": ""
},
"hyperParameters": {},
"inputDataConfig": [
{
"channelName": "",
"contentType": "",
"dataSource": ""
}
],
"instanceConfig": {
"instanceCount": "",
"instanceType": "",
"volumeSizeInGb": ""
},
"jobName": "",
"outputDataConfig": {
"kmsKeyId": "",
"s3Path": ""
},
"roleArn": "",
"stoppingCondition": {
"maxRuntimeInSeconds": ""
},
"tags": {}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/job");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"algorithmSpecification\": {\n \"containerImage\": \"\",\n \"scriptModeConfig\": \"\"\n },\n \"checkpointConfig\": {\n \"localPath\": \"\",\n \"s3Uri\": \"\"\n },\n \"clientToken\": \"\",\n \"deviceConfig\": {\n \"device\": \"\"\n },\n \"hyperParameters\": {},\n \"inputDataConfig\": [\n {\n \"channelName\": \"\",\n \"contentType\": \"\",\n \"dataSource\": \"\"\n }\n ],\n \"instanceConfig\": {\n \"instanceCount\": \"\",\n \"instanceType\": \"\",\n \"volumeSizeInGb\": \"\"\n },\n \"jobName\": \"\",\n \"outputDataConfig\": {\n \"kmsKeyId\": \"\",\n \"s3Path\": \"\"\n },\n \"roleArn\": \"\",\n \"stoppingCondition\": {\n \"maxRuntimeInSeconds\": \"\"\n },\n \"tags\": {}\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/job" {:content-type :json
:form-params {:algorithmSpecification {:containerImage ""
:scriptModeConfig ""}
:checkpointConfig {:localPath ""
:s3Uri ""}
:clientToken ""
:deviceConfig {:device ""}
:hyperParameters {}
:inputDataConfig [{:channelName ""
:contentType ""
:dataSource ""}]
:instanceConfig {:instanceCount ""
:instanceType ""
:volumeSizeInGb ""}
:jobName ""
:outputDataConfig {:kmsKeyId ""
:s3Path ""}
:roleArn ""
:stoppingCondition {:maxRuntimeInSeconds ""}
:tags {}}})
require "http/client"
url = "{{baseUrl}}/job"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"algorithmSpecification\": {\n \"containerImage\": \"\",\n \"scriptModeConfig\": \"\"\n },\n \"checkpointConfig\": {\n \"localPath\": \"\",\n \"s3Uri\": \"\"\n },\n \"clientToken\": \"\",\n \"deviceConfig\": {\n \"device\": \"\"\n },\n \"hyperParameters\": {},\n \"inputDataConfig\": [\n {\n \"channelName\": \"\",\n \"contentType\": \"\",\n \"dataSource\": \"\"\n }\n ],\n \"instanceConfig\": {\n \"instanceCount\": \"\",\n \"instanceType\": \"\",\n \"volumeSizeInGb\": \"\"\n },\n \"jobName\": \"\",\n \"outputDataConfig\": {\n \"kmsKeyId\": \"\",\n \"s3Path\": \"\"\n },\n \"roleArn\": \"\",\n \"stoppingCondition\": {\n \"maxRuntimeInSeconds\": \"\"\n },\n \"tags\": {}\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/job"),
Content = new StringContent("{\n \"algorithmSpecification\": {\n \"containerImage\": \"\",\n \"scriptModeConfig\": \"\"\n },\n \"checkpointConfig\": {\n \"localPath\": \"\",\n \"s3Uri\": \"\"\n },\n \"clientToken\": \"\",\n \"deviceConfig\": {\n \"device\": \"\"\n },\n \"hyperParameters\": {},\n \"inputDataConfig\": [\n {\n \"channelName\": \"\",\n \"contentType\": \"\",\n \"dataSource\": \"\"\n }\n ],\n \"instanceConfig\": {\n \"instanceCount\": \"\",\n \"instanceType\": \"\",\n \"volumeSizeInGb\": \"\"\n },\n \"jobName\": \"\",\n \"outputDataConfig\": {\n \"kmsKeyId\": \"\",\n \"s3Path\": \"\"\n },\n \"roleArn\": \"\",\n \"stoppingCondition\": {\n \"maxRuntimeInSeconds\": \"\"\n },\n \"tags\": {}\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/job");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"algorithmSpecification\": {\n \"containerImage\": \"\",\n \"scriptModeConfig\": \"\"\n },\n \"checkpointConfig\": {\n \"localPath\": \"\",\n \"s3Uri\": \"\"\n },\n \"clientToken\": \"\",\n \"deviceConfig\": {\n \"device\": \"\"\n },\n \"hyperParameters\": {},\n \"inputDataConfig\": [\n {\n \"channelName\": \"\",\n \"contentType\": \"\",\n \"dataSource\": \"\"\n }\n ],\n \"instanceConfig\": {\n \"instanceCount\": \"\",\n \"instanceType\": \"\",\n \"volumeSizeInGb\": \"\"\n },\n \"jobName\": \"\",\n \"outputDataConfig\": {\n \"kmsKeyId\": \"\",\n \"s3Path\": \"\"\n },\n \"roleArn\": \"\",\n \"stoppingCondition\": {\n \"maxRuntimeInSeconds\": \"\"\n },\n \"tags\": {}\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/job"
payload := strings.NewReader("{\n \"algorithmSpecification\": {\n \"containerImage\": \"\",\n \"scriptModeConfig\": \"\"\n },\n \"checkpointConfig\": {\n \"localPath\": \"\",\n \"s3Uri\": \"\"\n },\n \"clientToken\": \"\",\n \"deviceConfig\": {\n \"device\": \"\"\n },\n \"hyperParameters\": {},\n \"inputDataConfig\": [\n {\n \"channelName\": \"\",\n \"contentType\": \"\",\n \"dataSource\": \"\"\n }\n ],\n \"instanceConfig\": {\n \"instanceCount\": \"\",\n \"instanceType\": \"\",\n \"volumeSizeInGb\": \"\"\n },\n \"jobName\": \"\",\n \"outputDataConfig\": {\n \"kmsKeyId\": \"\",\n \"s3Path\": \"\"\n },\n \"roleArn\": \"\",\n \"stoppingCondition\": {\n \"maxRuntimeInSeconds\": \"\"\n },\n \"tags\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/job HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 632
{
"algorithmSpecification": {
"containerImage": "",
"scriptModeConfig": ""
},
"checkpointConfig": {
"localPath": "",
"s3Uri": ""
},
"clientToken": "",
"deviceConfig": {
"device": ""
},
"hyperParameters": {},
"inputDataConfig": [
{
"channelName": "",
"contentType": "",
"dataSource": ""
}
],
"instanceConfig": {
"instanceCount": "",
"instanceType": "",
"volumeSizeInGb": ""
},
"jobName": "",
"outputDataConfig": {
"kmsKeyId": "",
"s3Path": ""
},
"roleArn": "",
"stoppingCondition": {
"maxRuntimeInSeconds": ""
},
"tags": {}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/job")
.setHeader("content-type", "application/json")
.setBody("{\n \"algorithmSpecification\": {\n \"containerImage\": \"\",\n \"scriptModeConfig\": \"\"\n },\n \"checkpointConfig\": {\n \"localPath\": \"\",\n \"s3Uri\": \"\"\n },\n \"clientToken\": \"\",\n \"deviceConfig\": {\n \"device\": \"\"\n },\n \"hyperParameters\": {},\n \"inputDataConfig\": [\n {\n \"channelName\": \"\",\n \"contentType\": \"\",\n \"dataSource\": \"\"\n }\n ],\n \"instanceConfig\": {\n \"instanceCount\": \"\",\n \"instanceType\": \"\",\n \"volumeSizeInGb\": \"\"\n },\n \"jobName\": \"\",\n \"outputDataConfig\": {\n \"kmsKeyId\": \"\",\n \"s3Path\": \"\"\n },\n \"roleArn\": \"\",\n \"stoppingCondition\": {\n \"maxRuntimeInSeconds\": \"\"\n },\n \"tags\": {}\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/job"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"algorithmSpecification\": {\n \"containerImage\": \"\",\n \"scriptModeConfig\": \"\"\n },\n \"checkpointConfig\": {\n \"localPath\": \"\",\n \"s3Uri\": \"\"\n },\n \"clientToken\": \"\",\n \"deviceConfig\": {\n \"device\": \"\"\n },\n \"hyperParameters\": {},\n \"inputDataConfig\": [\n {\n \"channelName\": \"\",\n \"contentType\": \"\",\n \"dataSource\": \"\"\n }\n ],\n \"instanceConfig\": {\n \"instanceCount\": \"\",\n \"instanceType\": \"\",\n \"volumeSizeInGb\": \"\"\n },\n \"jobName\": \"\",\n \"outputDataConfig\": {\n \"kmsKeyId\": \"\",\n \"s3Path\": \"\"\n },\n \"roleArn\": \"\",\n \"stoppingCondition\": {\n \"maxRuntimeInSeconds\": \"\"\n },\n \"tags\": {}\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"algorithmSpecification\": {\n \"containerImage\": \"\",\n \"scriptModeConfig\": \"\"\n },\n \"checkpointConfig\": {\n \"localPath\": \"\",\n \"s3Uri\": \"\"\n },\n \"clientToken\": \"\",\n \"deviceConfig\": {\n \"device\": \"\"\n },\n \"hyperParameters\": {},\n \"inputDataConfig\": [\n {\n \"channelName\": \"\",\n \"contentType\": \"\",\n \"dataSource\": \"\"\n }\n ],\n \"instanceConfig\": {\n \"instanceCount\": \"\",\n \"instanceType\": \"\",\n \"volumeSizeInGb\": \"\"\n },\n \"jobName\": \"\",\n \"outputDataConfig\": {\n \"kmsKeyId\": \"\",\n \"s3Path\": \"\"\n },\n \"roleArn\": \"\",\n \"stoppingCondition\": {\n \"maxRuntimeInSeconds\": \"\"\n },\n \"tags\": {}\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/job")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/job")
.header("content-type", "application/json")
.body("{\n \"algorithmSpecification\": {\n \"containerImage\": \"\",\n \"scriptModeConfig\": \"\"\n },\n \"checkpointConfig\": {\n \"localPath\": \"\",\n \"s3Uri\": \"\"\n },\n \"clientToken\": \"\",\n \"deviceConfig\": {\n \"device\": \"\"\n },\n \"hyperParameters\": {},\n \"inputDataConfig\": [\n {\n \"channelName\": \"\",\n \"contentType\": \"\",\n \"dataSource\": \"\"\n }\n ],\n \"instanceConfig\": {\n \"instanceCount\": \"\",\n \"instanceType\": \"\",\n \"volumeSizeInGb\": \"\"\n },\n \"jobName\": \"\",\n \"outputDataConfig\": {\n \"kmsKeyId\": \"\",\n \"s3Path\": \"\"\n },\n \"roleArn\": \"\",\n \"stoppingCondition\": {\n \"maxRuntimeInSeconds\": \"\"\n },\n \"tags\": {}\n}")
.asString();
const data = JSON.stringify({
algorithmSpecification: {
containerImage: '',
scriptModeConfig: ''
},
checkpointConfig: {
localPath: '',
s3Uri: ''
},
clientToken: '',
deviceConfig: {
device: ''
},
hyperParameters: {},
inputDataConfig: [
{
channelName: '',
contentType: '',
dataSource: ''
}
],
instanceConfig: {
instanceCount: '',
instanceType: '',
volumeSizeInGb: ''
},
jobName: '',
outputDataConfig: {
kmsKeyId: '',
s3Path: ''
},
roleArn: '',
stoppingCondition: {
maxRuntimeInSeconds: ''
},
tags: {}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/job');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/job',
headers: {'content-type': 'application/json'},
data: {
algorithmSpecification: {containerImage: '', scriptModeConfig: ''},
checkpointConfig: {localPath: '', s3Uri: ''},
clientToken: '',
deviceConfig: {device: ''},
hyperParameters: {},
inputDataConfig: [{channelName: '', contentType: '', dataSource: ''}],
instanceConfig: {instanceCount: '', instanceType: '', volumeSizeInGb: ''},
jobName: '',
outputDataConfig: {kmsKeyId: '', s3Path: ''},
roleArn: '',
stoppingCondition: {maxRuntimeInSeconds: ''},
tags: {}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/job';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"algorithmSpecification":{"containerImage":"","scriptModeConfig":""},"checkpointConfig":{"localPath":"","s3Uri":""},"clientToken":"","deviceConfig":{"device":""},"hyperParameters":{},"inputDataConfig":[{"channelName":"","contentType":"","dataSource":""}],"instanceConfig":{"instanceCount":"","instanceType":"","volumeSizeInGb":""},"jobName":"","outputDataConfig":{"kmsKeyId":"","s3Path":""},"roleArn":"","stoppingCondition":{"maxRuntimeInSeconds":""},"tags":{}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/job',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "algorithmSpecification": {\n "containerImage": "",\n "scriptModeConfig": ""\n },\n "checkpointConfig": {\n "localPath": "",\n "s3Uri": ""\n },\n "clientToken": "",\n "deviceConfig": {\n "device": ""\n },\n "hyperParameters": {},\n "inputDataConfig": [\n {\n "channelName": "",\n "contentType": "",\n "dataSource": ""\n }\n ],\n "instanceConfig": {\n "instanceCount": "",\n "instanceType": "",\n "volumeSizeInGb": ""\n },\n "jobName": "",\n "outputDataConfig": {\n "kmsKeyId": "",\n "s3Path": ""\n },\n "roleArn": "",\n "stoppingCondition": {\n "maxRuntimeInSeconds": ""\n },\n "tags": {}\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"algorithmSpecification\": {\n \"containerImage\": \"\",\n \"scriptModeConfig\": \"\"\n },\n \"checkpointConfig\": {\n \"localPath\": \"\",\n \"s3Uri\": \"\"\n },\n \"clientToken\": \"\",\n \"deviceConfig\": {\n \"device\": \"\"\n },\n \"hyperParameters\": {},\n \"inputDataConfig\": [\n {\n \"channelName\": \"\",\n \"contentType\": \"\",\n \"dataSource\": \"\"\n }\n ],\n \"instanceConfig\": {\n \"instanceCount\": \"\",\n \"instanceType\": \"\",\n \"volumeSizeInGb\": \"\"\n },\n \"jobName\": \"\",\n \"outputDataConfig\": {\n \"kmsKeyId\": \"\",\n \"s3Path\": \"\"\n },\n \"roleArn\": \"\",\n \"stoppingCondition\": {\n \"maxRuntimeInSeconds\": \"\"\n },\n \"tags\": {}\n}")
val request = Request.Builder()
.url("{{baseUrl}}/job")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/job',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
algorithmSpecification: {containerImage: '', scriptModeConfig: ''},
checkpointConfig: {localPath: '', s3Uri: ''},
clientToken: '',
deviceConfig: {device: ''},
hyperParameters: {},
inputDataConfig: [{channelName: '', contentType: '', dataSource: ''}],
instanceConfig: {instanceCount: '', instanceType: '', volumeSizeInGb: ''},
jobName: '',
outputDataConfig: {kmsKeyId: '', s3Path: ''},
roleArn: '',
stoppingCondition: {maxRuntimeInSeconds: ''},
tags: {}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/job',
headers: {'content-type': 'application/json'},
body: {
algorithmSpecification: {containerImage: '', scriptModeConfig: ''},
checkpointConfig: {localPath: '', s3Uri: ''},
clientToken: '',
deviceConfig: {device: ''},
hyperParameters: {},
inputDataConfig: [{channelName: '', contentType: '', dataSource: ''}],
instanceConfig: {instanceCount: '', instanceType: '', volumeSizeInGb: ''},
jobName: '',
outputDataConfig: {kmsKeyId: '', s3Path: ''},
roleArn: '',
stoppingCondition: {maxRuntimeInSeconds: ''},
tags: {}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/job');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
algorithmSpecification: {
containerImage: '',
scriptModeConfig: ''
},
checkpointConfig: {
localPath: '',
s3Uri: ''
},
clientToken: '',
deviceConfig: {
device: ''
},
hyperParameters: {},
inputDataConfig: [
{
channelName: '',
contentType: '',
dataSource: ''
}
],
instanceConfig: {
instanceCount: '',
instanceType: '',
volumeSizeInGb: ''
},
jobName: '',
outputDataConfig: {
kmsKeyId: '',
s3Path: ''
},
roleArn: '',
stoppingCondition: {
maxRuntimeInSeconds: ''
},
tags: {}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/job',
headers: {'content-type': 'application/json'},
data: {
algorithmSpecification: {containerImage: '', scriptModeConfig: ''},
checkpointConfig: {localPath: '', s3Uri: ''},
clientToken: '',
deviceConfig: {device: ''},
hyperParameters: {},
inputDataConfig: [{channelName: '', contentType: '', dataSource: ''}],
instanceConfig: {instanceCount: '', instanceType: '', volumeSizeInGb: ''},
jobName: '',
outputDataConfig: {kmsKeyId: '', s3Path: ''},
roleArn: '',
stoppingCondition: {maxRuntimeInSeconds: ''},
tags: {}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/job';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"algorithmSpecification":{"containerImage":"","scriptModeConfig":""},"checkpointConfig":{"localPath":"","s3Uri":""},"clientToken":"","deviceConfig":{"device":""},"hyperParameters":{},"inputDataConfig":[{"channelName":"","contentType":"","dataSource":""}],"instanceConfig":{"instanceCount":"","instanceType":"","volumeSizeInGb":""},"jobName":"","outputDataConfig":{"kmsKeyId":"","s3Path":""},"roleArn":"","stoppingCondition":{"maxRuntimeInSeconds":""},"tags":{}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"algorithmSpecification": @{ @"containerImage": @"", @"scriptModeConfig": @"" },
@"checkpointConfig": @{ @"localPath": @"", @"s3Uri": @"" },
@"clientToken": @"",
@"deviceConfig": @{ @"device": @"" },
@"hyperParameters": @{ },
@"inputDataConfig": @[ @{ @"channelName": @"", @"contentType": @"", @"dataSource": @"" } ],
@"instanceConfig": @{ @"instanceCount": @"", @"instanceType": @"", @"volumeSizeInGb": @"" },
@"jobName": @"",
@"outputDataConfig": @{ @"kmsKeyId": @"", @"s3Path": @"" },
@"roleArn": @"",
@"stoppingCondition": @{ @"maxRuntimeInSeconds": @"" },
@"tags": @{ } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/job"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/job" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"algorithmSpecification\": {\n \"containerImage\": \"\",\n \"scriptModeConfig\": \"\"\n },\n \"checkpointConfig\": {\n \"localPath\": \"\",\n \"s3Uri\": \"\"\n },\n \"clientToken\": \"\",\n \"deviceConfig\": {\n \"device\": \"\"\n },\n \"hyperParameters\": {},\n \"inputDataConfig\": [\n {\n \"channelName\": \"\",\n \"contentType\": \"\",\n \"dataSource\": \"\"\n }\n ],\n \"instanceConfig\": {\n \"instanceCount\": \"\",\n \"instanceType\": \"\",\n \"volumeSizeInGb\": \"\"\n },\n \"jobName\": \"\",\n \"outputDataConfig\": {\n \"kmsKeyId\": \"\",\n \"s3Path\": \"\"\n },\n \"roleArn\": \"\",\n \"stoppingCondition\": {\n \"maxRuntimeInSeconds\": \"\"\n },\n \"tags\": {}\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/job",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'algorithmSpecification' => [
'containerImage' => '',
'scriptModeConfig' => ''
],
'checkpointConfig' => [
'localPath' => '',
's3Uri' => ''
],
'clientToken' => '',
'deviceConfig' => [
'device' => ''
],
'hyperParameters' => [
],
'inputDataConfig' => [
[
'channelName' => '',
'contentType' => '',
'dataSource' => ''
]
],
'instanceConfig' => [
'instanceCount' => '',
'instanceType' => '',
'volumeSizeInGb' => ''
],
'jobName' => '',
'outputDataConfig' => [
'kmsKeyId' => '',
's3Path' => ''
],
'roleArn' => '',
'stoppingCondition' => [
'maxRuntimeInSeconds' => ''
],
'tags' => [
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/job', [
'body' => '{
"algorithmSpecification": {
"containerImage": "",
"scriptModeConfig": ""
},
"checkpointConfig": {
"localPath": "",
"s3Uri": ""
},
"clientToken": "",
"deviceConfig": {
"device": ""
},
"hyperParameters": {},
"inputDataConfig": [
{
"channelName": "",
"contentType": "",
"dataSource": ""
}
],
"instanceConfig": {
"instanceCount": "",
"instanceType": "",
"volumeSizeInGb": ""
},
"jobName": "",
"outputDataConfig": {
"kmsKeyId": "",
"s3Path": ""
},
"roleArn": "",
"stoppingCondition": {
"maxRuntimeInSeconds": ""
},
"tags": {}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/job');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'algorithmSpecification' => [
'containerImage' => '',
'scriptModeConfig' => ''
],
'checkpointConfig' => [
'localPath' => '',
's3Uri' => ''
],
'clientToken' => '',
'deviceConfig' => [
'device' => ''
],
'hyperParameters' => [
],
'inputDataConfig' => [
[
'channelName' => '',
'contentType' => '',
'dataSource' => ''
]
],
'instanceConfig' => [
'instanceCount' => '',
'instanceType' => '',
'volumeSizeInGb' => ''
],
'jobName' => '',
'outputDataConfig' => [
'kmsKeyId' => '',
's3Path' => ''
],
'roleArn' => '',
'stoppingCondition' => [
'maxRuntimeInSeconds' => ''
],
'tags' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'algorithmSpecification' => [
'containerImage' => '',
'scriptModeConfig' => ''
],
'checkpointConfig' => [
'localPath' => '',
's3Uri' => ''
],
'clientToken' => '',
'deviceConfig' => [
'device' => ''
],
'hyperParameters' => [
],
'inputDataConfig' => [
[
'channelName' => '',
'contentType' => '',
'dataSource' => ''
]
],
'instanceConfig' => [
'instanceCount' => '',
'instanceType' => '',
'volumeSizeInGb' => ''
],
'jobName' => '',
'outputDataConfig' => [
'kmsKeyId' => '',
's3Path' => ''
],
'roleArn' => '',
'stoppingCondition' => [
'maxRuntimeInSeconds' => ''
],
'tags' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/job');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/job' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"algorithmSpecification": {
"containerImage": "",
"scriptModeConfig": ""
},
"checkpointConfig": {
"localPath": "",
"s3Uri": ""
},
"clientToken": "",
"deviceConfig": {
"device": ""
},
"hyperParameters": {},
"inputDataConfig": [
{
"channelName": "",
"contentType": "",
"dataSource": ""
}
],
"instanceConfig": {
"instanceCount": "",
"instanceType": "",
"volumeSizeInGb": ""
},
"jobName": "",
"outputDataConfig": {
"kmsKeyId": "",
"s3Path": ""
},
"roleArn": "",
"stoppingCondition": {
"maxRuntimeInSeconds": ""
},
"tags": {}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/job' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"algorithmSpecification": {
"containerImage": "",
"scriptModeConfig": ""
},
"checkpointConfig": {
"localPath": "",
"s3Uri": ""
},
"clientToken": "",
"deviceConfig": {
"device": ""
},
"hyperParameters": {},
"inputDataConfig": [
{
"channelName": "",
"contentType": "",
"dataSource": ""
}
],
"instanceConfig": {
"instanceCount": "",
"instanceType": "",
"volumeSizeInGb": ""
},
"jobName": "",
"outputDataConfig": {
"kmsKeyId": "",
"s3Path": ""
},
"roleArn": "",
"stoppingCondition": {
"maxRuntimeInSeconds": ""
},
"tags": {}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"algorithmSpecification\": {\n \"containerImage\": \"\",\n \"scriptModeConfig\": \"\"\n },\n \"checkpointConfig\": {\n \"localPath\": \"\",\n \"s3Uri\": \"\"\n },\n \"clientToken\": \"\",\n \"deviceConfig\": {\n \"device\": \"\"\n },\n \"hyperParameters\": {},\n \"inputDataConfig\": [\n {\n \"channelName\": \"\",\n \"contentType\": \"\",\n \"dataSource\": \"\"\n }\n ],\n \"instanceConfig\": {\n \"instanceCount\": \"\",\n \"instanceType\": \"\",\n \"volumeSizeInGb\": \"\"\n },\n \"jobName\": \"\",\n \"outputDataConfig\": {\n \"kmsKeyId\": \"\",\n \"s3Path\": \"\"\n },\n \"roleArn\": \"\",\n \"stoppingCondition\": {\n \"maxRuntimeInSeconds\": \"\"\n },\n \"tags\": {}\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/job", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/job"
payload = {
"algorithmSpecification": {
"containerImage": "",
"scriptModeConfig": ""
},
"checkpointConfig": {
"localPath": "",
"s3Uri": ""
},
"clientToken": "",
"deviceConfig": { "device": "" },
"hyperParameters": {},
"inputDataConfig": [
{
"channelName": "",
"contentType": "",
"dataSource": ""
}
],
"instanceConfig": {
"instanceCount": "",
"instanceType": "",
"volumeSizeInGb": ""
},
"jobName": "",
"outputDataConfig": {
"kmsKeyId": "",
"s3Path": ""
},
"roleArn": "",
"stoppingCondition": { "maxRuntimeInSeconds": "" },
"tags": {}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/job"
payload <- "{\n \"algorithmSpecification\": {\n \"containerImage\": \"\",\n \"scriptModeConfig\": \"\"\n },\n \"checkpointConfig\": {\n \"localPath\": \"\",\n \"s3Uri\": \"\"\n },\n \"clientToken\": \"\",\n \"deviceConfig\": {\n \"device\": \"\"\n },\n \"hyperParameters\": {},\n \"inputDataConfig\": [\n {\n \"channelName\": \"\",\n \"contentType\": \"\",\n \"dataSource\": \"\"\n }\n ],\n \"instanceConfig\": {\n \"instanceCount\": \"\",\n \"instanceType\": \"\",\n \"volumeSizeInGb\": \"\"\n },\n \"jobName\": \"\",\n \"outputDataConfig\": {\n \"kmsKeyId\": \"\",\n \"s3Path\": \"\"\n },\n \"roleArn\": \"\",\n \"stoppingCondition\": {\n \"maxRuntimeInSeconds\": \"\"\n },\n \"tags\": {}\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/job")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"algorithmSpecification\": {\n \"containerImage\": \"\",\n \"scriptModeConfig\": \"\"\n },\n \"checkpointConfig\": {\n \"localPath\": \"\",\n \"s3Uri\": \"\"\n },\n \"clientToken\": \"\",\n \"deviceConfig\": {\n \"device\": \"\"\n },\n \"hyperParameters\": {},\n \"inputDataConfig\": [\n {\n \"channelName\": \"\",\n \"contentType\": \"\",\n \"dataSource\": \"\"\n }\n ],\n \"instanceConfig\": {\n \"instanceCount\": \"\",\n \"instanceType\": \"\",\n \"volumeSizeInGb\": \"\"\n },\n \"jobName\": \"\",\n \"outputDataConfig\": {\n \"kmsKeyId\": \"\",\n \"s3Path\": \"\"\n },\n \"roleArn\": \"\",\n \"stoppingCondition\": {\n \"maxRuntimeInSeconds\": \"\"\n },\n \"tags\": {}\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/job') do |req|
req.body = "{\n \"algorithmSpecification\": {\n \"containerImage\": \"\",\n \"scriptModeConfig\": \"\"\n },\n \"checkpointConfig\": {\n \"localPath\": \"\",\n \"s3Uri\": \"\"\n },\n \"clientToken\": \"\",\n \"deviceConfig\": {\n \"device\": \"\"\n },\n \"hyperParameters\": {},\n \"inputDataConfig\": [\n {\n \"channelName\": \"\",\n \"contentType\": \"\",\n \"dataSource\": \"\"\n }\n ],\n \"instanceConfig\": {\n \"instanceCount\": \"\",\n \"instanceType\": \"\",\n \"volumeSizeInGb\": \"\"\n },\n \"jobName\": \"\",\n \"outputDataConfig\": {\n \"kmsKeyId\": \"\",\n \"s3Path\": \"\"\n },\n \"roleArn\": \"\",\n \"stoppingCondition\": {\n \"maxRuntimeInSeconds\": \"\"\n },\n \"tags\": {}\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/job";
let payload = json!({
"algorithmSpecification": json!({
"containerImage": "",
"scriptModeConfig": ""
}),
"checkpointConfig": json!({
"localPath": "",
"s3Uri": ""
}),
"clientToken": "",
"deviceConfig": json!({"device": ""}),
"hyperParameters": json!({}),
"inputDataConfig": (
json!({
"channelName": "",
"contentType": "",
"dataSource": ""
})
),
"instanceConfig": json!({
"instanceCount": "",
"instanceType": "",
"volumeSizeInGb": ""
}),
"jobName": "",
"outputDataConfig": json!({
"kmsKeyId": "",
"s3Path": ""
}),
"roleArn": "",
"stoppingCondition": json!({"maxRuntimeInSeconds": ""}),
"tags": json!({})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/job \
--header 'content-type: application/json' \
--data '{
"algorithmSpecification": {
"containerImage": "",
"scriptModeConfig": ""
},
"checkpointConfig": {
"localPath": "",
"s3Uri": ""
},
"clientToken": "",
"deviceConfig": {
"device": ""
},
"hyperParameters": {},
"inputDataConfig": [
{
"channelName": "",
"contentType": "",
"dataSource": ""
}
],
"instanceConfig": {
"instanceCount": "",
"instanceType": "",
"volumeSizeInGb": ""
},
"jobName": "",
"outputDataConfig": {
"kmsKeyId": "",
"s3Path": ""
},
"roleArn": "",
"stoppingCondition": {
"maxRuntimeInSeconds": ""
},
"tags": {}
}'
echo '{
"algorithmSpecification": {
"containerImage": "",
"scriptModeConfig": ""
},
"checkpointConfig": {
"localPath": "",
"s3Uri": ""
},
"clientToken": "",
"deviceConfig": {
"device": ""
},
"hyperParameters": {},
"inputDataConfig": [
{
"channelName": "",
"contentType": "",
"dataSource": ""
}
],
"instanceConfig": {
"instanceCount": "",
"instanceType": "",
"volumeSizeInGb": ""
},
"jobName": "",
"outputDataConfig": {
"kmsKeyId": "",
"s3Path": ""
},
"roleArn": "",
"stoppingCondition": {
"maxRuntimeInSeconds": ""
},
"tags": {}
}' | \
http POST {{baseUrl}}/job \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "algorithmSpecification": {\n "containerImage": "",\n "scriptModeConfig": ""\n },\n "checkpointConfig": {\n "localPath": "",\n "s3Uri": ""\n },\n "clientToken": "",\n "deviceConfig": {\n "device": ""\n },\n "hyperParameters": {},\n "inputDataConfig": [\n {\n "channelName": "",\n "contentType": "",\n "dataSource": ""\n }\n ],\n "instanceConfig": {\n "instanceCount": "",\n "instanceType": "",\n "volumeSizeInGb": ""\n },\n "jobName": "",\n "outputDataConfig": {\n "kmsKeyId": "",\n "s3Path": ""\n },\n "roleArn": "",\n "stoppingCondition": {\n "maxRuntimeInSeconds": ""\n },\n "tags": {}\n}' \
--output-document \
- {{baseUrl}}/job
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"algorithmSpecification": [
"containerImage": "",
"scriptModeConfig": ""
],
"checkpointConfig": [
"localPath": "",
"s3Uri": ""
],
"clientToken": "",
"deviceConfig": ["device": ""],
"hyperParameters": [],
"inputDataConfig": [
[
"channelName": "",
"contentType": "",
"dataSource": ""
]
],
"instanceConfig": [
"instanceCount": "",
"instanceType": "",
"volumeSizeInGb": ""
],
"jobName": "",
"outputDataConfig": [
"kmsKeyId": "",
"s3Path": ""
],
"roleArn": "",
"stoppingCondition": ["maxRuntimeInSeconds": ""],
"tags": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/job")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
CreateQuantumTask
{{baseUrl}}/quantum-task
BODY json
{
"action": "",
"clientToken": "",
"deviceArn": "",
"deviceParameters": "",
"jobToken": "",
"outputS3Bucket": "",
"outputS3KeyPrefix": "",
"shots": 0,
"tags": {}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/quantum-task");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"action\": \"\",\n \"clientToken\": \"\",\n \"deviceArn\": \"\",\n \"deviceParameters\": \"\",\n \"jobToken\": \"\",\n \"outputS3Bucket\": \"\",\n \"outputS3KeyPrefix\": \"\",\n \"shots\": 0,\n \"tags\": {}\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/quantum-task" {:content-type :json
:form-params {:action ""
:clientToken ""
:deviceArn ""
:deviceParameters ""
:jobToken ""
:outputS3Bucket ""
:outputS3KeyPrefix ""
:shots 0
:tags {}}})
require "http/client"
url = "{{baseUrl}}/quantum-task"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"action\": \"\",\n \"clientToken\": \"\",\n \"deviceArn\": \"\",\n \"deviceParameters\": \"\",\n \"jobToken\": \"\",\n \"outputS3Bucket\": \"\",\n \"outputS3KeyPrefix\": \"\",\n \"shots\": 0,\n \"tags\": {}\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/quantum-task"),
Content = new StringContent("{\n \"action\": \"\",\n \"clientToken\": \"\",\n \"deviceArn\": \"\",\n \"deviceParameters\": \"\",\n \"jobToken\": \"\",\n \"outputS3Bucket\": \"\",\n \"outputS3KeyPrefix\": \"\",\n \"shots\": 0,\n \"tags\": {}\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/quantum-task");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"action\": \"\",\n \"clientToken\": \"\",\n \"deviceArn\": \"\",\n \"deviceParameters\": \"\",\n \"jobToken\": \"\",\n \"outputS3Bucket\": \"\",\n \"outputS3KeyPrefix\": \"\",\n \"shots\": 0,\n \"tags\": {}\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/quantum-task"
payload := strings.NewReader("{\n \"action\": \"\",\n \"clientToken\": \"\",\n \"deviceArn\": \"\",\n \"deviceParameters\": \"\",\n \"jobToken\": \"\",\n \"outputS3Bucket\": \"\",\n \"outputS3KeyPrefix\": \"\",\n \"shots\": 0,\n \"tags\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/quantum-task HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 181
{
"action": "",
"clientToken": "",
"deviceArn": "",
"deviceParameters": "",
"jobToken": "",
"outputS3Bucket": "",
"outputS3KeyPrefix": "",
"shots": 0,
"tags": {}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/quantum-task")
.setHeader("content-type", "application/json")
.setBody("{\n \"action\": \"\",\n \"clientToken\": \"\",\n \"deviceArn\": \"\",\n \"deviceParameters\": \"\",\n \"jobToken\": \"\",\n \"outputS3Bucket\": \"\",\n \"outputS3KeyPrefix\": \"\",\n \"shots\": 0,\n \"tags\": {}\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/quantum-task"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"action\": \"\",\n \"clientToken\": \"\",\n \"deviceArn\": \"\",\n \"deviceParameters\": \"\",\n \"jobToken\": \"\",\n \"outputS3Bucket\": \"\",\n \"outputS3KeyPrefix\": \"\",\n \"shots\": 0,\n \"tags\": {}\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"action\": \"\",\n \"clientToken\": \"\",\n \"deviceArn\": \"\",\n \"deviceParameters\": \"\",\n \"jobToken\": \"\",\n \"outputS3Bucket\": \"\",\n \"outputS3KeyPrefix\": \"\",\n \"shots\": 0,\n \"tags\": {}\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/quantum-task")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/quantum-task")
.header("content-type", "application/json")
.body("{\n \"action\": \"\",\n \"clientToken\": \"\",\n \"deviceArn\": \"\",\n \"deviceParameters\": \"\",\n \"jobToken\": \"\",\n \"outputS3Bucket\": \"\",\n \"outputS3KeyPrefix\": \"\",\n \"shots\": 0,\n \"tags\": {}\n}")
.asString();
const data = JSON.stringify({
action: '',
clientToken: '',
deviceArn: '',
deviceParameters: '',
jobToken: '',
outputS3Bucket: '',
outputS3KeyPrefix: '',
shots: 0,
tags: {}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/quantum-task');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/quantum-task',
headers: {'content-type': 'application/json'},
data: {
action: '',
clientToken: '',
deviceArn: '',
deviceParameters: '',
jobToken: '',
outputS3Bucket: '',
outputS3KeyPrefix: '',
shots: 0,
tags: {}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/quantum-task';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"action":"","clientToken":"","deviceArn":"","deviceParameters":"","jobToken":"","outputS3Bucket":"","outputS3KeyPrefix":"","shots":0,"tags":{}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/quantum-task',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "action": "",\n "clientToken": "",\n "deviceArn": "",\n "deviceParameters": "",\n "jobToken": "",\n "outputS3Bucket": "",\n "outputS3KeyPrefix": "",\n "shots": 0,\n "tags": {}\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"action\": \"\",\n \"clientToken\": \"\",\n \"deviceArn\": \"\",\n \"deviceParameters\": \"\",\n \"jobToken\": \"\",\n \"outputS3Bucket\": \"\",\n \"outputS3KeyPrefix\": \"\",\n \"shots\": 0,\n \"tags\": {}\n}")
val request = Request.Builder()
.url("{{baseUrl}}/quantum-task")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/quantum-task',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
action: '',
clientToken: '',
deviceArn: '',
deviceParameters: '',
jobToken: '',
outputS3Bucket: '',
outputS3KeyPrefix: '',
shots: 0,
tags: {}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/quantum-task',
headers: {'content-type': 'application/json'},
body: {
action: '',
clientToken: '',
deviceArn: '',
deviceParameters: '',
jobToken: '',
outputS3Bucket: '',
outputS3KeyPrefix: '',
shots: 0,
tags: {}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/quantum-task');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
action: '',
clientToken: '',
deviceArn: '',
deviceParameters: '',
jobToken: '',
outputS3Bucket: '',
outputS3KeyPrefix: '',
shots: 0,
tags: {}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/quantum-task',
headers: {'content-type': 'application/json'},
data: {
action: '',
clientToken: '',
deviceArn: '',
deviceParameters: '',
jobToken: '',
outputS3Bucket: '',
outputS3KeyPrefix: '',
shots: 0,
tags: {}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/quantum-task';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"action":"","clientToken":"","deviceArn":"","deviceParameters":"","jobToken":"","outputS3Bucket":"","outputS3KeyPrefix":"","shots":0,"tags":{}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"action": @"",
@"clientToken": @"",
@"deviceArn": @"",
@"deviceParameters": @"",
@"jobToken": @"",
@"outputS3Bucket": @"",
@"outputS3KeyPrefix": @"",
@"shots": @0,
@"tags": @{ } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/quantum-task"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/quantum-task" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"action\": \"\",\n \"clientToken\": \"\",\n \"deviceArn\": \"\",\n \"deviceParameters\": \"\",\n \"jobToken\": \"\",\n \"outputS3Bucket\": \"\",\n \"outputS3KeyPrefix\": \"\",\n \"shots\": 0,\n \"tags\": {}\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/quantum-task",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'action' => '',
'clientToken' => '',
'deviceArn' => '',
'deviceParameters' => '',
'jobToken' => '',
'outputS3Bucket' => '',
'outputS3KeyPrefix' => '',
'shots' => 0,
'tags' => [
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/quantum-task', [
'body' => '{
"action": "",
"clientToken": "",
"deviceArn": "",
"deviceParameters": "",
"jobToken": "",
"outputS3Bucket": "",
"outputS3KeyPrefix": "",
"shots": 0,
"tags": {}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/quantum-task');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'action' => '',
'clientToken' => '',
'deviceArn' => '',
'deviceParameters' => '',
'jobToken' => '',
'outputS3Bucket' => '',
'outputS3KeyPrefix' => '',
'shots' => 0,
'tags' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'action' => '',
'clientToken' => '',
'deviceArn' => '',
'deviceParameters' => '',
'jobToken' => '',
'outputS3Bucket' => '',
'outputS3KeyPrefix' => '',
'shots' => 0,
'tags' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/quantum-task');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/quantum-task' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"action": "",
"clientToken": "",
"deviceArn": "",
"deviceParameters": "",
"jobToken": "",
"outputS3Bucket": "",
"outputS3KeyPrefix": "",
"shots": 0,
"tags": {}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/quantum-task' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"action": "",
"clientToken": "",
"deviceArn": "",
"deviceParameters": "",
"jobToken": "",
"outputS3Bucket": "",
"outputS3KeyPrefix": "",
"shots": 0,
"tags": {}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"action\": \"\",\n \"clientToken\": \"\",\n \"deviceArn\": \"\",\n \"deviceParameters\": \"\",\n \"jobToken\": \"\",\n \"outputS3Bucket\": \"\",\n \"outputS3KeyPrefix\": \"\",\n \"shots\": 0,\n \"tags\": {}\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/quantum-task", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/quantum-task"
payload = {
"action": "",
"clientToken": "",
"deviceArn": "",
"deviceParameters": "",
"jobToken": "",
"outputS3Bucket": "",
"outputS3KeyPrefix": "",
"shots": 0,
"tags": {}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/quantum-task"
payload <- "{\n \"action\": \"\",\n \"clientToken\": \"\",\n \"deviceArn\": \"\",\n \"deviceParameters\": \"\",\n \"jobToken\": \"\",\n \"outputS3Bucket\": \"\",\n \"outputS3KeyPrefix\": \"\",\n \"shots\": 0,\n \"tags\": {}\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/quantum-task")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"action\": \"\",\n \"clientToken\": \"\",\n \"deviceArn\": \"\",\n \"deviceParameters\": \"\",\n \"jobToken\": \"\",\n \"outputS3Bucket\": \"\",\n \"outputS3KeyPrefix\": \"\",\n \"shots\": 0,\n \"tags\": {}\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/quantum-task') do |req|
req.body = "{\n \"action\": \"\",\n \"clientToken\": \"\",\n \"deviceArn\": \"\",\n \"deviceParameters\": \"\",\n \"jobToken\": \"\",\n \"outputS3Bucket\": \"\",\n \"outputS3KeyPrefix\": \"\",\n \"shots\": 0,\n \"tags\": {}\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/quantum-task";
let payload = json!({
"action": "",
"clientToken": "",
"deviceArn": "",
"deviceParameters": "",
"jobToken": "",
"outputS3Bucket": "",
"outputS3KeyPrefix": "",
"shots": 0,
"tags": json!({})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/quantum-task \
--header 'content-type: application/json' \
--data '{
"action": "",
"clientToken": "",
"deviceArn": "",
"deviceParameters": "",
"jobToken": "",
"outputS3Bucket": "",
"outputS3KeyPrefix": "",
"shots": 0,
"tags": {}
}'
echo '{
"action": "",
"clientToken": "",
"deviceArn": "",
"deviceParameters": "",
"jobToken": "",
"outputS3Bucket": "",
"outputS3KeyPrefix": "",
"shots": 0,
"tags": {}
}' | \
http POST {{baseUrl}}/quantum-task \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "action": "",\n "clientToken": "",\n "deviceArn": "",\n "deviceParameters": "",\n "jobToken": "",\n "outputS3Bucket": "",\n "outputS3KeyPrefix": "",\n "shots": 0,\n "tags": {}\n}' \
--output-document \
- {{baseUrl}}/quantum-task
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"action": "",
"clientToken": "",
"deviceArn": "",
"deviceParameters": "",
"jobToken": "",
"outputS3Bucket": "",
"outputS3KeyPrefix": "",
"shots": 0,
"tags": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/quantum-task")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
GetDevice
{{baseUrl}}/device/:deviceArn
QUERY PARAMS
deviceArn
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/device/:deviceArn");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/device/:deviceArn")
require "http/client"
url = "{{baseUrl}}/device/:deviceArn"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/device/:deviceArn"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/device/:deviceArn");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/device/:deviceArn"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/device/:deviceArn HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/device/:deviceArn")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/device/:deviceArn"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/device/:deviceArn")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/device/:deviceArn")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/device/:deviceArn');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/device/:deviceArn'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/device/:deviceArn';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/device/:deviceArn',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/device/:deviceArn")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/device/:deviceArn',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/device/:deviceArn'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/device/:deviceArn');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/device/:deviceArn'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/device/:deviceArn';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/device/:deviceArn"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/device/:deviceArn" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/device/:deviceArn",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/device/:deviceArn');
echo $response->getBody();
setUrl('{{baseUrl}}/device/:deviceArn');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/device/:deviceArn');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/device/:deviceArn' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/device/:deviceArn' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/device/:deviceArn")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/device/:deviceArn"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/device/:deviceArn"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/device/:deviceArn")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/device/:deviceArn') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/device/:deviceArn";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/device/:deviceArn
http GET {{baseUrl}}/device/:deviceArn
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/device/:deviceArn
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/device/:deviceArn")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
GetJob
{{baseUrl}}/job/:jobArn
QUERY PARAMS
jobArn
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/job/:jobArn");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/job/:jobArn")
require "http/client"
url = "{{baseUrl}}/job/:jobArn"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/job/:jobArn"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/job/:jobArn");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/job/:jobArn"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/job/:jobArn HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/job/:jobArn")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/job/:jobArn"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/job/:jobArn")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/job/:jobArn")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/job/:jobArn');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/job/:jobArn'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/job/:jobArn';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/job/:jobArn',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/job/:jobArn")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/job/:jobArn',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/job/:jobArn'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/job/:jobArn');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/job/:jobArn'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/job/:jobArn';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/job/:jobArn"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/job/:jobArn" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/job/:jobArn",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/job/:jobArn');
echo $response->getBody();
setUrl('{{baseUrl}}/job/:jobArn');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/job/:jobArn');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/job/:jobArn' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/job/:jobArn' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/job/:jobArn")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/job/:jobArn"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/job/:jobArn"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/job/:jobArn")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/job/:jobArn') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/job/:jobArn";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/job/:jobArn
http GET {{baseUrl}}/job/:jobArn
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/job/:jobArn
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/job/:jobArn")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
GetQuantumTask
{{baseUrl}}/quantum-task/:quantumTaskArn
QUERY PARAMS
quantumTaskArn
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/quantum-task/:quantumTaskArn");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/quantum-task/:quantumTaskArn")
require "http/client"
url = "{{baseUrl}}/quantum-task/:quantumTaskArn"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/quantum-task/:quantumTaskArn"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/quantum-task/:quantumTaskArn");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/quantum-task/:quantumTaskArn"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/quantum-task/:quantumTaskArn HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/quantum-task/:quantumTaskArn")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/quantum-task/:quantumTaskArn"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/quantum-task/:quantumTaskArn")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/quantum-task/:quantumTaskArn")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/quantum-task/:quantumTaskArn');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/quantum-task/:quantumTaskArn'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/quantum-task/:quantumTaskArn';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/quantum-task/:quantumTaskArn',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/quantum-task/:quantumTaskArn")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/quantum-task/:quantumTaskArn',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/quantum-task/:quantumTaskArn'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/quantum-task/:quantumTaskArn');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/quantum-task/:quantumTaskArn'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/quantum-task/:quantumTaskArn';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/quantum-task/:quantumTaskArn"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/quantum-task/:quantumTaskArn" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/quantum-task/:quantumTaskArn",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/quantum-task/:quantumTaskArn');
echo $response->getBody();
setUrl('{{baseUrl}}/quantum-task/:quantumTaskArn');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/quantum-task/:quantumTaskArn');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/quantum-task/:quantumTaskArn' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/quantum-task/:quantumTaskArn' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/quantum-task/:quantumTaskArn")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/quantum-task/:quantumTaskArn"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/quantum-task/:quantumTaskArn"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/quantum-task/:quantumTaskArn")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/quantum-task/:quantumTaskArn') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/quantum-task/:quantumTaskArn";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/quantum-task/:quantumTaskArn
http GET {{baseUrl}}/quantum-task/:quantumTaskArn
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/quantum-task/:quantumTaskArn
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/quantum-task/:quantumTaskArn")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
ListTagsForResource
{{baseUrl}}/tags/:resourceArn
QUERY PARAMS
resourceArn
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/tags/:resourceArn");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/tags/:resourceArn")
require "http/client"
url = "{{baseUrl}}/tags/:resourceArn"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/tags/:resourceArn"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/tags/:resourceArn");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/tags/:resourceArn"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/tags/:resourceArn HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/tags/:resourceArn")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/tags/:resourceArn"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/tags/:resourceArn")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/tags/:resourceArn")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/tags/:resourceArn');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/tags/:resourceArn'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/tags/:resourceArn';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/tags/:resourceArn',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/tags/:resourceArn")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/tags/:resourceArn',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/tags/:resourceArn'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/tags/:resourceArn');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/tags/:resourceArn'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/tags/:resourceArn';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/tags/:resourceArn"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/tags/:resourceArn" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/tags/:resourceArn",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/tags/:resourceArn');
echo $response->getBody();
setUrl('{{baseUrl}}/tags/:resourceArn');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/tags/:resourceArn');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/tags/:resourceArn' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/tags/:resourceArn' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/tags/:resourceArn")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/tags/:resourceArn"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/tags/:resourceArn"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/tags/:resourceArn")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/tags/:resourceArn') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/tags/:resourceArn";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/tags/:resourceArn
http GET {{baseUrl}}/tags/:resourceArn
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/tags/:resourceArn
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/tags/:resourceArn")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
SearchDevices
{{baseUrl}}/devices
BODY json
{
"filters": [
{
"name": "",
"values": ""
}
],
"maxResults": 0,
"nextToken": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/devices");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/devices" {:content-type :json
:form-params {:filters [{:name ""
:values ""}]
:maxResults 0
:nextToken ""}})
require "http/client"
url = "{{baseUrl}}/devices"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/devices"),
Content = new StringContent("{\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/devices");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/devices"
payload := strings.NewReader("{\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/devices HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 109
{
"filters": [
{
"name": "",
"values": ""
}
],
"maxResults": 0,
"nextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/devices")
.setHeader("content-type", "application/json")
.setBody("{\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/devices"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/devices")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/devices")
.header("content-type", "application/json")
.body("{\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
filters: [
{
name: '',
values: ''
}
],
maxResults: 0,
nextToken: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/devices');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/devices',
headers: {'content-type': 'application/json'},
data: {filters: [{name: '', values: ''}], maxResults: 0, nextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/devices';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"filters":[{"name":"","values":""}],"maxResults":0,"nextToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/devices',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "filters": [\n {\n "name": "",\n "values": ""\n }\n ],\n "maxResults": 0,\n "nextToken": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/devices")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/devices',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({filters: [{name: '', values: ''}], maxResults: 0, nextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/devices',
headers: {'content-type': 'application/json'},
body: {filters: [{name: '', values: ''}], maxResults: 0, nextToken: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/devices');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
filters: [
{
name: '',
values: ''
}
],
maxResults: 0,
nextToken: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/devices',
headers: {'content-type': 'application/json'},
data: {filters: [{name: '', values: ''}], maxResults: 0, nextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/devices';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"filters":[{"name":"","values":""}],"maxResults":0,"nextToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"filters": @[ @{ @"name": @"", @"values": @"" } ],
@"maxResults": @0,
@"nextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/devices"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/devices" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/devices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'filters' => [
[
'name' => '',
'values' => ''
]
],
'maxResults' => 0,
'nextToken' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/devices', [
'body' => '{
"filters": [
{
"name": "",
"values": ""
}
],
"maxResults": 0,
"nextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/devices');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'filters' => [
[
'name' => '',
'values' => ''
]
],
'maxResults' => 0,
'nextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'filters' => [
[
'name' => '',
'values' => ''
]
],
'maxResults' => 0,
'nextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/devices');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/devices' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"filters": [
{
"name": "",
"values": ""
}
],
"maxResults": 0,
"nextToken": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/devices' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"filters": [
{
"name": "",
"values": ""
}
],
"maxResults": 0,
"nextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/devices", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/devices"
payload = {
"filters": [
{
"name": "",
"values": ""
}
],
"maxResults": 0,
"nextToken": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/devices"
payload <- "{\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/devices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/devices') do |req|
req.body = "{\n \"filters\": [\n {\n \"name\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/devices";
let payload = json!({
"filters": (
json!({
"name": "",
"values": ""
})
),
"maxResults": 0,
"nextToken": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/devices \
--header 'content-type: application/json' \
--data '{
"filters": [
{
"name": "",
"values": ""
}
],
"maxResults": 0,
"nextToken": ""
}'
echo '{
"filters": [
{
"name": "",
"values": ""
}
],
"maxResults": 0,
"nextToken": ""
}' | \
http POST {{baseUrl}}/devices \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "filters": [\n {\n "name": "",\n "values": ""\n }\n ],\n "maxResults": 0,\n "nextToken": ""\n}' \
--output-document \
- {{baseUrl}}/devices
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"filters": [
[
"name": "",
"values": ""
]
],
"maxResults": 0,
"nextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/devices")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
SearchJobs
{{baseUrl}}/jobs
BODY json
{
"filters": [
{
"name": "",
"operator": "",
"values": ""
}
],
"maxResults": 0,
"nextToken": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/jobs");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"filters\": [\n {\n \"name\": \"\",\n \"operator\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/jobs" {:content-type :json
:form-params {:filters [{:name ""
:operator ""
:values ""}]
:maxResults 0
:nextToken ""}})
require "http/client"
url = "{{baseUrl}}/jobs"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"filters\": [\n {\n \"name\": \"\",\n \"operator\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/jobs"),
Content = new StringContent("{\n \"filters\": [\n {\n \"name\": \"\",\n \"operator\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/jobs");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"filters\": [\n {\n \"name\": \"\",\n \"operator\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/jobs"
payload := strings.NewReader("{\n \"filters\": [\n {\n \"name\": \"\",\n \"operator\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/jobs HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 131
{
"filters": [
{
"name": "",
"operator": "",
"values": ""
}
],
"maxResults": 0,
"nextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/jobs")
.setHeader("content-type", "application/json")
.setBody("{\n \"filters\": [\n {\n \"name\": \"\",\n \"operator\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/jobs"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"filters\": [\n {\n \"name\": \"\",\n \"operator\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"filters\": [\n {\n \"name\": \"\",\n \"operator\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/jobs")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/jobs")
.header("content-type", "application/json")
.body("{\n \"filters\": [\n {\n \"name\": \"\",\n \"operator\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
filters: [
{
name: '',
operator: '',
values: ''
}
],
maxResults: 0,
nextToken: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/jobs');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/jobs',
headers: {'content-type': 'application/json'},
data: {filters: [{name: '', operator: '', values: ''}], maxResults: 0, nextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/jobs';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"filters":[{"name":"","operator":"","values":""}],"maxResults":0,"nextToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/jobs',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "filters": [\n {\n "name": "",\n "operator": "",\n "values": ""\n }\n ],\n "maxResults": 0,\n "nextToken": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"filters\": [\n {\n \"name\": \"\",\n \"operator\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/jobs")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/jobs',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({filters: [{name: '', operator: '', values: ''}], maxResults: 0, nextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/jobs',
headers: {'content-type': 'application/json'},
body: {filters: [{name: '', operator: '', values: ''}], maxResults: 0, nextToken: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/jobs');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
filters: [
{
name: '',
operator: '',
values: ''
}
],
maxResults: 0,
nextToken: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/jobs',
headers: {'content-type': 'application/json'},
data: {filters: [{name: '', operator: '', values: ''}], maxResults: 0, nextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/jobs';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"filters":[{"name":"","operator":"","values":""}],"maxResults":0,"nextToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"filters": @[ @{ @"name": @"", @"operator": @"", @"values": @"" } ],
@"maxResults": @0,
@"nextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/jobs"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/jobs" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"filters\": [\n {\n \"name\": \"\",\n \"operator\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/jobs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'filters' => [
[
'name' => '',
'operator' => '',
'values' => ''
]
],
'maxResults' => 0,
'nextToken' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/jobs', [
'body' => '{
"filters": [
{
"name": "",
"operator": "",
"values": ""
}
],
"maxResults": 0,
"nextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/jobs');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'filters' => [
[
'name' => '',
'operator' => '',
'values' => ''
]
],
'maxResults' => 0,
'nextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'filters' => [
[
'name' => '',
'operator' => '',
'values' => ''
]
],
'maxResults' => 0,
'nextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/jobs');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/jobs' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"filters": [
{
"name": "",
"operator": "",
"values": ""
}
],
"maxResults": 0,
"nextToken": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/jobs' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"filters": [
{
"name": "",
"operator": "",
"values": ""
}
],
"maxResults": 0,
"nextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"filters\": [\n {\n \"name\": \"\",\n \"operator\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/jobs", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/jobs"
payload = {
"filters": [
{
"name": "",
"operator": "",
"values": ""
}
],
"maxResults": 0,
"nextToken": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/jobs"
payload <- "{\n \"filters\": [\n {\n \"name\": \"\",\n \"operator\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/jobs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"filters\": [\n {\n \"name\": \"\",\n \"operator\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/jobs') do |req|
req.body = "{\n \"filters\": [\n {\n \"name\": \"\",\n \"operator\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/jobs";
let payload = json!({
"filters": (
json!({
"name": "",
"operator": "",
"values": ""
})
),
"maxResults": 0,
"nextToken": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/jobs \
--header 'content-type: application/json' \
--data '{
"filters": [
{
"name": "",
"operator": "",
"values": ""
}
],
"maxResults": 0,
"nextToken": ""
}'
echo '{
"filters": [
{
"name": "",
"operator": "",
"values": ""
}
],
"maxResults": 0,
"nextToken": ""
}' | \
http POST {{baseUrl}}/jobs \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "filters": [\n {\n "name": "",\n "operator": "",\n "values": ""\n }\n ],\n "maxResults": 0,\n "nextToken": ""\n}' \
--output-document \
- {{baseUrl}}/jobs
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"filters": [
[
"name": "",
"operator": "",
"values": ""
]
],
"maxResults": 0,
"nextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/jobs")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
SearchQuantumTasks
{{baseUrl}}/quantum-tasks
BODY json
{
"filters": [
{
"name": "",
"operator": "",
"values": ""
}
],
"maxResults": 0,
"nextToken": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/quantum-tasks");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"filters\": [\n {\n \"name\": \"\",\n \"operator\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/quantum-tasks" {:content-type :json
:form-params {:filters [{:name ""
:operator ""
:values ""}]
:maxResults 0
:nextToken ""}})
require "http/client"
url = "{{baseUrl}}/quantum-tasks"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"filters\": [\n {\n \"name\": \"\",\n \"operator\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/quantum-tasks"),
Content = new StringContent("{\n \"filters\": [\n {\n \"name\": \"\",\n \"operator\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/quantum-tasks");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"filters\": [\n {\n \"name\": \"\",\n \"operator\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/quantum-tasks"
payload := strings.NewReader("{\n \"filters\": [\n {\n \"name\": \"\",\n \"operator\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/quantum-tasks HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 131
{
"filters": [
{
"name": "",
"operator": "",
"values": ""
}
],
"maxResults": 0,
"nextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/quantum-tasks")
.setHeader("content-type", "application/json")
.setBody("{\n \"filters\": [\n {\n \"name\": \"\",\n \"operator\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/quantum-tasks"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"filters\": [\n {\n \"name\": \"\",\n \"operator\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"filters\": [\n {\n \"name\": \"\",\n \"operator\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/quantum-tasks")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/quantum-tasks")
.header("content-type", "application/json")
.body("{\n \"filters\": [\n {\n \"name\": \"\",\n \"operator\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
filters: [
{
name: '',
operator: '',
values: ''
}
],
maxResults: 0,
nextToken: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/quantum-tasks');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/quantum-tasks',
headers: {'content-type': 'application/json'},
data: {filters: [{name: '', operator: '', values: ''}], maxResults: 0, nextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/quantum-tasks';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"filters":[{"name":"","operator":"","values":""}],"maxResults":0,"nextToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/quantum-tasks',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "filters": [\n {\n "name": "",\n "operator": "",\n "values": ""\n }\n ],\n "maxResults": 0,\n "nextToken": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"filters\": [\n {\n \"name\": \"\",\n \"operator\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/quantum-tasks")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/quantum-tasks',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({filters: [{name: '', operator: '', values: ''}], maxResults: 0, nextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/quantum-tasks',
headers: {'content-type': 'application/json'},
body: {filters: [{name: '', operator: '', values: ''}], maxResults: 0, nextToken: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/quantum-tasks');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
filters: [
{
name: '',
operator: '',
values: ''
}
],
maxResults: 0,
nextToken: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/quantum-tasks',
headers: {'content-type': 'application/json'},
data: {filters: [{name: '', operator: '', values: ''}], maxResults: 0, nextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/quantum-tasks';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"filters":[{"name":"","operator":"","values":""}],"maxResults":0,"nextToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"filters": @[ @{ @"name": @"", @"operator": @"", @"values": @"" } ],
@"maxResults": @0,
@"nextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/quantum-tasks"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/quantum-tasks" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"filters\": [\n {\n \"name\": \"\",\n \"operator\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/quantum-tasks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'filters' => [
[
'name' => '',
'operator' => '',
'values' => ''
]
],
'maxResults' => 0,
'nextToken' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/quantum-tasks', [
'body' => '{
"filters": [
{
"name": "",
"operator": "",
"values": ""
}
],
"maxResults": 0,
"nextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/quantum-tasks');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'filters' => [
[
'name' => '',
'operator' => '',
'values' => ''
]
],
'maxResults' => 0,
'nextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'filters' => [
[
'name' => '',
'operator' => '',
'values' => ''
]
],
'maxResults' => 0,
'nextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/quantum-tasks');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/quantum-tasks' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"filters": [
{
"name": "",
"operator": "",
"values": ""
}
],
"maxResults": 0,
"nextToken": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/quantum-tasks' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"filters": [
{
"name": "",
"operator": "",
"values": ""
}
],
"maxResults": 0,
"nextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"filters\": [\n {\n \"name\": \"\",\n \"operator\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/quantum-tasks", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/quantum-tasks"
payload = {
"filters": [
{
"name": "",
"operator": "",
"values": ""
}
],
"maxResults": 0,
"nextToken": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/quantum-tasks"
payload <- "{\n \"filters\": [\n {\n \"name\": \"\",\n \"operator\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/quantum-tasks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"filters\": [\n {\n \"name\": \"\",\n \"operator\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/quantum-tasks') do |req|
req.body = "{\n \"filters\": [\n {\n \"name\": \"\",\n \"operator\": \"\",\n \"values\": \"\"\n }\n ],\n \"maxResults\": 0,\n \"nextToken\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/quantum-tasks";
let payload = json!({
"filters": (
json!({
"name": "",
"operator": "",
"values": ""
})
),
"maxResults": 0,
"nextToken": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/quantum-tasks \
--header 'content-type: application/json' \
--data '{
"filters": [
{
"name": "",
"operator": "",
"values": ""
}
],
"maxResults": 0,
"nextToken": ""
}'
echo '{
"filters": [
{
"name": "",
"operator": "",
"values": ""
}
],
"maxResults": 0,
"nextToken": ""
}' | \
http POST {{baseUrl}}/quantum-tasks \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "filters": [\n {\n "name": "",\n "operator": "",\n "values": ""\n }\n ],\n "maxResults": 0,\n "nextToken": ""\n}' \
--output-document \
- {{baseUrl}}/quantum-tasks
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"filters": [
[
"name": "",
"operator": "",
"values": ""
]
],
"maxResults": 0,
"nextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/quantum-tasks")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
TagResource
{{baseUrl}}/tags/:resourceArn
QUERY PARAMS
resourceArn
BODY json
{
"tags": {}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/tags/:resourceArn");
struct curl_slist *headers = NULL;
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}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/tags/:resourceArn" {:content-type :json
:form-params {:tags {}}})
require "http/client"
url = "{{baseUrl}}/tags/:resourceArn"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"tags\": {}\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/tags/:resourceArn"),
Content = new StringContent("{\n \"tags\": {}\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/tags/:resourceArn");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"tags\": {}\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/tags/:resourceArn"
payload := strings.NewReader("{\n \"tags\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/tags/:resourceArn HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 16
{
"tags": {}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/tags/:resourceArn")
.setHeader("content-type", "application/json")
.setBody("{\n \"tags\": {}\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/tags/:resourceArn"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"tags\": {}\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"tags\": {}\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/tags/:resourceArn")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/tags/:resourceArn")
.header("content-type", "application/json")
.body("{\n \"tags\": {}\n}")
.asString();
const data = JSON.stringify({
tags: {}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/tags/:resourceArn');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/tags/:resourceArn',
headers: {'content-type': 'application/json'},
data: {tags: {}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/tags/:resourceArn';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"tags":{}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/tags/:resourceArn',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "tags": {}\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"tags\": {}\n}")
val request = Request.Builder()
.url("{{baseUrl}}/tags/:resourceArn")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/tags/:resourceArn',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.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: {}}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/tags/:resourceArn',
headers: {'content-type': 'application/json'},
body: {tags: {}},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/tags/:resourceArn');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
tags: {}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/tags/:resourceArn',
headers: {'content-type': 'application/json'},
data: {tags: {}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/tags/:resourceArn';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"tags":{}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"tags": @{ } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/tags/:resourceArn"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/tags/:resourceArn" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"tags\": {}\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/tags/:resourceArn",
CURLOPT_RETURNTRANSFER => 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' => [
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/tags/:resourceArn', [
'body' => '{
"tags": {}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/tags/:resourceArn');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'tags' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'tags' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/tags/:resourceArn');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/tags/:resourceArn' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"tags": {}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/tags/:resourceArn' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"tags": {}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"tags\": {}\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/tags/:resourceArn", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/tags/:resourceArn"
payload = { "tags": {} }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/tags/:resourceArn"
payload <- "{\n \"tags\": {}\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/tags/:resourceArn")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"tags\": {}\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/tags/:resourceArn') do |req|
req.body = "{\n \"tags\": {}\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/tags/:resourceArn";
let payload = json!({"tags": json!({})});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/tags/:resourceArn \
--header 'content-type: application/json' \
--data '{
"tags": {}
}'
echo '{
"tags": {}
}' | \
http POST {{baseUrl}}/tags/:resourceArn \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "tags": {}\n}' \
--output-document \
- {{baseUrl}}/tags/:resourceArn
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["tags": []] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/tags/:resourceArn")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
UntagResource
{{baseUrl}}/tags/:resourceArn#tagKeys
QUERY PARAMS
tagKeys
resourceArn
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/tags/:resourceArn#tagKeys" {:query-params {:tagKeys ""}})
require "http/client"
url = "{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/tags/:resourceArn?tagKeys= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/tags/:resourceArn#tagKeys',
params: {tagKeys: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/tags/:resourceArn?tagKeys=',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/tags/:resourceArn#tagKeys',
qs: {tagKeys: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/tags/:resourceArn#tagKeys');
req.query({
tagKeys: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/tags/:resourceArn#tagKeys',
params: {tagKeys: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys');
echo $response->getBody();
setUrl('{{baseUrl}}/tags/:resourceArn#tagKeys');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'tagKeys' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/tags/:resourceArn#tagKeys');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'tagKeys' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/tags/:resourceArn?tagKeys=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/tags/:resourceArn#tagKeys"
querystring = {"tagKeys":""}
response = requests.delete(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/tags/:resourceArn#tagKeys"
queryString <- list(tagKeys = "")
response <- VERB("DELETE", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/tags/:resourceArn') do |req|
req.params['tagKeys'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/tags/:resourceArn#tagKeys";
let querystring = [
("tagKeys", ""),
];
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url '{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys'
http DELETE '{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys'
wget --quiet \
--method DELETE \
--output-document \
- '{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys'
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()