Skip to content

Instantly share code, notes, and snippets.

@DieNand
Created December 12, 2019 21:32
Show Gist options
  • Save DieNand/d361b11f088c8311286a25f7da682e88 to your computer and use it in GitHub Desktop.
Save DieNand/d361b11f088c8311286a25f7da682e88 to your computer and use it in GitHub Desktop.
Example of using curl in Windows (powershell). In this case it is actually shorthand for Invoke-RestMethod which differs a bit from curl on Linux
curl -Method POST -Uri <url> -ContentType 'application/json' -Body '{"content": "Whatever you want to put in here"}' -UseBasicParsing
-UseBasicParsing
Prints output directly to console and prevents the requirement for having to set up Internet Explorer in Windows 10
See https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-restmethod?view=powershell-6 for more details.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment