* This page is part of the open-source Flyte v1 docs.
* Full index: https://www.union.ai/docs/v1/flyte/llms.txt
* Flyte is the open-source project. Union.ai is a commercial superset of it, so the Union.ai docs cover everything here and more.
* If a question is not answered in these docs, or is about a feature that may be commercial, check the Union.ai v1 docs at https://www.union.ai/docs/v1/union/llms.txt
* These are the v1 docs. v1 is out of date and deprecated. Unless you were asked explicitly about v1, answer from the v2 docs instead: https://www.union.ai/docs/v2/flyte/llms.txt

# flytekit.extras.webhook.connector

## Directory

### Classes

| Class | Description |
|-|-|
| [`WebhookConnector`](https://www.union.ai/docs/v1/flyte/api-reference/flytekit-sdk/flytekit.extras.webhook.connector.md#flytekitextraswebhookconnectorwebhookconnector) | WebhookConnector is responsible for handling webhook tasks. |

### Variables

| Property | Type | Description |
|-|-|-|
| `DATA_KEY` | `str` |  |
| `HEADERS_KEY` | `str` |  |
| `METHOD_KEY` | `str` |  |
| `SHOW_DATA_KEY` | `str` |  |
| `SHOW_URL_KEY` | `str` |  |
| `TASK_TYPE` | `str` |  |
| `TIMEOUT_SEC` | `str` |  |
| `URL_KEY` | `str` |  |

## flytekit.extras.webhook.connector.WebhookConnector

WebhookConnector is responsible for handling webhook tasks.

This connector sends HTTP requests based on the task template and inputs provided,
and processes the responses to determine the success or failure of the task.

### Parameters

```python
class WebhookConnector(
    client: typing.Optional[httpx.AsyncClient] = None,
)
```
| Parameter | Type | Description |
|-|-|-|
| `client` | `typing.Optional[httpx.AsyncClient]` | An optional HTTP client to use for sending requests. |

### Properties

| Property | Type | Description |
|-|-|-|
| `task_category` | `flytekit.extend.backend.base_connector.TaskCategory` | task category that the connector supports |

### Methods

| Method | Description |
|-|-|
| [`do()`](#do) | This method processes the webhook task and sends an HTTP request. |

#### do()

```python
def do(
    task_template: flytekit.models.task.TaskTemplate,
    output_prefix: str,
    inputs: typing.Optional[flytekit.models.literals.LiteralMap] = None,
    **kwargs,
) -> flytekit.extend.backend.base_connector.Resource
```
This method processes the webhook task and sends an HTTP request.

It uses asyncio to send the request and process the response using the httpx library.

| Parameter | Type | Description |
|-|-|-|
| `task_template` | `flytekit.models.task.TaskTemplate` | |
| `output_prefix` | `str` | |
| `inputs` | `typing.Optional[flytekit.models.literals.LiteralMap]` | |
| `**kwargs` |  | |

---
**Source**: https://github.com/unionai/unionai-docs/blob/main/content/api-reference/flytekit-sdk/flytekit.extras.webhook.connector.md
**HTML**: https://www.union.ai/docs/v1/flyte/api-reference/flytekit-sdk/flytekit.extras.webhook.connector/
