title: Pass an Object and a String via RestTemplate
body: <p>My rest endpoint:</p>
  <pre><code>@PostMapping(&quot;/customerPolicyInfo&quot;)
  public Map&lt;String, Object&gt; getCustomerPolicyInfo(@RequestParam String policyNumber, @RequestParam Claims authenticatedUserDetails) {
  }
  </code></pre>
  <p>How to call this endpoint from another service using <code>RestTemplate</code>? It is a HTTP <code>POST</code> request?</p>
  <p>My current code where I am calling this above endpoint looks like this:</p>
  <pre><code>Claims authenticatedUserDetails = (Claims) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
  
  HttpHeaders headers = new HttpHeaders();
  headers.setContentType(MediaType.MULTIPART_FORM_DATA);
  
  // create a map for post parameters
  MultiValueMap&lt;String, String&gt; map = new LinkedMultiValueMap&lt;String, String&gt;();
  map.add(&quot;policyNumber&quot;, policyNumber);
  map.add(&quot;authenticatedUserDetails&quot;, authenticatedUserDetails.toString());
  
  // build the request
  HttpEntity&lt;MultiValueMap&lt;String, String&gt;&gt; entity = new HttpEntity&lt;MultiValueMap&lt;String, String&gt;&gt;(map, headers);
  
  // send POST request
  ResponseEntity&lt;Map&gt; response = null;
  try {
      response = restTemplate.postForEntity(&quot;http://localhost:8081/policy-service/customerPolicyInfo&quot;, entity, Map.class);
  } catch (RestClientException e) {
      e.printStackTrace();
  }
  return response.getBody();
  </code></pre>