Interface IHttpInvokeProps
Properties for calling an external HTTP endpoint with HttpInvoke.
Inherited Members
Namespace: Amazon.CDK.AWS.StepFunctions.Tasks
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IHttpInvokeProps : ITaskStateBaseProps, IStateBaseProps, ITaskStateBaseOptions, IAssignableStateOptions, IJsonPathCommonOptions, IJsonataCommonOptions
Syntax (vb)
Public Interface IHttpInvokeProps Inherits ITaskStateBaseProps, IStateBaseProps, ITaskStateBaseOptions, IAssignableStateOptions, IJsonPathCommonOptions, IJsonataCommonOptions
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.Events;
var connection = new Connection(this, "Connection", new ConnectionProps {
Authorization = Authorization.Basic("username", SecretValue.UnsafePlainText("password"))
});
new HttpInvoke(this, "Invoke HTTP API", new HttpInvokeProps {
ApiRoot = "https://api.example.com",
ApiEndpoint = TaskInput.FromText(JsonPath.Format("resource/{}/details", JsonPath.StringAt("$.resourceId"))),
Body = TaskInput.FromObject(new Dictionary<string, object> { { "foo", "bar" } }),
Connection = connection,
Headers = TaskInput.FromObject(new Dictionary<string, object> { { "Content-Type", "application/json" } }),
Method = TaskInput.FromText("POST"),
QueryStringParameters = TaskInput.FromObject(new Dictionary<string, object> { { "id", "123" } }),
UrlEncodingFormat = URLEncodingFormat.BRACKETS
});
Synopsis
Properties
| ApiEndpoint | The API endpoint to call, relative to |
| ApiRoot | Permissions are granted to call all resources under this path. |
| Body | The body to send to the HTTP endpoint. |
| Connection | The EventBridge Connection to use for authentication. |
| Headers | The headers to send to the HTTP endpoint. |
| Method | The HTTP method to use. |
| QueryStringParameters | The query string parameters to send to the HTTP endpoint. |
| UrlEncodingFormat | Determines whether to apply URL encoding to the request body, and which array encoding format to use. |
Properties
ApiEndpoint
The API endpoint to call, relative to apiRoot.
TaskInput ApiEndpoint { get; }
Property Value
Remarks
ExampleMetadata: infused
Examples
TaskInput.FromText("path/to/resource");
ApiRoot
Permissions are granted to call all resources under this path.
string ApiRoot { get; }
Property Value
Remarks
ExampleMetadata: infused
Examples
"https://api.example.com";
Body
The body to send to the HTTP endpoint.
TaskInput? Body { get; }
Property Value
Remarks
Default: - No body is sent with the request.
Connection
The EventBridge Connection to use for authentication.
IConnection Connection { get; }
Property Value
Remarks
ExampleMetadata: infused
Headers
The headers to send to the HTTP endpoint.
TaskInput? Headers { get; }
Property Value
Remarks
Default: - No additional headers are added to the request.
Examples
TaskInput.FromObject(new Dictionary<string, object> { { "Content-Type", "application/json" } });
Method
The HTTP method to use.
TaskInput Method { get; }
Property Value
Remarks
ExampleMetadata: infused
Examples
TaskInput.FromText("GET");
QueryStringParameters
The query string parameters to send to the HTTP endpoint.
TaskInput? QueryStringParameters { get; }
Property Value
Remarks
Default: - No query string parameters are sent in the request.
UrlEncodingFormat
Determines whether to apply URL encoding to the request body, and which array encoding format to use.
URLEncodingFormat? UrlEncodingFormat { get; }
Property Value
Remarks
URLEncodingFormat.NONE passes the JSON-serialized RequestBody field as the HTTP request body.
Otherwise, the HTTP request body is the URL-encoded form data of the RequestBody field using the
specified array encoding format, and the Content-Type header is set to application/x-www-form-urlencoded.
Default: - URLEncodingFormat.NONE