Table of Contents

Enum HtmxRequestMode

Namespace
Ramstack.HtmxToolkit.Configuration
Assembly
Ramstack.HtmxToolkit.dll

Specifies the request mode used by HTMX.

public enum HtmxRequestMode

Fields

SameOrigin = 0

Allows requests only to the current origin.

Cors = 1

Allows cross-origin requests using CORS.

NoCors = 2

Allows restricted cross-origin requests that produce opaque responses.

Remarks

In HTMX 4.x, this is passed as the mode option of the Fetch API. The mode applies to all requests: HTMX ignores a mode set on an element, so it is configured only with Mode.

HTMX 1.9.x and 2.x use XMLHttpRequest instead of fetch. Use SelfRequestsOnly or SelfRequestsOnly to restrict requests to the current origin.