You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by harshal82 <ha...@gmail.com> on 2010/09/07 18:18:19 UTC
Re: instream.read() ---- In SSL mode
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.