1

I have to append parameter in JSON response after request processing is completed and before sending. I can do in after exec filter. Here I defined filter like this,

beego.InsertFilter("*", beego.AfterExec, AddRequestAfterExec, false)

Now in this AddRequestAfterExec method, I am unable to read JSON response. I need to read JSON response and add parameter to it. I searched many things, but did not find any thing useful. So far I have left it empty.

func AddRequestAfterExec(c *context.Context) {}

Can anybody help, how to read Response in this function and modify it?

Also I am sending response from API controller like this

authController.ServeJSON()
Ameer Hamza
  • 586
  • 3
  • 16
  • I have the same trouble here, and i cant figure out why, even if tou call c.Output.Body() it doesn't append the data – workdreamer Feb 06 '20 at 11:50

0 Answers0