title: how to pass queries to a url in rest template without uri
body: <p>I am trying to make a GET call to a url and I need to pass in queries to get the response i want.
  I am using spring framework and using Rest template to make the calls.
  I know i can manually do this way:</p>
  
  <pre><code>Uritemplate(url+name={name}...
  </code></pre>
  
  <p>but this is a pain. I need a easier way and the hash map will be generated dynamically</p>
  
  <p>So how do i pass in a map to a url without using uri encoder?
  <br></p>
  
  <pre><code> String url = "example.com/search
   Map&lt;String, String&gt; params = new HashMap&lt;String, String&gt;();
            params.put("name", "john");
            params.put("location", "africa");
  
  public static ResponseEntity&lt;String&gt; callGetService(String url, Map&lt;String, String&gt; param) {
          RestTemplate rest = new RestTemplate();
          rest.getMessageConverters().add(new MappingJackson2HttpMessageConverter());
  
          HttpHeaders headers = new HttpHeaders();
          headers.setContentType(MediaType.APPLICATION_JSON);
          headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON));
  
          HttpEntity&lt;?&gt; reqentity = new HttpEntity&lt;Object&gt;(headers);
  
          ResponseEntity&lt;String&gt; resp = rest.exchange(url, HttpMethod.GET, reqentity, String.class);
          System.out.println(resp);
          return resp;
      }
  </code></pre>
  
  <p>So url will end up like this example.com/search?name=john&amp;location=africa <br>
  response: {name:john doe, love: football} --- tons of json data</p>