Want to save the user request and response

Hi All,

We are working on REST API and we are looking for save the user request and according to request what are the response sent to the user. All these details need to save in DB table. We are try with different method but some how are not able to achieve what we are looking

For Example

I did the same for caching purpose and stored the response and request data during the controllers afterAction. You have to define what your requestData should be what values are important for you. Do you only need all GET and POST params or certain headers as well?

Since you have access to the Request object you can collect all the data you need in an array and store it. Keep in mind some requests like a user name/password based login should not be stored. You don’t want to store unencrypted passwords in your db.

What is your current code? I’m not really sure what you miss or what your issue is. Looks like you got everything.

I think its better to do it in db queue, push the job in before request event