Hi Roland, i tried this code: FilePost.setRequestEntity(new InputStreamRequestEntity(new FileInputStream(file), file.length())); try { //Proxy konfigurieren if(proxyInfo.isUsingProxyServer()) { //Proxy Infos mHttpClient.getHostConfiguration().setProxyHost(new ProxyHost(proxyInfo.getProxyHost(),proxyInfo.getProxyPort())); mHttpClient.getState().setProxyCredentials(new AuthScope(proxyInfo.getProxyHost(), proxyInfo.getProxyPort()), proxyInfo.getProxyCredentials()); } filePost.setDoAuthentication(true); mHttpClient.getParams().setAuthenticationPreemptive(true); mHttpClient.getState().setCredentials(new AuthScope(proxyInfo.getProxyHost(), proxyInfo.getProxyPort()), proxyInfo.getProxyCredentials()); int status = mHttpClient.executeMethod(filePost); } catch(Exception e){ e.printStackTrace(); }
And i get the following exception: 09.01.2006 16:34:12 org.apache.commons.httpclient.HttpMethodDirector authenticateHost WARNUNG: Required credentials not available for BASIC <any realm>@localhost:80 09.01.2006 16:34:12 org.apache.commons.httpclient.HttpMethodDirector authenticateHost WARNUNG: Preemptive authentication requested but no default credentials available -----Ursprüngliche Nachricht----- Von: Roland Weber [mailto:[EMAIL PROTECTED] Gesendet: Montag, 9. Januar 2006 16:08 An: HttpClient User Discussion Betreff: Re: WG: Re: postmethod proxy authentication failing Hi Simon, > I use the same credentials object for a get method and it works. > the problems appear only when i try to use a post method. Make sure that preemptive authentication is enabled. If it is, and the problem still persists, enable the expect-continue handshake. http://jakarta.apache.org/commons/httpclient/authentication.html#Preemptive%20Authentication http://jakarta.apache.org/commons/httpclient/performance.html#Expect-continue%20handshake hope that helps, Roland --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]