This module defines the cowboy_http_handler behaviour.
Required callback functions: init/3, handle/2, terminate/3.
Behaviour for short-lived HTTP handlers.
init/3 allows you to initialize a state for all subsequent callbacks, and indicate to Cowboy whether you accept to handle the request or want to shutdown without handling it, in which case the handle/2 call will simply be skipped.
handle/2 allows you to handle the request. It receives the state previously defined.
terminate/3 allows you to clean up. It receives the termination reason and the state previously defined.
There is no required operation to perform in any of these callbacks other than returning the proper values. Make sure you always return the last modified Req so that Cowboy has the up to date information about the request.Generated by EDoc, Aug 16 2014, 11:28:19.