1. static char hdrs[] = "Content-Type: application/x-www-form-urlencoded";
  2. static char frmdata[] = "username=username&password=password&loginButton=Login&autoScroll=&loginForm_SUBMIT=1&loginForm%3A_idcl=&loginForm%3A_link_hidden_=&javax.faces.ViewState=rO0ABXVyABNbTGphdmEubGFuZy5PYmplY3Q7kM5YnxBzKWwCAAB4cAAAAAN0AAdfaWQxNDc4cHQACi9sb2dpbi5qc3A%3D";
  3. static LPSTR accept = ("*/*", NULL);
  4.  
  5. string m_strURL, tempstr;
  6. HINTERNET hSession, hDownload, hRequest;
  7.  
  8. hSession = InternetOpen("DFBAC", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
  9.  
  10. hDownload = InternetConnect(hSession, "localhost", INTERNET_DEFAULT_HTTPS_PORT, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0);
  11. hRequest = HttpOpenRequest(hDownload, "POST", "/homepage/login.jsf", "HTTP/1.1", NULL, NULL, INTERNET_FLAG_SECURE, 0);
  12.  
  13. HttpSendRequest(hRequest, hdrs, strlen(hdrs), frmdata, strlen(frmdata));