API reference

fast-twitch.middlewares.method-override

Complete generated reference for fast-twitch.middlewares.method-override

Usage and execution boundary

For a POST request only, reads an alternate method from the header or parsed params and changes request-method. It also records original-request-method. Compose parsed parameters outside this wrapper.

(ns application.middleware
  (:require [fast-twitch.middlewares.method-override :as middleware]))

(defn handler [_]
  {:status 200 :headers {"content-type" "text/plain"} :body "Hello"})

(def app (middleware/wrap-method-override handler))

This defines the Ring handler portion. Adapt app through routing/ft-handler or pass it to server/listen!; startup instructions and a complete walkthrough show the surrounding project.

Settings and defaults

Setting Meaning
:header-name Default X-HTTP-Method-Override
:param-name Default _method
:allowed-methods Set of method keywords; default #{:put :patch :delete}

Wrapper order and all middleware families. The function reference below preserves the upstream signatures and source links; helper functions do not all share the wrapper's arity.

Upstream function reference

Overrides request methods for clients that can only submit POST requests.

default-allowed-methods

The default set of methods that may be applied by method override. Source

default-header-name

The default header used to tunnel an HTTP method. Source

default-param-name

The default parameter used to tunnel an HTTP method. Source

method-override-request

(method-override-request request)
(method-override-request request options)

Function.

Updates :request-method when a POST request submits an allowed override. Source

wrap-method-override

(wrap-method-override handler)
(wrap-method-override handler options)

Function.

Wraps a handler so POST requests can opt into PUT, PATCH, or DELETE handling. Source


Source revision a4eb73f96836d034c7a24fe09dc7d51e4c581f64

Built with Fast-Twitch · Integrant · Datastar

Search documentation

Search pages and API symbols

Start hereWelcome to Fast-TwitchRing HTTP applications and configured native clients and transports in ClojureScript.Start hereGetting startedCompile and run your first Fast-Twitch server.Core conceptsRequest & responseUnderstand the maps at the center of a Fast-Twitch application.Core conceptsRoutingMatch URL patterns and compose handlers.Core conceptsMiddlewareWrap handlers with focused request and response behavior.GuidesHTML & IntegrantCompose a UI system with Integrant and render Hiccup.