Render hook

The render hook is the last call of KCD, it takes the response returned by your handler and sends a marshaled version of the output back to the client with the default status code provided by the kcd.handler.

A render hook must have this signature:

type RenderHook func(w http.ResponseWriter, r *http.Request, response interface{}, defaultStatusCode int) error

Check out the default render hook implementation here.

Check out the signature of the RenderHook.

Here you will find an example of render hook redefinition.

Last updated