Hi,

I am using httpclient4.0.1.jar for get request in my code.earlier i was
using commons-httpclient-3.1.jar for the same.

For httpclient4.0.1.jar
====================================================
My code block is as follows :

 conn = new DefaultHttpClient();
 HttpHost host = new HttpHost("s3.amazonaws.com",80);
 HttpGet request = new HttpGet();

 request.setURI(new
java.net.URI("https://donotdelete_httpclient.s3.amazonaws.com/4F265439.jpg?AWSAccessKeyId=AKIAINHDRCMKC5GUSNFA&Expires=1276089613&Signature=Xxm%2FmOttPqs0F0jvx%2Fv%2FTQCJPsg%3D";));
 request.setParams(params);

HttpResponse response = conn.execute(request);
 response.setParams(params);
 
 
 While Executing this request (red marked line)I am getting an exception as
"Host name may not be null"(illegal argument exception) and If i run this
URI on browser then it is running fine.
 
 =====================================================
 For commons-httpclient-3.1.jar
 
 My code block  for same URI is as follows :
 
 HttpClient httpClient = new HttpClient();
 HostConfiguration secureHostConfig = new HostConfiguration();
 
 GetMethod method = null;
 method = new
GetMethod(https://donotdelete_httpclient.s3.amazonaws.com/4F265439.jpg?AWSAccessKeyId=AKIAINHDRCMKC5GUSNFA&Expires=1276089613&Signature=Xxm%2FmOttPqs0F0jvx%2Fv%2FTQCJPsg%3D);
 
 statusCode = httpClient.executeMethod(secureHostConfig, method);
 
 For this code block it is running fine.
 =======================================================

 
Can any one help me what I am missing out as I want to upgrade 
commons-httpclient-3.1 to httpclient4.0.1.

Thanks and regards to your responses.

Regards-

Udit
-- 
View this message in context: 
http://old.nabble.com/GET-request-using-httpclient4.0.1-tp28830292p28830292.html
Sent from the HttpClient-User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to