How to add support for a new HTTP request method in phoenix routes

I need to add PURGE methood in phoenix routes. We use cache in nginx and to delete cache we use PURGE method which I can’t implement

In my opinion you should try to avoid to assume that others know what you are referring to. This PURGE method is not even a standard HTTP method:

But I can see that Nginx seems to have “invented” it :slight_smile:

You can use Phoenix.Router.match/5: Phoenix.Router — Phoenix v1.5.8


You can use match:

You may want to create a custom plug to use the match :

Oh, it seems that you posted while I was writing mine. Sorry for the overlap :slight_smile:

1 Like


1 Like