In my django webapp, I have to pass user data param(udp) in a request and return the same in response without modifying it in view.
Request
{
"mobile": "111111111",
"udp":[
{
"key": "keyName",
"value":"valueName"
},
{
"key": "keyName",
"value":"valueName"
},
]
}
Response
{
"code": "200",
"message": "success message",
"response": {
"data":"user data"
"udp":[
{
"key": "keyName",
"value":"valueName"
},
{
"key": "keyName",
"value":"valueName"
}
]
}
}
I thought of acheiving this by writting custom middleware but after accessing request in middleware, View is throwing me error
you cannot access body after reading from request's data stream
Can anyone suggest how this can be implemented? or What will be best approach of doing this in django