I have created the connection to server using “Https” protocol. Here is my code…
String httpsURL = "https://abc.com/auth/login/";
HttpsURLConnection con = null;
try{
URL url = new URL(httpsURL);
con = (HttpsURLConnection) url.openConnection();
con.setRequestMethod("POST" );
con.setDoInput(true);
con.setDoOutput(true);
con.connect();
String respMessage = con.getResponseMessage();
int respCode = con.getResponseCode();
}catch(....){....}
Now i have to send my object to server over that connection. How can i do that??? And, what is the best format of object to send it to server?? Can i send my HashMap object? Please Help me. Thanks in advance.
Insert…
…into your code and start writing. What you can send depends on what your server is expecting.