# How to send request data in response

**URL:** <https://community.postman.com/t/how-to-send-request-data-in-response/14319>\
**Category:** Help Hub\
**Created:** [July 21, 2020, 3:53am UTC](https://community.postman.com/t/how-to-send-request-data-in-response/14319 "2020-07-21T03:53:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cdxcz](https://avatars.discourse-cdn.com/v4/letter/c/e8c25b/32.png) [@cdxcz](https://community.postman.com/u/cdxcz)\
**Post date:** [July 21, 2020, 3:53am UTC](https://community.postman.com/t/how-to-send-request-data-in-response/14319/1 "2020-07-21T03:53:54Z")

</div>

Team,

I am trying to mock my request using mock server but the response not getting as expected (I observed that in postman web view there no prescript found)  
I have requests like below  
{“username”:“value1”,  
“addr” : {“skey1”:“svalue”  
},  
“mobileNumber”:“value2”  
}

like this i have requests …  
response should be like this :  
{“username”:“value1”,  
“addr”:{“skey1”:“svalue”}  
}

Ways i have tried using preScript

```
var reqBody= pm.request.body.raw
console.log(reqBody)
//console.log(req)
var json_verify = function(reqBody){ try { JSON.parse(reqBody); return true; } catch (e) { return false; }}
if(json_verify){
    var val = JSON.parse(pm.request.body.raw)
    var bol = true
    for(var key in val)
    {
        postman.setEnvironmentVaribale(key,val[key])
		...
    }
}

```

and using this key in response body. but

please help me any way on achieving this  
let me know if you need any thing
