Can any body help me how i send request by HTTP Post fist and then HTTP GET on a single http connection connection.
Actually I want to send a requst by http post then according to the response of this message again I want to send another request but in http get method. Please any one help me as soon as posible, its very help ful if provide code by some one.
Well, this appears to me like a design issue going on. Are you using the same Servlet for the get and the post? Why not have two different Servlets, on that only uses the post. So you can do your request and response. Then call Connector.open(String url) with the url of the other Servlet to send a get.
HTTP Connections are reusable. If the 'Connection:keep-alive' header is set, server will not close the connection after returning the request (if compliant).
However, it doesn't look like in MIDP (nor, IMHO, J2SE), you can create a HTTP Connection object that can be reused. So it looks like you have to have your own HTTP connection object implemented to achieve what you need. If you don't expect fancy headrs, like continuation, and redirections, this may be somewhat easy to do, however, parsing the chunked data streams is somewhat cumbersome. The idea would be to have a connection pool (like MIDP does), but don't remove the connections when a response is completely read (like MIDP does too).
With best of best regards, Pawel S. Veselov ( aka Black Angel )