How to enter to .aspx page by http connection using http POST request
- From: farazkazmi@xxxxxxxxx
- Date: 20 Aug 2005 04:47:21 -0700
I m facing dificulty with http "POST" request.
i need to login to a website " https://www.orkut.com "
it requires username and password.
i dont know how to enter username and password so that i can access the
page by myjava class.
i m using this code gor gettinh request:
public static String GetRequest() throws IOException {
String urlString = "https://www.orkut.com";
DataInputStream dis = null;
StringBuffer message = new StringBuffer();
String outputMessage = new String();
URL url = new URL(urlString);
HttpURLConnection httpConnection =
(HttpURLConnection) url.openConnection();
httpConnection.setRequestMethod("GET");
httpConnection.setDoInput(true);
Properties props = System.getProperties();
props.put("http.proxyHost", "SERVER");
props.put("http.proxyPort", "8080");
httpConnection.connect();
System.out.println(httpConnection.getResponseCode());
dis = new DataInputStream(httpConnection.getInputStream());
int ch;
while ((ch = dis.read()) != -1) {
message.append((char) ch);
}
outputMessage = message.toString();
//System.out.println(outputMessage);
httpConnection.disconnect();
return outputMessage;
}
now if i change request method to POST , then plz tell me how can i
enter username and password by my java code.
fhkazmi
.
- Follow-Ups:
- Re: How to enter to .aspx page by http connection using http POST request
- From: Tor Iver Wilhelmsen
- Re: How to enter to .aspx page by http connection using http POST request
- From: Raymond DeCampo
- Re: How to enter to .aspx page by http connection using http POST request
- Prev by Date: Re: argument transfering in JNI, problem in calling Java GUI
- Next by Date: Re: launch applet with APPLET or PLUGIN
- Previous by thread: j2se ->j2me
- Next by thread: Re: How to enter to .aspx page by http connection using http POST request
- Index(es):
Relevant Pages
|