14 lines
542 B
PowerShell
14 lines
542 B
PowerShell
$body = '{"username":"aceykubbo","password":"axl123.0"}'
|
|
try {
|
|
$r = Invoke-WebRequest -Uri 'http://localhost:3001/api/login' -Method POST -ContentType 'application/json' -Body $body -TimeoutSec 10
|
|
Write-Host "Status:" $r.StatusCode
|
|
Write-Host "Body:" $r.Content
|
|
} catch {
|
|
Write-Host "Error:" $_.Exception.Message
|
|
if ($_.Exception.Response) {
|
|
$stream = $_.Exception.Response.GetResponseStream()
|
|
$reader = New-Object System.IO.StreamReader($stream)
|
|
Write-Host "Response:" $reader.ReadToEnd()
|
|
}
|
|
}
|