Experimental
@aws-cdk/integ-tests-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
HttpRequest Struct
Request to the HttpCall resource.
| Stability | Experimental |
|---|---|
| Source | lib/assertions/providers/lambda-handler/types.ts |
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as integ_tests_alpha from '@aws-cdk/integ-tests-alpha';
const httpRequest: integ_tests_alpha.HttpRequest = {
parameters: {
url: 'url',
// the properties below are optional
fetchOptions: {
body: 'body',
headers: {
headersKey: 'headers',
},
method: 'method',
port: 123,
},
},
// the properties below are optional
flattenResponse: 'flattenResponse',
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.integ_tests_alpha as integ_tests_alpha
http_request = integ_tests_alpha.HttpRequest(
parameters=integ_tests_alpha.HttpRequestParameters(
url="url",
# the properties below are optional
fetch_options=integ_tests_alpha.FetchOptions(
body="body",
headers={
"headers_key": "headers"
},
method="method",
port=123
)
),
# the properties below are optional
flatten_response="flattenResponse"
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.integtests.alpha.*;
HttpRequest httpRequest = HttpRequest.builder()
.parameters(HttpRequestParameters.builder()
.url("url")
// the properties below are optional
.fetchOptions(FetchOptions.builder()
.body("body")
.headers(Map.of(
"headersKey", "headers"))
.method("method")
.port(123)
.build())
.build())
// the properties below are optional
.flattenResponse("flattenResponse")
.build();
csharp
// Install: dotnet add package Amazon.CDK.IntegTests.Alpha
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.IntegTests.Alpha;
var httpRequest = new HttpRequest {
Parameters = new HttpRequestParameters {
Url = "url",
// the properties below are optional
FetchOptions = new FetchOptions {
Body = "body",
Headers = new Dictionary<string, string> {
{ "headersKey", "headers" }
},
Method = "method",
Port = 123
}
},
// the properties below are optional
FlattenResponse = "flattenResponse"
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdkintegtestsalpha/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import integ_tests_alpha "github.com/aws/aws-cdk-go/awscdkintegtestsalpha"
httpRequest := &HttpRequest{
Parameters: &HttpRequestParameters{
Url: jsii.String("url"),
// the properties below are optional
FetchOptions: &FetchOptions{
Body: jsii.String("body"),
Headers: map[string]*string{
"headersKey": jsii.String("headers"),
},
Method: jsii.String("method"),
Port: jsii.Number(123),
},
},
// the properties below are optional
FlattenResponse: jsii.String("flattenResponse"),
}
Properties
flattenResponseoptionalstringflatten_responseoptionalstrflattenResponseoptionalStringFlattenResponseoptionalstringFlattenResponseoptional*string = 'false' #Whether or not to flatten the response from the HTTP request.
notes
Valid values are 'true' or 'false' as strings
Typically when using an HttpRequest you will be passing it as the actual value to an assertion provider so this would be set to 'false' (you want the actual response).
If you are using the HttpRequest to perform more of a query to return a single value to use, then this should be set to 'true'.
parametersHttpRequestParametersparametersHttpRequestParametersparametersHttpRequestParametersParametersHttpRequestParametersParametersHttpRequestParameters required #Parameters from the custom resource.