0
我正尝试通过我的java代码连接到Google API,并且我正在使用apache骆驼。我必须先在代理服务器上进行身份验证,然后请求才会被转发到Google。但是,尽管我正在递交凭证,但我无法通过认证。Apache Camel:代理代码
context.getProperties().put("http.proxyAuthMethod","Digest");
context.getProperties().put("http.proxyHost", "foo");
context.getProperties().put("http.proxyPort", "80");
context.getProperties().put("http.proxyAuthUsername",
"bar");
context.getProperties().put("http.proxyAuthPassword", "foo");
也i相HTTP端点试图
HttpEndpoint endpoint = (HttpEndpoint) context.getEndpoint("https://foo/bar");
Map<String, Object> options = new HashMap<String, Object>();
options.put("proxyAuthUsername","foo");
options.put("proxyAuthPassword","bar");
options.put("proxyAuthMethod","Basic");
endpoint.configureProperties(options);
endpoint.setProxyHost("foo");
endpoint.setProxyPort(80);
我仍然得到407响应代码,以及从代理需要认证的消息。任何人都可以给我关于这个的指针。
感谢