Skip to content

Instantly share code, notes, and snippets.

@danishjafri
Created November 12, 2021 08:56
Show Gist options
  • Save danishjafri/b7c0f58016ba0c53b8578d36e94085a1 to your computer and use it in GitHub Desktop.
Save danishjafri/b7c0f58016ba0c53b8578d36e94085a1 to your computer and use it in GitHub Desktop.
API Invoke Script using PowerShell
# Run these using Windows PowerShell ISE
$Reponse = Invoke-RestMethod -Uri 'https://localhost:44356/api/projects' -Method Get
$Reponse
$Reponse = Invoke-RestMethod -Uri 'https://localhost:44356/api/projects/12345' -Method Get
$Reponse
$Reponse = Invoke-RestMethod -Uri 'https://localhost:44356/api/projects' -Method Post
$Reponse
$Reponse = Invoke-RestMethod -Uri 'https://localhost:44356/api/projects' -Method Put
$Reponse
$Reponse = Invoke-RestMethod -Uri 'https://localhost:44356/api/projects/12345' -Method Delete
$Reponse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment