httpclient

How to force disconnection in commons-httpclient ?

Hi, I use commons-httpclient to send queries to a Web server. The Web server never closes connections, but has a small memory leak associated to the connection context. I would therefore like to close the persistent connections from time to time (every X queries for example), but I did not find any way to do this. I use the MultiThread...

AXIS2 How to set connection retry??

It seems that the Axis admin client org.apache.axis2.client.ServiceClient is issuing org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry() and the retry is like 3 times by default. Is there a way to set to not do retries? My code: ServiceClient client = new ServiceClient(); Options opts = new Options(); ...

HTTPCLIENT does not exist? Netbeans

I am trying to import: import org.apache.commons.httpclient.*; import org.apache.commons.httpclient.methods.*; import org.apache.commons.httpclient.params.HttpMethodParams; But I am being told these do not exist? I downloaded: httpclient-4.0.1.jar and httpmime-4.0.1.jar ... and placed these in the same folder as my .java files that ...

Slow upload speeds using HttpClient, Jame's Mime4j and HttpPost method of posting

I'm uploading a multipart chunk of data using HttpPost and feeding it into an HttpClient objects execute method as follows: HttpPost loginPost = new HttpPost(LOGIN_URL); List<NameValuePair> params = new ArrayList<NameValuePair>(); params.add(new BasicNameValuePair("_email", mEmailAddress)); params.add(new BasicNameValuePair("lpassword",...

apache httpclient and spawning a browser that will share the session

I'm have a java program that uses Apache httpclient api. This is used to login to and communicate to a webapp. Once logged in, there's a situation in which the program issues an execute process to open up firefox to hit the webapp and allow the user to see data in the browser. Since the java program is already logged in, is there a way...

How can I reuse a HttpClient connection efficiently?

I am doing HTTP POSTs very frequently (>= 1/sec) to an API endpoint and I want to make sure I'm doing it efficiently. My goal is to succeed or fail as soon as possible, especially since I have separate code to retry failed POSTs. There is a nice page of HttpClient performance tips, but I'm not sure if exhaustively implementing them all w...

Authentication Problem in Android

I have to send requests to a server in xml format.I did this using DefaultHttpClient and HttpPost(i have to do post request) using StringEntity to send the xml request but i got "401 Authorisation required" errror.I searched and i found out that authentication is required(i have username and password),but how to do is a problem for me.C...

URI encoding in UNICODE for apache httpclient 4

I am working with apache http client 4 for all of my web accesses. This means that every query that I need to do has to pass the URI syntax checks. One of the sites that I am trying to access uses UNICODE as the url GET params encoding, i.e: http://maya.tase.co.il/bursa/index.asp?http://maya.tase.co.il/bursa/index.asp?view=search&amp;co...

java: apache HttpClient > how to disable retry

I'm using Apache Httpclient for Ajax-calls on a website. In some cases requests to external webservice fail, often with: I/O exception (java.net.ConnectException) caught when processing request: Connection timed out: connect. In that case, more often than not, I want to skip retrying the request (something that Httpclient seems to do...

Soap4r : the requested address is not valid in the its context.

Hello. I was wondering if somebody has seen this error before? C:/Ruby/lib/ruby/gems/1.8/gems/httpclient-2.1.5.2/lib/httpclient/session.rb:675:in `initialize': The requested address is not valid in its context. - connect(2) (://:0) (Errno::EADDRNOTAVAIL) from C:/Ruby/lib/ruby/gems/1.8/gems/httpclient-2.1.5.2/lib/httpclient/se...

HttpGet with HTTPS : SSLPeerUnverifiedException

Using HttpClient, I receive the following error when attempting to communicate over HTTPS: Exception in thread "main" javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated. URI loginUri = new URI("https://myUrl.asp"); HttpClient httpclient = new DefaultHttpClient(); HttpGet httpget = new HttpGet( loginUri ); HttpResponse re...

apache HttpClient make connection for url1 ,if url1 failed connect url2

Hi using apache HttpClinet i have to connect to two different URLs based on conditions. we have given two urls URL1 and URl2. initially i have to connect to URL1 .if it fails due to communication errors retry for 3 times,then also it failed Now connect to URL2 and repeat the same process.finally if URL2 also fails.read from database....

Monitor download progress with apache http components

I have some big files to download with Apache's Http Components and I want to be able to display some progress info to users in the admin console of my web app. What is the right way to monitor a download in progress using this library? I will create a singleton to manage the ongoing downloads, what I need is a way to inspect the open co...

Qt client for Facebook

I would like to use Facebook api (http://wiki.developers.facebook.com/index.php/API) in my Qt Application. I don't want to use WebKit. Is it possibile to use QNetwork only? Is there any example on how to do it? ...

RESTful httpclient for Ant

I need a RESTful httpclient for Ant. None of the contrib related tasks seem to work anymore.. Hasn't anyone bridged Commons-HTTPClient and Ant yet? ...

Using Apache HttpClient to login to Google Account

I am trying to login to my google account to edit my profile via a Java application using apache httpClient. The code I'm using is given below. Although the code returns a cookie its expiry is set to null and when i check the returned page HTML it is the same as the login page i am trying to connect to. Can someone please point out the...

HttpClient+SSL+ Trusted Certificate.

Hi All, I'm using Commons HttpClient API to connect to one of our Servers. This server uses SSL and also it uses valid Certificate (issued by Verisign Trust Network). My Browser never complains as i connect to the server. But my java program throws Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorExcep...

Delphi: problem with httpcli (ICS) post method

Hello I am using HttpCli component form ICS to POST a request. I use an example that comes with the component. It says: procedure TForm4.Button2Click(Sender: TObject); var Data : String; begin Data:='status=no'; HttpCli1.SendStream := TMemoryStream.Create; HttpCli1.SendStream.Write(Data[1], Length(Data)); HttpCli1.S...

HttpClient automatically retires before the response is received from server

Hi all, I'm come upon a wierd problem with java HttpClient library. Specifically the library automatically retries my request (POST requests) even before the response is received from the server. Moreover the weirder problem is that this only happens on specific hosts (machines). So the end result is if a post request succeeds, the...

http client that executes javascript...?

Does anyone know of an http client that is scripting friendly (ie: the basics, gets, posts) and is capable of executing javascript (all, not just location redirect) ? And one which isn't just launching another browser. ...