httpclient

HttpClient commons-httpclient Digest Authentication.

I am getting this error from a PostMethod using commons-httpclient No credentials available for DIGEST 'realm'@localhost and a 401 back from the server. I followed the example from this post java client program to send digest authentication request using HttpClient API (2) However, it still seems to fail. I am trying to connect to ...

Scala and HttpClient: How do I resolve this error?

I'm using scala with Apache HttpClient, and working through examples. I'm getting the following error: /Users/benjaminmetz/IdeaProjects/JakartaCapOne/src/JakExamp.scala Error:Error:line (16)error: overloaded method value execute with alternatives (org.apache.http.HttpHost,org.apache.http.HttpRequest)org.apache.http.HttpResponse <a...

Apache HttpClient 4.0 Ignore SSL Certificate Errors

How to bypass invalid SSL certificate errors with Apache HttpClient 4.0? ...

Emulating HTTP POST via httpclient 3.x for multi options

I want to emulate a HTTP POST using application/x-www-form-urlencoded encoding to send a option group that allows multiple selections. <select name="groups" multiple="multiple" size="4"> <option value="2">Administration</option> <option value="1">General</option> </select> Does adding 2 NameValuePairs (NVP) with the same name ...

KeyStore, HttpClient, and HTTPS: Can someone explain this code to me?

I'm trying to understand what's going on in this code. KeyStore trustStore = KeyStore.getInstance(KeyStore.getDefaultType()); FileInputStream instream = new FileInputStream(new File("my.keystore")); try { trustStore.load(instream, "nopassword".toCharArray()); } finally { instream.close(); } SSLSocketFactory socketFact...

Using HttpClient with SSL and certificates

While I've been familiar with HTTPS and the concept of SSL, I have recently begun some development and found I am a little confused. The requirement was that I write a small Java application that runs on a machine attached to a scanner. When a document is scanned this is picked up and the file (usually PDF) sent over the internet to our...

Does Apache Commons HttpClient support GZIP?

Does the library Apache Commons HttpClient support Gzip? We wanted to use enable gzip compression on our Apache server to speed up the client/server communications (we have a php page that allows our Android application to sync files with the Server). ...

HttpClient 4 SSL and client side certificates

Hi All, I am having trouble working out how I can get get HttpClient 4 to use SSL in the way I need. I have X https servers that I send requests to. One requires a client side certificate while the others have trusted certificates and therefore require no client side certificate. I have no issue connecting to the server requiring the c...

How do you set up an SSL cert that HttpClient under Android will accept?

I'm connecting to a REST service using HttpClient under Android. I'd like to be able to write code where I could pull the host, port, etc. out of a properties file and not have to write fake Schemes and other things like that in order to do the development work. In other words, the live site will have a cert. The dev site will have a sel...

Client for restful web service

I'd like to create a http-centric client for a restful web service created using Apache CXF. To that end: Does any one know the (maven) dependencies for ONLY the CXF clients (Proxy & HTTP)? Is there any advantage to using CXF's built-in clients over say, Apache HttpClient? ...

httpclient ssl certificate on android

Hi all I have some troubles with ssl using httpclient on android i am trying to access self signed certificate in details i want my app to trust all certificates ( i will use ssl only for data encryption). First i tried using this guide http://hc.apache.org/httpclient-3.x/sslguide.html on Desktop is working fine but on android i still g...

Shared Cookies between WebView and HTTPClient?

An Android app I am building requires web authentication for users to make data calls. In Adobe AIR and later the iPhone, we did this by rendering a login page in a webview-equivalent page and setting a cookie when the user signs in. Subsequent data calls use the same Cookie Jar and so are seen as authenticated. In the Android version, ...

Sharing DefaultHttpClient in Android. To synchronize or not to synchronize?

In an Android app, I am using one static instance of org.apache.http.impl.client.DefaultHttpClient and sharing that instance in all activities and services of the app, so that this client may be used to log in once to a remote server and all subsequent user requests to that remote server will remain authenticated. Every activity or Serv...

HTTPClient causing app to force close

I get this error on my Android emulator: Sorry The application has stopped unexpectedly. Please try again. [Force Close] I think the code that is creating the error is this: HttpClient client = new HttpClient(); I have imported the following from JARS: import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpcl...

How can I login to a website with Python?

How can I do it? I was trying to enter some specified link (with urllib), but to do it, I need to log in. I have this source from the site: <form id="login-form" action="auth/login" method="post"> <div> <!--label for="rememberme">Remember me</label><input type="checkbox" class="remember" checked="checked" name="remember me" /-...

non-static method cannot be referenced from a static context

I am modifying the source code here: http://thinkandroid.wordpress.com/2009/12/30/getting-response-body-of-httpresponse/ I get this error: non-static method getContentCharSet(org.apache.http.HttpEntity) cannot be referenced from a static context String charset = getContentCharSet(entity); This error is line 13 on the second box...

BindException/Too many file open while using HttpClient under load

I have got 1000 dedicated Java threads where each thread polls a corresponding url every one second. public class Poller { public static Node poll(Node node) { GetMethod method = null; try { HttpClient client = new HttpClient(new SimpleHttpConnectionManager(true)); ...... } catc...

Use HttpGet with illegal characters in the URL

I am trying to use DefaultHttpClient and HttpGet to make a request to a web service. Unfortunately the web service URL contains illegal characters such as { (ex: domain.com/service/{username}). It's obvious that the web service naming isn't well written but I can't change it. When I do HttpGet(url), I get that I have an illegal characte...

Apache HTTPClient returns an empty page

Hi, I am using the Apache HTTPClient for Java and I'm facing a really strange issue. Sometimes when I try to get a dynamically generated page it returns its actual content, but other times (with another parameter) all I get is a short sequence of \t,\r and \n. How could I track what's going on on the different cases in order to find whe...

Http authentication with apache httpcomponents

Hi, I am trying to develop a java http client with apache httpcomponents 4.0.1. This client calls the page "https://myHost/myPage". This page is protected on the server by a JNDIRealm with a login form authentication, so when I try to get https://myHost/myPage I get a login page. I tried to bypass it unsuccessfully with the following co...