javascript - How to submit a HTML form using httpurlconnection? -


the website has following form

  • please login user name , password.
  •     <li><a tabindex=2 target="_blank"         href="/portal/site/login/en-gb/help.html"         class="assistance redarrow">need logging in?</a>     </li>     <li><label for="username">user name</label> <input tabindex=3         class="authinput" type="text" id="username" name="username"         autocomplete="off" class="authinput" /></li>     <li><label for="password">password</label> <input tabindex=4         type="password" id="password" name="password" autocomplete="off"         class="authinput" /></li>      <li class="persist"><label for="securecomputer"> <input type="checkbox"             value="1" tabindex="5" name="rememberme" id="securecomputer"              /><span style="padding-left:10px;">i on secure computer.</span>             <br><span style="margin-left: 23px; font-size: 10px;">(only check if computer secure , used you.)</span>     </label></li> </ol>                      <a tabindex=6         href="/idm/pwdservice?a=fp"         class="assistance redarrow">forgotten password?</a><br>              <input tabindex=7 type="submit"         value="login"         class="redbtn"/><br> 


    i trying login in similar way this .here how proceeding

    url server = new url(url); httpsurlconnection urlconn = (httpsurlconnection) server.openconnection(); urlconn.setrequestmethod("post"); urlconn.setdooutput(true); urlconn.setdoinput(true); urlconn.setusecaches(false); dataoutputstream printout = new dataoutputstream (urlconn.getoutputstream()); if (parameters != null)       printout.writebytes (parameters); printout.flush(); printout.close(); 

    where parameters of form name1=value1&name2=value2.....&username=uname&password=pwd

    however problem want add param name , value login (tabindex=7) ,as shown in above mentioned link, input not have name value?

    is there way submit such form login website? there loginsubmit function on html page, there way use urlconn.


    Comments

    Popular posts from this blog

    apache - Remove .php and add trailing slash in url using htaccess not loading css -

    javascript - jQuery show full size image on click -