0

After i establish the connection through url i want to post the data .
After posting the data there is no change in client
Can anyone help me

import java.net.*;
import java.io.*;
import sun.net.www.http.HttpClient;
import javax.net.ssl.*;
public class classname{
public static void main (String[] args) {


try {
URL u = new URL("https://xxxx");
// open the connection and prepare it to POST
// URLConnection uc = u.openConnection( );
HttpsURLConnection uc = (HttpsURLConnection) u.openConnection();
uc.setDoOutput(true);
OutputStream raw = uc.getOutputStream( );
OutputStream buff = new BufferedOutputStream(raw);
OutputStreamWriter out = new OutputStreamWriter(buff, "8859_1");
out.write("login.Username=xxxx&login.Password=xxxx\r\n");
out.flush( );
out.close( );
}
catch (IOException e) {
System.err.println(e);
}
}
}

2
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by Ezzaral
0

I send the data and get the response also but still there is no change in client.
I tried that link also.
Can anyone help

0

"No change in the client" isn't exactly a clear statement of the problem. Your code above does not read the response, so if you actually are reading it somewhere else we can't very well make assumptions about why it's not working.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.