title: Perl REST Client Module - How to put back entire JSON afer update
body: <p>I am using a 3rd party REST API to update a user object.  The user object has a format similar to this:</p>
  
  <pre><code>{
          "id": "abcd1234",
          "profile": {
              "firstName": "Test",
              "lastName": "User",
              "email": "test@somedomain.com",
              ....
          }
  }
  </code></pre>
  
  <p>I am making a GET call to get the user object where $next is my GET command.  I want to update the email attribute and put the entire JSON object back. I then do some code like the following to dereference the object and get the email attribute (below).  The specific API requires that all profile attributes to be specified when updating a user’s profile. Partial updates are not supported by the vendor's api.  How do I update the email attribute value to be something else, and put the entire json object back?  I'm looking for the remaining code to help accomplish this. </p>
  
  <pre><code>use JSON qw( decode_json );
  use REST::Client;
  ....
  
  $next = "/api/v1/users?q=Test_User";
  $cli-&gt;GET($next); 
  $json = $cli-&gt;responseContent();
  my $perl_ref = decode_json($json); #decode the response
  foreach my $item( @$perl_ref ) 
  { 
          $email = $item-&gt;{'profile'}-&gt;{'email'}; #deference email value from user object
          #Update the email attribute value for referenced user object
          #re-encode as JSON, and PUT the entire record to update it
  
  }
  </code></pre>
  
  <p>The JSON that gets returned from the GET call looks something like this (below).  When I do the PUT, I want to update the email attribute value, but I only want to PUT back the profile part and nothing else.  How do I need to change my code to achieve this?                                               </p>
  
  <pre><code>{
      "id": "00u1ujjbx5AZCKALPVHM",
      "passwordChanged": null,
      "profile": {
          "firstName": "John",
          "email": "test@somedomain.com",
      },
      "credentials": {
          "rec_question": {
              "question": "What is your favorite food?"
          },
          "provider": {
              "type": "ACTIVE_DIRECTORY",
              "name": "domain.local"
          }
      },
      "_links": {
          "changeRecoveryQuestion": {
              "href": "abc",
              "method": "POST"
          },
          "deactivate": {
              "href": "def",
              "method": "POST"
          },
          "changePassword": {
              "href": "ghi",
              "method": "POST"
          }
      }
  }
  </code></pre>