I have a json request input below and would want to construct a specific json format that the backend needs using javascript. What is the best way or steps to construct them? Any help would be appreciated! Thanks.
Request input :
{
"Product": "abc"'
"Data": "{"Name":"John","Email":"[email protected]"}"
}
Request output to the backend as follow:
{
"variables": {
"Product": {
"value": "abc",
"type": "string"
},
"Data": {
"value": "{"Name":"John","Email":"[email protected]"}",
"type": "string"
}
},
"Key": "123"
}
Thanks in advance