A response recorder is one of the Iris specific http.ResponseWriter. It records the response body, status code and headers that you can manipulate at any handler inside a route's handlers chain.
Call Context.Record() before send data.
The Context.Recorder() returns a ResponseRecorder. Its methods can be used to manipulate or retrieve the response.
The ResponseRecorder type contains the standard Iris ResponseWriter methods plus the following methods.
Body returns the body tracked from the writer so far. Do not use this for edit.
Body()[]byte
Use this to clear the body.
ResetBody()
Use Write/Writef/WriteString to stream write and SetBody/SetBodyString to set body instead.
// It applies per Party and its children,
// therefore, you can create a routes := app.Party("/path")
// and set middlewares, their rules and the routes there as well.
app.SetExecutionRules(iris.ExecutionRules{
Done: iris.ExecutionOptions{Force: true},
})
// [The routes...]
app.Get("/data", func(ctx iris.Context) {
ctx.JSON(data)
})