Experimental
@aws-cdk/integ-tests-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
HttpResponse Struct
Response from fetch.
| 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';
declare const body: any;
declare const headers: any;
const httpResponse: integ_tests_alpha.HttpResponse = {
body: body,
headers: {
headersKey: headers,
},
ok: false,
status: 123,
statusText: 'statusText',
};
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
# body: Any
# headers: Any
http_response = integ_tests_alpha.HttpResponse(
body=body,
headers={
"headers_key": headers
},
ok=False,
status=123,
status_text="statusText"
)
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.*;
Object body;
Object headers;
HttpResponse httpResponse = HttpResponse.builder()
.body(body)
.headers(Map.of(
"headersKey", headers))
.ok(false)
.status(123)
.statusText("statusText")
.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 body;
var headers;
var httpResponse = new HttpResponse {
Body = body,
Headers = new Dictionary<string, object> {
{ "headersKey", headers }
},
Ok = false,
Status = 123,
StatusText = "statusText"
};
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"
var body interface{}
var headers interface{}
httpResponse := &HttpResponse{
Body: body,
Headers: map[string]interface{}{
"headersKey": headers,
},
Ok: jsii.Boolean(false),
Status: jsii.Number(123),
StatusText: jsii.String("statusText"),
}
Properties
The response, either as parsed JSON or a string literal.
headersoptional{ [key: string]: any }headersoptionaltyping.Mapping[str, Any]headersoptionalMap<String, Object>HeadersoptionalIDictionary<string, object>Headersoptional*map[string]interface{} #Headers associated with the response.
Indicates whether the response was successful.
status range 200-299
statusoptionalnumberstatusoptionalint | floatstatusoptionalNumberStatusoptionaldoubleStatusoptional*float64 #Status code of the response.
statusTextoptionalstringstatus_textoptionalstrstatusTextoptionalStringStatusTextoptionalstringStatusTextoptional*string #The status message corresponding to the status code.