I have the followingcode that reads data from input socket and then casted to HTTPConnection to allow using HTTP methods but it is giving me casting exception errorHow can I do it " Read string from input stream and get the http header information andbody information from it" Thanks
Hi you cant typecast the socketconnection to httpconnection. You have to decide which connection had to be used. If you want header information while opening the connection typecast that to HttpConnection that is the standard way we do in J2ME.
Thank you for assistance my requirement is: The client wants to communicate with a server that provides restful web services.
So the client will send for example (GET /Addition?q1=5&q2=6 HTTP1.1) and the server will should parse the received message and extract the Addition and parameters and redirect it to the appropriate resource? So what is the best solution?
I got what you want to do. For invoking restful services you just need to construct http url with above said parameters . The url can be this http://somesite.com/addition?q1=5&q2=6. This will definitely works out.
I did what you told me but I got the following error:
Uncaught exception java/lang/IllegalArgumentException: Malformed address.
knowing that the code is:
The server side code is:
Let's get him boys! We'll make him read this tiny ad!