title: How to write a Serializable as the body of an http post request?
body: <p>I have a client-server app in which I have a <code>Serializable</code> class on both sides. I have to write an object of that class using <code>ObjectOutputStream</code> from the <code>client</code> and read it using <code>ObjectInputStream</code> on the server.</p>
  
  <p>At the client I am using Apache <code>HttpClient</code> (version 4.2). I have to send the serializable object in an <code>HttpPost</code> request. How do I write the object to the <code>HttpPost</code> request in such a way that I can read it using <code>ObjectInputStream</code> at the server?</p>
  
  <p>I am sending the request like this : </p>
  
  <pre><code>httpClient.execute(host,postRequest);
  </code></pre>