Setting Proxy for java app

hi, was playing around trying to get a rest API call to work and keep getting connection and timeout issues. Released as I am doing a HTTP request it needed to be routed via the company proxy server, here’s how I set the proxy details.

System.setProperty(“http.proxySet”, “true”);
System.setProperty(“http.proxyHost”, “130.x.x.x”);
System.setProperty(“http.proxyPort”, “80”);
System.setProperty(“http.proxyUser”, “UsernameHere”);
System.setProperty(“http.Password”, “PAsswordHere”);

Note: This was just a proof of concept to test out consuming a rest webservice, I’m not advocating this as the best way to set the proxy details.