1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
$session = New-Object Microsoft.PowerShell.Commands.WebRequestSession $cookie = New-Object System.Net.Cookie $cookie.Name = "id" $cookie.Value = "pppp" $cookie.Domain = "jesusninoc.com" $session.Cookies.Add($cookie); $head = @{'Content-Type'='application/json'} $postParams = @{'star'=$true;'Lat'=12;'Lon'=-2} $json = $postParams | ConvertTo-Json $web=Invoke-WebRequest -Uri 'https://jesusninoc.com' -Method Post -Body $json -WebSession $session -Headers $head -UserAgent "Mozilla/5.0" $web.StatusCode |