[prev in list] [next in list] [prev in thread] [next in thread] 

List:       httpclient-users
Subject:    Re: new to HttpClient, how to get serialized objected using HttpClient
From:       "Bindul Bhowmik" <bindulbhowmik () gmail ! com>
Date:       2006-04-26 4:41:03
Message-ID: 882a6a7e0604252141y341009f9u76d9f7239780e62d () mail ! gmail ! com
[Download RAW message or body]

Hello Ashish,

> How do i get this seralized object data using HttpClient, i need to get this
> Object passed from the servlet,
> My Code is as below
> HttpClient client = new HttpClient();
>         PostMethod postMethod = new PostMethod(url);
>
>          NameValuePair[] data = {
>                     new NameValuePair("as400Name", as400Name),
>                     new NameValuePair("envName", envName),
>                     new NameValuePair("fileName", fileName)
>                   };
>
>          postMethod.setRequestBody(data);
>
>          postMethod.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,
>
>                 new DefaultHttpMethodRetryHandler(3, false));
> int statusCode = client.executeMethod(postMethod);
>
>               if (statusCode != HttpStatus.SC_OK) {
>                 System.err.println("Method failed: " +
> postMethod.getStatusLine());
>               }
>
>               // Read the response body.
>               byte[] responseBody = postMethod.getResponseBody();
>
>

I presume you are using HttpClient in your applet?

In that case did you try using ObjectInputStream here?

ObjectInputStream ois = new
ObjectInputStream(postMethod.getResponseBodyAsStream());

Regards,
Bindul

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic