Skip to content

Controller

isOptions()

isOptions() — returns boolean

Available in: controller Category: Miscellaneous Functions

Checks whether the current HTTP request was made using the OPTIONS method. Useful in REST APIs or CORS preflight requests.

<cfscript>
if (isOptions()) {
   // Handle CORS preflight or respond to OPTIONS request
   writeOutput("This is an OPTIONS request.");
} else {
   writeOutput("This is a different type of request.");
}
</cfscript>