Skip to content

Instantly share code, notes, and snippets.

@matejskubic
Created May 5, 2014 14:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matejskubic/7be604a7e1c16cdbf8b5 to your computer and use it in GitHub Desktop.
Save matejskubic/7be604a7e1c16cdbf8b5 to your computer and use it in GitHub Desktop.
Powershell post form with relative / absolute url
$resp = Invoke-WebRequest -Verbose -Uri $url
$selectedForm = $resp.Forms[0]
$webAction = New-Object System.Uri ($resp.BaseResponse.ResponseUri, $selectedForm.Action)
$resp2 = Invoke-WebRequest -Verbose -Uri $webAction -Method $selectedForm.Method -Body $selectedForm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment