Usually login into a web site requires two steps -
You send a GET request to get the page, and you extract from there
some values like session ID etc, and the cookies.
You send a POST request with the values from step 1, and your user name and password.
To know which values you need to send, use your browser in the developer mode (by pressing F12) and examine the traffic. Change the user agent string to match your browser, since some sites send different pages to different clients. You can see an example here.