docs: method directive

This commit is contained in:
Francis Lavoie 2022-03-09 03:49:01 -05:00
parent 2581eba019
commit 7f754b0e13
No known key found for this signature in database
GPG key ID: E73DB3ECE64E7885
2 changed files with 28 additions and 1 deletions

View file

@ -49,6 +49,7 @@ Directive | Description
**[import](/docs/caddyfile/directives/import)** | Include snippets or files **[import](/docs/caddyfile/directives/import)** | Include snippets or files
**[log](/docs/caddyfile/directives/log)** | Enables access/request logging **[log](/docs/caddyfile/directives/log)** | Enables access/request logging
**[map](/docs/caddyfile/directives/map)** | Maps an input value to one or more outputs **[map](/docs/caddyfile/directives/map)** | Maps an input value to one or more outputs
**[method](/docs/caddyfile/directives/method)** | Rewrite the HTTP method
**[metrics](/docs/caddyfile/directives/metrics)** | Configures the Prometheus metrics exposition endpoint **[metrics](/docs/caddyfile/directives/metrics)** | Configures the Prometheus metrics exposition endpoint
**[php_fastcgi](/docs/caddyfile/directives/php_fastcgi)** | Serve PHP sites over FastCGI **[php_fastcgi](/docs/caddyfile/directives/php_fastcgi)** | Serve PHP sites over FastCGI
**[push](/docs/caddyfile/directives/push)** | Push content to the client using HTTP/2 server push **[push](/docs/caddyfile/directives/push)** | Push content to the client using HTTP/2 server push
@ -115,7 +116,8 @@ request_body
redir redir
# URI manipulation # incoming request manipulation
method
rewrite rewrite
uri uri
try_files try_files

View file

@ -0,0 +1,25 @@
---
title: method (Caddyfile directive)
---
# method
Rewrites the request to change the HTTP method.
## Syntax
```caddy-d
method [<matcher>] <method>
```
- **&lt;method&gt;** is the HTTP method to change the request to.
## Examples
Change the method for all requests under `/api` to `POST`:
```caddy-d
method /api* POST
```