Controller
isOptions()
Signature
Section titled “Signature”isOptions() — returns boolean
Available in: controller
Category: Miscellaneous Functions
Description
Section titled “Description”Checks whether the current HTTP request was made using the OPTIONS method. Useful in REST APIs or CORS preflight requests.
Examples
Section titled “Examples”<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>