Skip to content

Instantly share code, notes, and snippets.

@jd-boyd
Created April 3, 2023 04:11
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 jd-boyd/a09a91b16185fc055a385ee705c93105 to your computer and use it in GitHub Desktop.
Save jd-boyd/a09a91b16185fc055a385ee705c93105 to your computer and use it in GitHub Desktop.
PowerShell POST form, POST JSON
$params = @{"@type"="login";
"username"="xxx@gmail.com";
"password"="yyy";
}
Invoke-WebRequest -Uri http://foobar.com/endpoint -Method POST -Body $params
Invoke-WebRequest -Uri http://foobar.com/endpoint -Method POST -Body ($params|ConvertTo-Json) -ContentType "application/json"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment