lundi 7 mai 2018

How to programmatically log into an https website using a POST request in Go?

Assuming you have the HTML form below, how do you write a Go program to programmatically log into it. Note the URL is "https://".

<form action="https://SomeWebSite.com/index.php" method="post" id="login"  >
<div class="loginform">

    <div class="form-label"> <label for="username">Username</label> </div>
    <div class="form-input"> <input type="text" name="username" id="username" size="14" value="" /> </div>

    <div class="form-label"> <label for="password">Password</label> </div>
    <div class="form-input">
       <input type="password" name="password" id="password" size="15" value=""  />
       <input type="submit" id="loginbtn" value="Login" />
    </div>

I'm new to GO but very interested in investing heavily into it. So thank you for your assistance with this.

Aucun commentaire:

Enregistrer un commentaire