open class HiddenHttpMethodFilter : WebFilter
Reactive WebFilter that converts posted method parameters into HTTP methods, retrievable via ServerHttpRequest#getMethod()
. Since browsers currently only support GET and POST, a common technique is to use a normal POST with an additional hidden form field (_method
) to pass the "real" HTTP method along. This filter reads that parameter and changes the ServerHttpRequest#getMethod()
return value using ServerWebExchange#mutate()
.
The name of the request parameter defaults to _method
, but can be adapted via the methodParamName
property.
Author
Greg Turnquist
Author
Rossen Stoyanchev
Since
5.0
HiddenHttpMethodFilter()
Reactive WebFilter that converts posted method parameters into HTTP methods, retrievable via The name of the request parameter defaults to |
static val DEFAULT_METHOD_PARAMETER_NAME: String
Default name of the form parameter with the HTTP method to use |
open fun filter(exchange: ServerWebExchange, chain: WebFilterChain): Mono<Void>
Transform an HTTP POST into another method based on |
|
open fun setMethodParamName(methodParamName: String): Unit
Set the name of the form parameter with the HTTP method to use. By default this is set to |