src/docs/markdown/caddyfile/directives/request_body.md
Manipulates or sets restrictions on the bodies of incoming requests.
request_body [<matcher>] {
max_size <value>
set <body_content>
}
413.⚠️ <i>Experimental</i> <span style='white-space: pre;'> | </span> <span>v2.10.0+</span>
Limit request body sizes to 10 megabytes:
example.com {
request_body {
max_size 10MB
}
reverse_proxy localhost:8080
}
Set the request body with a JSON structure containing a SQL query:
example.com {
handle /jazz {
request_body {
set `\{"statementText":"SELECT name, genre, debut_year FROM artists WHERE genre = 'Jazz'"}`
}
reverse_proxy localhost:8080 {
header_up Content-Type application/json
method POST
rewrite /execute-sql
}
}
}