This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################################################### | |
####### only works if the Route template is blank ####### | |
######################################################### | |
# QUERY based parameter values - GET method | |
$firstName = 'Marc' | |
$surName = 'Kean' | |
$iwr = Invoke-WebRequest -Uri "https://ejuke2.azurewebsites.net/api/blog?firstname=$firstName&surname=$surName" -Method Get | |
$iwr.content | |
# BODY based parameter values - POST method | |
$firstName = 'Marc' | |
$surName = 'Kean' | |
$postParams = @{"firstname" = $firstName;"surName" = $surName} | ConvertTo-Json | |
$iwr = Invoke-WebRequest -Uri "https://ejuke2.azurewebsites.net/api/blog" -Method POST -Body $postParams | |
$iwr.content | |
######################################################### | |
##### only works if the Route template is NOT blank ##### | |
######################################################### | |
# Route Template: RouteName/{firstname}/{surname} | |
# PARAMS path based parameter values - GET method | |
$firstName = 'Marc' | |
$surName = 'Kean' | |
$iwr = Invoke-WebRequest -Uri "https://ejuke2.azurewebsites.net/api/RouteName/$firstName/$surName" -Method Get | |
$iwr.content | |
# PARAMS path based parameter values - POST method | |
$firstName = 'Marc' | |
$surName = 'Kean' | |
$iwr = Invoke-WebRequest -Uri "https://ejuke2.azurewebsites.net/api/RouteName/$firstName/$surName" -Method POST | |
$iwr.content |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment