I suggest you to look at browser developer tools (for Chrome or Firefox, press F12). While browser developer tool is open , do login manually and inspect what happens behind the scene in developer tools.
If it is form-based login, look at URL at action attribute of form tag. Usually it will be POST method. Inspect request headers and body that browser send to URL for POST method and also inspect response that server returns (usually it returns a cookie in response when login is succesful.
By observing request and response passed between browser and server, you will be able to replicate login with free pascal built in http client (in fact, browser is really just http client, a very sophisticated one)