title: how to call an external api from spring mvc controller
body: <p>hello my controller is</p>
  
  <pre><code>@Controller
  public class HomeController{ 
  @RequestMapping(value = "/inString={name}", method = RequestMethod.GET)
  
        public @ResponseBody String getGreeting(@PathVariable String name, String result) {
  
        //below is the url has given.I want to pass the name string to the below url for the input_text parameter
        //http://ipaddress/input?input_text=tell me something&amp;target_val=hi;
  
         result=the_result_provided_from_the_above_URL ; 
          return result;
  }
  }
  </code></pre>
  
  <p>I am able to get the pathVariable name.Now I want to pass the name to another URL which returns a string and that string will be returned from the controller.I tried but have not been able to call an URL from the controller.</p>