这是我尝试使用查询参数创建 REST 端点的代码片段,
<cfcomponent rest="true" restpath="api">
<cffunction name="getUsersQuery" restpath="Users?filter={query}" access="remote" returntype="struct" httpmethod="GET" produces="application/json">
<cfargument name="query" type="any" required="yes" restargsource="query" />
<cfset var response = {} />
<cfset response["message"] = "Test" />
<cfreturn response>
</cffunction>
</cfcomponent>
但是当我尝试像下面这样调用终点时,它会给出“不允许的方法”
http://localhost:8010/rest/v1/api/Users?filter=userName eq "test"
任何帮助将不胜感激。