I am trying to send a request to a web service using an HttpURLConnection and through a proxy as well.
Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(theHost, thePort));
URL url = new URL(theUrl);
HttpURLConnection con = (HttpURLConnection)url.openConnection(proxy);
con.setRequestProperty("Content-type", "text/xml; charset=utf-8");
OutputStream reqStream = con.getOutputStream();
At this line^ I get: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 400 Bad Request".
If it's relevant, I am using Tomcat as well and Netbeans,
Any help with this exception would be appreciated, thanks ...