HttpPost
Invokes a HTTP POST REST service request and stores result either in a file or a string variable. An optional request body can be specified.
Properties
Input
Name | Description | |
---|---|---|
Url | URL for service request | |
Verb | Default: "POST". Optionally you can use other HTTP verbs like "PUT" or "PATCH" | |
Authorization | Integrated support for various authorization methods:
More information can be found in the examples below. | |
Timeout | Timeout, default: 60000ms | |
Accept | Optional: accept header, e.g. "application/json" or "application/xml" | |
ContentType | Optional: specifies MIME type of request body, e.g. "application/json" | |
ContentLength | Optional, default: -1, i.e. it is not set | |
InputPath | Optional path to a file uploaded as request body | |
InputString | Optional string uploaded as request body | |
QueryParameters | Optional: dictionary with query parameters Query parameters can be specified directly in the Url and/or in this dictionary. When using AwsUrlSignature you have to specify query parameters only here and not in the Url directly. | |
Headers | Optional: additional headers, e.g.
| |
Options | Additional options. See examples below. | |
Retries | Retries, default: 0 | |
RetraDelayMs | Delay between retries (in milliseconds) | |
ThrowException | Throw exception on failures (after last retry), default: true. If set to false you can detect problems by checking the StatusCode |
Output
Name | Description |
---|---|
OutputPath | Path to a file where the result is downloaded to |
OutputString | Variable to store the result (if OutputPath is not set) |
StatusCode | HTTP response status code, e.g. 200 |
OutputHeaders | Optional dictionary variable to retrieve response headers |
Available Symbolic Variables
URL
Variable | Description |
---|---|
{ServiceRootAddress} | Will be replaced with base path to DPE services, e.g. "{ServiceRootAddress}/api/entries" would be replaced with something like "https:/MyServer:MyPort/DpeWebApplication/api/entries" |
QueryParameters
Variable | Description |
---|---|
{"X-Amz-Credential", "{auto}"} | Available when using Authorization=AwsUrlSignature. Value will be calculated automatically according to AWS4 Signature method. |
{"X-Amz-Date", "{auto}"} | Available when using Authorization=AwsUrlSignature. Value will be calculated automatically according to AWS4 Signature method. |
Headers
Variable | Description |
---|---|
{"Content-MD5", "{auto}"} | Available when using Authorization=AwsUrlSignature. Value will be calculated automatically from the payload according to AWS4 Signature method. |
{"x-amz-content-sha256", "{auto}"} | Available when using Authorization=AwsUrlSignature. Value will be calculated automatically from the payload according to AWS4 Signature method. Needed when your AWS service only accepts hashed payloads. |
Example calling DPE REST Service
Update entry metadata
HttpPost Properties
Use symbolic variable {ServiceRootAddress} in your Url.
Set Authorization to "Dpe" and the HttpPost activity will automatically geneate a Dpe-Auth token from User and Password. You don't have to set any manually calculated authorization headers.
Example calling AWS4 S3
Uploading an audio file
Arguments
HttpPost Properties
QueryParameters
new Dictionary(Of String, String) from
{
{"X-Amz-Algorithm", "AWS4-HMAC-SHA256"},
{"X-Amz-Credential", "{auto}"},
{"X-Amz-Date", "{auto}"},
{"X-Amz-Expires", "86400"}
}
Headers
new Dictionary(Of String, String) from
{
{"Cache-Control", "public"},
{"Content-MD5", "{auto}"},
{"x-amz-acl", "public-read"},
{"x-amz-storage-class", "INTELLIGENT_TIERING"},
{"x-amz-meta-musicid", MusicId},
{"x-amz-meta-radio", Radio},
{"x-amz-meta-show", Show},
{"x-amz-meta-title","Test" + MusicId}
}
Options
new Dictionary(Of String, String) From
{
{ "AwsRegion", AwsRegion},
{ "AwsService", AwsService},
{ "AwsAccessKey", AwsAccessKey},
{ "AwsSecretKey", AwsSecretKey}
}