Amazon DynamoDB Streams
POST
DescribeStream
{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.DescribeStream
HEADERS
X-Amz-Target
BODY json
{
"StreamArn": "",
"Limit": "",
"ExclusiveStartShardId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.DescribeStream");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"StreamArn\": \"\",\n \"Limit\": \"\",\n \"ExclusiveStartShardId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.DescribeStream" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:StreamArn ""
:Limit ""
:ExclusiveStartShardId ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.DescribeStream"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"StreamArn\": \"\",\n \"Limit\": \"\",\n \"ExclusiveStartShardId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.DescribeStream"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"StreamArn\": \"\",\n \"Limit\": \"\",\n \"ExclusiveStartShardId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.DescribeStream");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"StreamArn\": \"\",\n \"Limit\": \"\",\n \"ExclusiveStartShardId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.DescribeStream"
payload := strings.NewReader("{\n \"StreamArn\": \"\",\n \"Limit\": \"\",\n \"ExclusiveStartShardId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 67
{
"StreamArn": "",
"Limit": "",
"ExclusiveStartShardId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.DescribeStream")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"StreamArn\": \"\",\n \"Limit\": \"\",\n \"ExclusiveStartShardId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.DescribeStream"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"StreamArn\": \"\",\n \"Limit\": \"\",\n \"ExclusiveStartShardId\": \"\"\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 \"StreamArn\": \"\",\n \"Limit\": \"\",\n \"ExclusiveStartShardId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.DescribeStream")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.DescribeStream")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"StreamArn\": \"\",\n \"Limit\": \"\",\n \"ExclusiveStartShardId\": \"\"\n}")
.asString();
const data = JSON.stringify({
StreamArn: '',
Limit: '',
ExclusiveStartShardId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.DescribeStream');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.DescribeStream',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {StreamArn: '', Limit: '', ExclusiveStartShardId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.DescribeStream';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StreamArn":"","Limit":"","ExclusiveStartShardId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.DescribeStream',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "StreamArn": "",\n "Limit": "",\n "ExclusiveStartShardId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"StreamArn\": \"\",\n \"Limit\": \"\",\n \"ExclusiveStartShardId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.DescribeStream")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({StreamArn: '', Limit: '', ExclusiveStartShardId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.DescribeStream',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {StreamArn: '', Limit: '', ExclusiveStartShardId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.DescribeStream');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
StreamArn: '',
Limit: '',
ExclusiveStartShardId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.DescribeStream',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {StreamArn: '', Limit: '', ExclusiveStartShardId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.DescribeStream';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StreamArn":"","Limit":"","ExclusiveStartShardId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"StreamArn": @"",
@"Limit": @"",
@"ExclusiveStartShardId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.DescribeStream"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.DescribeStream" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"StreamArn\": \"\",\n \"Limit\": \"\",\n \"ExclusiveStartShardId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.DescribeStream",
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([
'StreamArn' => '',
'Limit' => '',
'ExclusiveStartShardId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.DescribeStream', [
'body' => '{
"StreamArn": "",
"Limit": "",
"ExclusiveStartShardId": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.DescribeStream');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'StreamArn' => '',
'Limit' => '',
'ExclusiveStartShardId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'StreamArn' => '',
'Limit' => '',
'ExclusiveStartShardId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.DescribeStream');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.DescribeStream' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StreamArn": "",
"Limit": "",
"ExclusiveStartShardId": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.DescribeStream' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StreamArn": "",
"Limit": "",
"ExclusiveStartShardId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"StreamArn\": \"\",\n \"Limit\": \"\",\n \"ExclusiveStartShardId\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.DescribeStream"
payload = {
"StreamArn": "",
"Limit": "",
"ExclusiveStartShardId": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.DescribeStream"
payload <- "{\n \"StreamArn\": \"\",\n \"Limit\": \"\",\n \"ExclusiveStartShardId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.DescribeStream")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"StreamArn\": \"\",\n \"Limit\": \"\",\n \"ExclusiveStartShardId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"StreamArn\": \"\",\n \"Limit\": \"\",\n \"ExclusiveStartShardId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.DescribeStream";
let payload = json!({
"StreamArn": "",
"Limit": "",
"ExclusiveStartShardId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.DescribeStream' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"StreamArn": "",
"Limit": "",
"ExclusiveStartShardId": ""
}'
echo '{
"StreamArn": "",
"Limit": "",
"ExclusiveStartShardId": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.DescribeStream' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "StreamArn": "",\n "Limit": "",\n "ExclusiveStartShardId": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.DescribeStream'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"StreamArn": "",
"Limit": "",
"ExclusiveStartShardId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.DescribeStream")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"StreamDescription": {
"CreationRequestDateTime": "Wed May 20 13:51:10 PDT 2015",
"KeySchema": [
{
"AttributeName": "ForumName",
"KeyType": "HASH"
},
{
"AttributeName": "Subject",
"KeyType": "RANGE"
}
],
"Shards": [
{
"SequenceNumberRange": {
"EndingSequenceNumber": "20500000000000000910398",
"StartingSequenceNumber": "20500000000000000910398"
},
"ShardId": "shardId-00000001414562045508-2bac9cd2"
},
{
"ParentShardId": "shardId-00000001414562045508-2bac9cd2",
"SequenceNumberRange": {
"EndingSequenceNumber": "820400000000000001192334",
"StartingSequenceNumber": "820400000000000001192334"
},
"ShardId": "shardId-00000001414576573621-f55eea83"
},
{
"ParentShardId": "shardId-00000001414576573621-f55eea83",
"SequenceNumberRange": {
"EndingSequenceNumber": "1683700000000000001135967",
"StartingSequenceNumber": "1683700000000000001135967"
},
"ShardId": "shardId-00000001414592258131-674fd923"
},
{
"ParentShardId": "shardId-00000001414592258131-674fd923",
"SequenceNumberRange": {
"StartingSequenceNumber": "2574600000000000000935255"
},
"ShardId": "shardId-00000001414608446368-3a1afbaf"
}
],
"StreamArn": "arn:aws:dynamodb:us-west-2:111122223333:table/Forum/stream/2015-05-20T20:51:10.252",
"StreamLabel": "2015-05-20T20:51:10.252",
"StreamStatus": "ENABLED",
"StreamViewType": "NEW_AND_OLD_IMAGES",
"TableName": "Forum"
}
}
POST
GetRecords
{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetRecords
HEADERS
X-Amz-Target
BODY json
{
"ShardIterator": "",
"Limit": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetRecords");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"ShardIterator\": \"\",\n \"Limit\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetRecords" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:ShardIterator ""
:Limit ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetRecords"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"ShardIterator\": \"\",\n \"Limit\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetRecords"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"ShardIterator\": \"\",\n \"Limit\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetRecords");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ShardIterator\": \"\",\n \"Limit\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetRecords"
payload := strings.NewReader("{\n \"ShardIterator\": \"\",\n \"Limit\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 40
{
"ShardIterator": "",
"Limit": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetRecords")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"ShardIterator\": \"\",\n \"Limit\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetRecords"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ShardIterator\": \"\",\n \"Limit\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"ShardIterator\": \"\",\n \"Limit\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetRecords")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetRecords")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"ShardIterator\": \"\",\n \"Limit\": \"\"\n}")
.asString();
const data = JSON.stringify({
ShardIterator: '',
Limit: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetRecords');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetRecords',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ShardIterator: '', Limit: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetRecords';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ShardIterator":"","Limit":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetRecords',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "ShardIterator": "",\n "Limit": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ShardIterator\": \"\",\n \"Limit\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetRecords")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({ShardIterator: '', Limit: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetRecords',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {ShardIterator: '', Limit: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetRecords');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
ShardIterator: '',
Limit: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetRecords',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {ShardIterator: '', Limit: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetRecords';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"ShardIterator":"","Limit":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"ShardIterator": @"",
@"Limit": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetRecords"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetRecords" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"ShardIterator\": \"\",\n \"Limit\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetRecords",
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([
'ShardIterator' => '',
'Limit' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetRecords', [
'body' => '{
"ShardIterator": "",
"Limit": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetRecords');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ShardIterator' => '',
'Limit' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ShardIterator' => '',
'Limit' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetRecords');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetRecords' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ShardIterator": "",
"Limit": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetRecords' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ShardIterator": "",
"Limit": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ShardIterator\": \"\",\n \"Limit\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetRecords"
payload = {
"ShardIterator": "",
"Limit": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetRecords"
payload <- "{\n \"ShardIterator\": \"\",\n \"Limit\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetRecords")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"ShardIterator\": \"\",\n \"Limit\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"ShardIterator\": \"\",\n \"Limit\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetRecords";
let payload = json!({
"ShardIterator": "",
"Limit": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetRecords' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"ShardIterator": "",
"Limit": ""
}'
echo '{
"ShardIterator": "",
"Limit": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetRecords' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "ShardIterator": "",\n "Limit": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetRecords'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"ShardIterator": "",
"Limit": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetRecords")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"NextShardIterator": "arn:aws:dynamodb:us-west-2:111122223333:table/Forum/stream/2015-05-20T20:51:10.252|1|AAAAAAAAAAGQBYshYDEe ... ...",
"Records": [
{
"awsRegion": "us-west-2",
"dynamodb": {
"ApproximateCreationDateTime": "1.46480646E9",
"Keys": {
"ForumName": {
"S": "DynamoDB"
},
"Subject": {
"S": "DynamoDB Thread 3"
}
},
"SequenceNumber": "300000000000000499659",
"SizeBytes": 41,
"StreamViewType": "KEYS_ONLY"
},
"eventID": "e2fd9c34eff2d779b297b26f5fef4206",
"eventName": "INSERT",
"eventSource": "aws:dynamodb",
"eventVersion": "1.0"
},
{
"awsRegion": "us-west-2",
"dynamodb": {
"ApproximateCreationDateTime": "1.46480527E9",
"Keys": {
"ForumName": {
"S": "DynamoDB"
},
"Subject": {
"S": "DynamoDB Thread 1"
}
},
"SequenceNumber": "400000000000000499660",
"SizeBytes": 41,
"StreamViewType": "KEYS_ONLY"
},
"eventID": "4b25bd0da9a181a155114127e4837252",
"eventName": "MODIFY",
"eventSource": "aws:dynamodb",
"eventVersion": "1.0"
},
{
"awsRegion": "us-west-2",
"dynamodb": {
"ApproximateCreationDateTime": "1.46480646E9",
"Keys": {
"ForumName": {
"S": "DynamoDB"
},
"Subject": {
"S": "DynamoDB Thread 2"
}
},
"SequenceNumber": "500000000000000499661",
"SizeBytes": 41,
"StreamViewType": "KEYS_ONLY"
},
"eventID": "740280c73a3df7842edab3548a1b08ad",
"eventName": "REMOVE",
"eventSource": "aws:dynamodb",
"eventVersion": "1.0"
}
]
}
POST
GetShardIterator
{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetShardIterator
HEADERS
X-Amz-Target
BODY json
{
"StreamArn": "",
"ShardId": "",
"ShardIteratorType": "",
"SequenceNumber": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetShardIterator");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"StreamArn\": \"\",\n \"ShardId\": \"\",\n \"ShardIteratorType\": \"\",\n \"SequenceNumber\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetShardIterator" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:StreamArn ""
:ShardId ""
:ShardIteratorType ""
:SequenceNumber ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetShardIterator"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"StreamArn\": \"\",\n \"ShardId\": \"\",\n \"ShardIteratorType\": \"\",\n \"SequenceNumber\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetShardIterator"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"StreamArn\": \"\",\n \"ShardId\": \"\",\n \"ShardIteratorType\": \"\",\n \"SequenceNumber\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetShardIterator");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"StreamArn\": \"\",\n \"ShardId\": \"\",\n \"ShardIteratorType\": \"\",\n \"SequenceNumber\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetShardIterator"
payload := strings.NewReader("{\n \"StreamArn\": \"\",\n \"ShardId\": \"\",\n \"ShardIteratorType\": \"\",\n \"SequenceNumber\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 89
{
"StreamArn": "",
"ShardId": "",
"ShardIteratorType": "",
"SequenceNumber": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetShardIterator")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"StreamArn\": \"\",\n \"ShardId\": \"\",\n \"ShardIteratorType\": \"\",\n \"SequenceNumber\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetShardIterator"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"StreamArn\": \"\",\n \"ShardId\": \"\",\n \"ShardIteratorType\": \"\",\n \"SequenceNumber\": \"\"\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 \"StreamArn\": \"\",\n \"ShardId\": \"\",\n \"ShardIteratorType\": \"\",\n \"SequenceNumber\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetShardIterator")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetShardIterator")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"StreamArn\": \"\",\n \"ShardId\": \"\",\n \"ShardIteratorType\": \"\",\n \"SequenceNumber\": \"\"\n}")
.asString();
const data = JSON.stringify({
StreamArn: '',
ShardId: '',
ShardIteratorType: '',
SequenceNumber: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetShardIterator');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetShardIterator',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {StreamArn: '', ShardId: '', ShardIteratorType: '', SequenceNumber: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetShardIterator';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StreamArn":"","ShardId":"","ShardIteratorType":"","SequenceNumber":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetShardIterator',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "StreamArn": "",\n "ShardId": "",\n "ShardIteratorType": "",\n "SequenceNumber": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"StreamArn\": \"\",\n \"ShardId\": \"\",\n \"ShardIteratorType\": \"\",\n \"SequenceNumber\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetShardIterator")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({StreamArn: '', ShardId: '', ShardIteratorType: '', SequenceNumber: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetShardIterator',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {StreamArn: '', ShardId: '', ShardIteratorType: '', SequenceNumber: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetShardIterator');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
StreamArn: '',
ShardId: '',
ShardIteratorType: '',
SequenceNumber: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetShardIterator',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {StreamArn: '', ShardId: '', ShardIteratorType: '', SequenceNumber: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetShardIterator';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"StreamArn":"","ShardId":"","ShardIteratorType":"","SequenceNumber":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"StreamArn": @"",
@"ShardId": @"",
@"ShardIteratorType": @"",
@"SequenceNumber": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetShardIterator"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetShardIterator" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"StreamArn\": \"\",\n \"ShardId\": \"\",\n \"ShardIteratorType\": \"\",\n \"SequenceNumber\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetShardIterator",
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([
'StreamArn' => '',
'ShardId' => '',
'ShardIteratorType' => '',
'SequenceNumber' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetShardIterator', [
'body' => '{
"StreamArn": "",
"ShardId": "",
"ShardIteratorType": "",
"SequenceNumber": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetShardIterator');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'StreamArn' => '',
'ShardId' => '',
'ShardIteratorType' => '',
'SequenceNumber' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'StreamArn' => '',
'ShardId' => '',
'ShardIteratorType' => '',
'SequenceNumber' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetShardIterator');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetShardIterator' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StreamArn": "",
"ShardId": "",
"ShardIteratorType": "",
"SequenceNumber": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetShardIterator' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"StreamArn": "",
"ShardId": "",
"ShardIteratorType": "",
"SequenceNumber": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"StreamArn\": \"\",\n \"ShardId\": \"\",\n \"ShardIteratorType\": \"\",\n \"SequenceNumber\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetShardIterator"
payload = {
"StreamArn": "",
"ShardId": "",
"ShardIteratorType": "",
"SequenceNumber": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetShardIterator"
payload <- "{\n \"StreamArn\": \"\",\n \"ShardId\": \"\",\n \"ShardIteratorType\": \"\",\n \"SequenceNumber\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetShardIterator")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"StreamArn\": \"\",\n \"ShardId\": \"\",\n \"ShardIteratorType\": \"\",\n \"SequenceNumber\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"StreamArn\": \"\",\n \"ShardId\": \"\",\n \"ShardIteratorType\": \"\",\n \"SequenceNumber\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetShardIterator";
let payload = json!({
"StreamArn": "",
"ShardId": "",
"ShardIteratorType": "",
"SequenceNumber": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetShardIterator' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"StreamArn": "",
"ShardId": "",
"ShardIteratorType": "",
"SequenceNumber": ""
}'
echo '{
"StreamArn": "",
"ShardId": "",
"ShardIteratorType": "",
"SequenceNumber": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetShardIterator' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "StreamArn": "",\n "ShardId": "",\n "ShardIteratorType": "",\n "SequenceNumber": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetShardIterator'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"StreamArn": "",
"ShardId": "",
"ShardIteratorType": "",
"SequenceNumber": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.GetShardIterator")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"ShardIterator": "arn:aws:dynamodb:us-west-2:111122223333:table/Forum/stream/2015-05-20T20:51:10.252|1|AAAAAAAAAAEvJp6D+zaQ... ..."
}
POST
ListStreams
{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.ListStreams
HEADERS
X-Amz-Target
BODY json
{
"TableName": "",
"Limit": "",
"ExclusiveStartStreamArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.ListStreams");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-amz-target: ");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"TableName\": \"\",\n \"Limit\": \"\",\n \"ExclusiveStartStreamArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.ListStreams" {:headers {:x-amz-target ""}
:content-type :json
:form-params {:TableName ""
:Limit ""
:ExclusiveStartStreamArn ""}})
require "http/client"
url = "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.ListStreams"
headers = HTTP::Headers{
"x-amz-target" => ""
"content-type" => "application/json"
}
reqBody = "{\n \"TableName\": \"\",\n \"Limit\": \"\",\n \"ExclusiveStartStreamArn\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.ListStreams"),
Headers =
{
{ "x-amz-target", "" },
},
Content = new StringContent("{\n \"TableName\": \"\",\n \"Limit\": \"\",\n \"ExclusiveStartStreamArn\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.ListStreams");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-amz-target", "");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"TableName\": \"\",\n \"Limit\": \"\",\n \"ExclusiveStartStreamArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.ListStreams"
payload := strings.NewReader("{\n \"TableName\": \"\",\n \"Limit\": \"\",\n \"ExclusiveStartStreamArn\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-amz-target", "")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ HTTP/1.1
X-Amz-Target:
Content-Type: application/json
Host: example.com
Content-Length: 69
{
"TableName": "",
"Limit": "",
"ExclusiveStartStreamArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.ListStreams")
.setHeader("x-amz-target", "")
.setHeader("content-type", "application/json")
.setBody("{\n \"TableName\": \"\",\n \"Limit\": \"\",\n \"ExclusiveStartStreamArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.ListStreams"))
.header("x-amz-target", "")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"TableName\": \"\",\n \"Limit\": \"\",\n \"ExclusiveStartStreamArn\": \"\"\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 \"TableName\": \"\",\n \"Limit\": \"\",\n \"ExclusiveStartStreamArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.ListStreams")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.ListStreams")
.header("x-amz-target", "")
.header("content-type", "application/json")
.body("{\n \"TableName\": \"\",\n \"Limit\": \"\",\n \"ExclusiveStartStreamArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
TableName: '',
Limit: '',
ExclusiveStartStreamArn: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.ListStreams');
xhr.setRequestHeader('x-amz-target', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.ListStreams',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {TableName: '', Limit: '', ExclusiveStartStreamArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.ListStreams';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"TableName":"","Limit":"","ExclusiveStartStreamArn":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.ListStreams',
method: 'POST',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
},
processData: false,
data: '{\n "TableName": "",\n "Limit": "",\n "ExclusiveStartStreamArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"TableName\": \"\",\n \"Limit\": \"\",\n \"ExclusiveStartStreamArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.ListStreams")
.post(body)
.addHeader("x-amz-target", "")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/',
headers: {
'x-amz-target': '',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({TableName: '', Limit: '', ExclusiveStartStreamArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.ListStreams',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: {TableName: '', Limit: '', ExclusiveStartStreamArn: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.ListStreams');
req.headers({
'x-amz-target': '',
'content-type': 'application/json'
});
req.type('json');
req.send({
TableName: '',
Limit: '',
ExclusiveStartStreamArn: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.ListStreams',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
data: {TableName: '', Limit: '', ExclusiveStartStreamArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.ListStreams';
const options = {
method: 'POST',
headers: {'x-amz-target': '', 'content-type': 'application/json'},
body: '{"TableName":"","Limit":"","ExclusiveStartStreamArn":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-amz-target": @"",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"TableName": @"",
@"Limit": @"",
@"ExclusiveStartStreamArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.ListStreams"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.ListStreams" in
let headers = Header.add_list (Header.init ()) [
("x-amz-target", "");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"TableName\": \"\",\n \"Limit\": \"\",\n \"ExclusiveStartStreamArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.ListStreams",
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([
'TableName' => '',
'Limit' => '',
'ExclusiveStartStreamArn' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-amz-target: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.ListStreams', [
'body' => '{
"TableName": "",
"Limit": "",
"ExclusiveStartStreamArn": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-amz-target' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.ListStreams');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'TableName' => '',
'Limit' => '',
'ExclusiveStartStreamArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'TableName' => '',
'Limit' => '',
'ExclusiveStartStreamArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.ListStreams');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-amz-target' => '',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.ListStreams' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"TableName": "",
"Limit": "",
"ExclusiveStartStreamArn": ""
}'
$headers=@{}
$headers.Add("x-amz-target", "")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.ListStreams' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"TableName": "",
"Limit": "",
"ExclusiveStartStreamArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"TableName\": \"\",\n \"Limit\": \"\",\n \"ExclusiveStartStreamArn\": \"\"\n}"
headers = {
'x-amz-target': "",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.ListStreams"
payload = {
"TableName": "",
"Limit": "",
"ExclusiveStartStreamArn": ""
}
headers = {
"x-amz-target": "",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.ListStreams"
payload <- "{\n \"TableName\": \"\",\n \"Limit\": \"\",\n \"ExclusiveStartStreamArn\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-amz-target' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.ListStreams")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-amz-target"] = ''
request["content-type"] = 'application/json'
request.body = "{\n \"TableName\": \"\",\n \"Limit\": \"\",\n \"ExclusiveStartStreamArn\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/') do |req|
req.headers['x-amz-target'] = ''
req.body = "{\n \"TableName\": \"\",\n \"Limit\": \"\",\n \"ExclusiveStartStreamArn\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.ListStreams";
let payload = json!({
"TableName": "",
"Limit": "",
"ExclusiveStartStreamArn": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-amz-target", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.ListStreams' \
--header 'content-type: application/json' \
--header 'x-amz-target: ' \
--data '{
"TableName": "",
"Limit": "",
"ExclusiveStartStreamArn": ""
}'
echo '{
"TableName": "",
"Limit": "",
"ExclusiveStartStreamArn": ""
}' | \
http POST '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.ListStreams' \
content-type:application/json \
x-amz-target:''
wget --quiet \
--method POST \
--header 'x-amz-target: ' \
--header 'content-type: application/json' \
--body-data '{\n "TableName": "",\n "Limit": "",\n "ExclusiveStartStreamArn": ""\n}' \
--output-document \
- '{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.ListStreams'
import Foundation
let headers = [
"x-amz-target": "",
"content-type": "application/json"
]
let parameters = [
"TableName": "",
"Limit": "",
"ExclusiveStartStreamArn": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/#X-Amz-Target=DynamoDBStreams_20120810.ListStreams")! 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()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"Streams": [
{
"StreamArn": "arn:aws:dynamodb:us-wesst-2:111122223333:table/Forum/stream/2015-05-20T20:51:10.252",
"StreamLabel": "2015-05-20T20:51:10.252",
"TableName": "Forum"
},
{
"StreamArn": "arn:aws:dynamodb:us-west-2:111122223333:table/Forum/stream/2015-05-20T20:50:02.714",
"StreamLabel": "2015-05-20T20:50:02.714",
"TableName": "Forum"
},
{
"StreamArn": "arn:aws:dynamodb:us-west-2:111122223333:table/Forum/stream/2015-05-19T23:03:50.641",
"StreamLabel": "2015-05-19T23:03:50.641",
"TableName": "Forum"
}
]
}