# How to set the entire body of a PUT request with the stored JSON object of a previous GET request?

**URL:** <https://community.postman.com/t/how-to-set-the-entire-body-of-a-put-request-with-the-stored-json-object-of-a-previous-get-request/6492>\
**Category:** Help Hub\
**Created:** [July 11, 2019, 6:49pm UTC](https://community.postman.com/t/how-to-set-the-entire-body-of-a-put-request-with-the-stored-json-object-of-a-previous-get-request/6492 "2019-07-11T18:49:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![n1502491](https://avatars.discourse-cdn.com/v4/letter/n/b3f665/32.png) [@n1502491](https://community.postman.com/u/n1502491)\
**Post date:** [July 11, 2019, 6:49pm UTC](https://community.postman.com/t/how-to-set-the-entire-body-of-a-put-request-with-the-stored-json-object-of-a-previous-get-request/6492/1 "2019-07-11T18:49:08Z")

</div>

Hello everyone.  
When I do a GET request on an endpoint, I have some code in my “Tests” tab that does the following:  
var response = pm.response.json();  
response.terms = “accept”;  
response.date = new Date().getDate();  
var jsonBody = JSON.stringify(response);  
pm.environment.set(“nextPutVar”, jsonBody);

This successfully captures the entire received JSON payload and stores it as an environment variable. My Postman runner then goes to a PUT request, where I want to insert the entire JSON object from the previous GET into the body of the PUT. Any ideas on how I could do this?

 ![Untitled](https://us1.discourse-cdn.com/getpostman/original/3X/8/b/8be8ed27c6118fea83de0460ad16e9c3b821d4d8.png)

---

<div class="post-metadata">

**Author:** ![suesmith](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/suesmith/32/2307_2.png) [@suesmith](https://community.postman.com/u/suesmith)\
**Post date:** [July 15, 2019, 8:03pm UTC](https://community.postman.com/t/how-to-set-the-entire-body-of-a-put-request-with-the-stored-json-object-of-a-previous-get-request/6492/2 "2019-07-15T20:03:56Z")

</div>

Hi @n1502491, am wondering if the solution in this Stack Overflow question might help?

> <https://stackoverflow.com/questions/53543883/in-postman-how-do-i-take-a-response-body-from-a-get-request-and-put-it-in-a-pu>

There are a few similar questions on there so it may be worth having a look. 🙂

This also looks like the relevant documentation section:

[https://learning.getpostman.com/docs/postman/environments\_and\_globals/variables/](https://learning.getpostman.com/docs/postman/environments_and_globals/variables/)
