/tests/resources/EchoMember.cfc

http://github.com/atuttle/Taffy · ColdFusion CFScript · 27 lines · 22 code · 5 blank · 0 comment · 0 complexity · 935ce8fe453bd91191bd2c4daae05100 MD5 · raw file

  1. <cfcomponent extends="taffy.core.resource" taffy:uri="/echo/{id}" hint="I am the component hint.">
  2. <cfproperty name="dependency1" />
  3. <cffunction name="get" hint="I am the function hint.">
  4. <cfargument name="id" hint="I am the argument hint." />
  5. <cfset local.headers = {}/>
  6. <cfset local.headers['x-dude'] = "dude!" />
  7. <cfset local.res = {} />
  8. <cfset local.res["id"] = arguments.id />
  9. <cfif structKeyExists(arguments, "dataFromOTR")>
  10. <cfset local.res.dataFromOTR = arguments.dataFromOTR />
  11. </cfif>
  12. <cfreturn representationOf(local.res).withStatus(999).withHeaders(local.headers) />
  13. </cffunction>
  14. <cffunction name="put">
  15. <cfargument name="id" />
  16. <cfreturn representationOf(arguments).withStatus(200) />
  17. </cffunction>
  18. <cffunction name="post">
  19. <cfargument name="id" />
  20. <cfreturn representationOf(arguments).withStatus(200) />
  21. </cffunction>
  22. </cfcomponent>