I have a login script in Powershell that does this:
$response = Invoke-WebRequest "https://example.com" -Method Post -Body @{