---
title: "POST /2020-05-31/function/{Name}/test#If-Match"
method: POST
path: "/2020-05-31/function/{Name}/test#If-Match"
---

# POST /2020-05-31/function/{Name}/test#If-Match

`POST /2020-05-31/function/{Name}/test#If-Match`

Tests a CloudFront function.

To test a function, you provide an _event object_ that represents an HTTP request or response that your CloudFront distribution could receive in production. CloudFront runs the function, passing it the event object that you provided, and returns the function's result (the modified event object) in the response. The response also contains function logs and error messages, if any exist. For more information about testing functions, see [Testing functions](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/managing-functions.html#test-function) in the _Amazon CloudFront Developer Guide_.

To test a function, you provide the function's name and version (`ETag` value) along with the event object. To get the function's name and version, you can use `ListFunctions` and `DescribeFunction`.

## Path parameters

- `Name` string, required

## Headers

- `If-Match` string, required

## Response `200`

Success

## Other responses

- `480` — InvalidArgument
- `481` — InvalidIfMatchVersion
- `482` — NoSuchFunctionExists
- `483` — TestFunctionFailed
- `484` — UnsupportedOperation

---

[API](https://skmtc.net/aws/apis/cloudfront.md) · [All operations](https://skmtc.net/aws/apis/cloudfront/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/cloudfront/revisions/fd674fc97471/schema)
