Skip to content
v2.276.0

Experimental

@aws-cdk/integ-tests-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

FetchOptions Struct ​

Options to pass to the JavaScript fetch api.

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 fetchOptions: integ_tests_alpha.FetchOptions = {
  body: 'body',
  headers: {
    headersKey: 'headers',
  },
  method: 'method',
  port: 123,
};
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

fetch_options = integ_tests_alpha.FetchOptions(
    body="body",
    headers={
        "headers_key": "headers"
    },
    method="method",
    port=123
)
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.*;

FetchOptions fetchOptions = FetchOptions.builder()
        .body("body")
        .headers(Map.of(
                "headersKey", "headers"))
        .method("method")
        .port(123)
        .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 fetchOptions = new FetchOptions {
    Body = "body",
    Headers = new Dictionary<string, string> {
        { "headersKey", "headers" }
    },
    Method = "method",
    Port = 123
};
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"

fetchOptions := &FetchOptions{
	Body: jsii.String("body"),
	Headers: map[string]*string{
		"headersKey": jsii.String("headers"),
	},
	Method: jsii.String("method"),
	Port: jsii.Number(123),
}

Properties ​

bodyoptionalstringbodyoptionalstrbodyoptionalStringBodyoptionalstringBodyoptional*string#
Request body.

Default: no body

headersoptional{ [key: string]: string }headersoptionaltyping.Mapping[str, str]headersoptionalMap<String, String>HeadersoptionalIDictionary<string, string>Headersoptional*map[string]*string#
Optional request headers.

Default: no headers

methodoptionalstringmethodoptionalstrmethodoptionalStringMethodoptionalstringMethodoptional*string= GET#
HTTP method.
portoptionalnumberportoptionalint | floatportoptionalNumberPortoptionaldoublePortoptional*float64#
Optional port.

Default: default port for protocol