I need to send a Java object from my Java program to Servlet. I thought of doing it by serialization. Is there any other thing I can use to send a Java object to Servlet. If it is by serialization can you give me the link for reference.
Thanks for the help
Use an HttpURLConnection, create a POST request, and before connecting to the server, get the outputStream from the HttpURLConnection, wrap it with an ObjectOutputStream, and write your object to it.
You will have to do the reverse on the server side.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With