class MethodOverrideMiddleware implements MiddlewareInterface (View source)

Allows to override the request HTTP Method via different overrides in this order:

  • a "__method" argument passes in via request body
  • X-Http-Method-Override header
  • X-Http-Method header

Methods

ResponseInterface
process(ServerRequestInterface $request, RequestHandlerInterface $next)

Process an incoming server request and overwrite the request method of a POST based on a __method argument or either the X-Http-Method-Override or X-Http-Method header.

Details

ResponseInterface process(ServerRequestInterface $request, RequestHandlerInterface $next)

Process an incoming server request and overwrite the request method of a POST based on a __method argument or either the X-Http-Method-Override or X-Http-Method header.

Parameters

ServerRequestInterface $request
RequestHandlerInterface $next

Return Value

ResponseInterface