[prev in list] [next in list] [prev in thread] [next in thread]
List: httpclient-users
Subject: Re: instream.read() ---- In SSL mode
From: harshal82 <harshal82 () gmail ! com>
Date: 2010-09-07 16:18:19
Message-ID: 29641597.post () talk ! nabble ! com
[Download RAW message or body]
Use this code for better performance
java.net.URI uri = URIUtils.createURI("http", "xyx(host name or host ip
address where you want to post)", -1,
"/lbsraservicedemo/service.svc/RequestPOST",
"tibcoURL="+URLEncoder.encode("query
stuff",HTTP.UTF_8)+"&"
+"rawXML="+URLEncoder.encode(start+mdn+end,HTTP.UTF_8)
, null);
URL url = new URL(uri.toString());
HttpURLConnection connection=( java.net.HttpURLConnection )
url.openConnection();
connection.setDoOutput(true);
connection.setDoInput(true);
connection.setRequestProperty("Content-Type",
"application/x-www-form-urlencoded");
char[] rawxml= new String(fileBArrayrawxml).toCharArray();
char[] header= new String(fileBArrayHeader).toCharArray();
OutputStreamWriter out = new
OutputStreamWriter(connection.getOutputStream());
out.write("rawXML=" + URLEncoder.encode(start+mdn+end,HTTP.UTF_8));
out.close();
BufferedReader in = new BufferedReader(new
InputStreamReader(connection.getInputStream()));
String decodedString;
while ((decodedString = in.readLine()) != null) {
System.out.println(decodedString);
}
olegk wrote:
>
> On Tue, 2010-04-20 at 04:17 -0700, Guru Prasad P.S wrote:
> > Don't think there is any issue connection management logic. Only this use
> > case has problem and rest all works perfectly fine.
> >
>
> I am just telling you what I see as the most likely cause of the
> problem. Whether you choose to listen or not is none of my concern.
>
> Oleg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>
>
--
View this message in context: \
http://old.nabble.com/instream.read%28%29------In-SSL-mode-tp28299250p29641597.html \
Sent from the HttpClient-User mailing list archive at Nabble.com.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic