---
title: "Auth using request method | WebhookRelay"
meta:
  "og:description": "How do I allow only POST requests through the input or output?"
  "og:title": "Auth using request method"
  description: "How do I allow only POST requests through the input or output?"
---

![Stripes](https://webhookrelay.com/docs/webhooks/auth/http-method/images/stripes.svg)

Documentation

**Fundamentals**

# **Auth using request method**

How do I allow only POST requests through the input or output?

## [Using Functions to filter](#using-functions-to-filter)

How can you allow only POST requests go through? With Webhook Relay it's easy to do any kind of webhook filtering with Functions.

## [Setting up the function](#setting-up-the-function)

Often webhooks are sent as POST requests. However, sometimes you might be getting other requests to this endpoint (GET, PATCH, etc.), to filter them out, create a function:

```
if r.RequestMethod ~= "POST" then 
    -- request is not important, don't forward it
    r:StopForwarding()
    return
end
```

And attach it to the output (Go to the Bucket settings, then click on the destination and then select **Transform** tab).

## [Testing the Function](#testing-the-function)

Once added, POST requests will come through:

```
curl -X POST https://z2dc2rdlhajz826steaiig.hooks.webhookrelay.com
```

while PUT, GET and other request method webhooks:

```
curl -X POST https://z2dc2rdlhajz826steaiig.hooks.webhookrelay.com
```

![allowing-post-requests](https://webhookrelay.com/docs/webhooks/auth/http-method/images/docs/webhooks/auth/allowing-post-requests.png)

Did this page help you?