Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Dynamic variable while sending output as JSON

Hi ,

I am sending out as below with name as student.

{ "student": { "name": "Jim", "age": 23, "gender": "Male", "department": "History", "car": "Honda" } }

Instead I would like it to be dynamic based on pathname or query param.

Example if pathname /query param is student it would be {"student": {.....})

and if it is employee it would be {"employee": {.....})

0 6 6,333
6 REPLIES 6
Top Solution Authors