title: Spring-MVC: Return ResponseEnvelope
body: <p>Using Spring, how can I receive the following POST request properly so that I can return a result?</p>
  
  <pre><code>public ResponseEnvelope sendHalfMap(GameID gameID, PlayerID playerID) throws Exception
    {
      java.util.List&lt;HalfMapNode&gt; mapNodes = MapGenerator.generator();
      HalfMap halfMapMessageBody = new HalfMap(playerID.getID(), mapNodes);
  
      URL halfMapUrl = new URL(baseUrl, "game/" + gameID.getID() + "/halfmap");
  
      RestTemplate restTemplate = getRestTemplate();
      ResponseEnvelope requestResult = (ResponseEnvelope)restTemplate.postForObject(halfMapUrl.toURI(), halfMapMessageBody, ResponseEnvelope.class);
  
      return requestResult;
    }
  </code></pre>