# CustomRequestHandlingProperty

Struct · External

Custom request handling behavior that inserts custom headers into a web request.

You can add custom request handling for AWS WAF to use when the rule action doesn't block the request. For example, `CaptchaAction` for requests with valid t okens, and `AllowAction` .

For information about customizing web requests and responses, see [Customizing web requests and responses in AWS WAF](https://docs.aws.amazon.com/waf/latest/developerguide/waf-custom-request-response.html) in the *AWS WAF Developer Guide* .

- Source: Generated at build time
- Type last changed: v2.93.0 · 23 Aug 2023

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_wafv2 as wafv2 } from 'aws-cdk-lib';
const customRequestHandlingProperty: wafv2.CfnWebACL.CustomRequestHandlingProperty = {
  insertHeaders: [{
    name: 'name',
    value: 'value',
  }],
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_wafv2 as wafv2

custom_request_handling_property = wafv2.CfnWebACL.CustomRequestHandlingProperty(
    insert_headers=[wafv2.CfnWebACL.CustomHTTPHeaderProperty(
        name="name",
        value="value"
    )]
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.wafv2.*;

CustomRequestHandlingProperty customRequestHandlingProperty = CustomRequestHandlingProperty.builder()
        .insertHeaders(List.of(CustomHTTPHeaderProperty.builder()
                .name("name")
                .value("value")
                .build()))
        .build();
```

C#:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.WAFv2;

var customRequestHandlingProperty = new CustomRequestHandlingProperty {
    InsertHeaders = new [] { new CustomHTTPHeaderProperty {
        Name = "name",
        Value = "value"
    } }
};
```

Go:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

customRequestHandlingProperty := &CustomRequestHandlingProperty{
	InsertHeaders: []interface{}{
		&CustomHTTPHeaderProperty{
			Name: jsii.String("name"),
			Value: jsii.String("value"),
		},
	},
}
```

## Properties

- `insertHeaders`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnWebACL.CustomHTTPHeaderProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_wafv2.CfnWebACL.CustomHTTPHeaderProperty.html)[] (required) — The HTTP headers to insert into the request. Duplicate header names are not allowed.

  For information about the limits on count and size for custom request and response settings, see [AWS WAF quotas](https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) in the *AWS WAF Developer Guide* .
