How to enter to .aspx page by http connection using http POST request



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

.



Relevant Pages

  • Read contents of XML element
    ... I have an XML document that looks like ... How do I get the values of username and password into a string? ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Controlling Javascript from server side
    ... but five different language implementations here. ... 'true' means that the request must be handled asynchronously. ... There is exactly *no* reason for such a thing here. ... | percent-endoded string). ...
    (comp.lang.javascript)
  • Re: WSE 3.0, usernameOverTransportSecurity, custom Token Manager w/ securityTokenManager,
    ... Microsoft.Web.Services3.Security.Security security) ... throw new Exception("The username token is not present in the ... I've added the web service call directly to my Data binding method ... protected override string AuthenticateToken(UsernameToken ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Re: WSE 3.0, usernameOverTransportSecurity, custom Token Manager w/ securityTokenManager,
    ... Microsoft.Web.Services3.Security.Security security) ... This assertion is only valid to see whether you are receiving the username ... I've added the web service call directly to my Data binding method ... protected override string AuthenticateToken(UsernameToken token) ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Re: WSE 3.0, usernameOverTransportSecurity, custom Token Manager w/ securityTokenManager,
    ... Microsoft.Web.Services3.Security.Security security) ... This assertion is only valid to see whether you are receiving the username ... I've added the web service call directly to my Data binding method ... protected override string AuthenticateToken(UsernameToken token) ...
    (microsoft.public.dotnet.framework.webservices.enhancements)