Created
September 17, 2015 10:08
-
-
Save johnmmoss/4bce614744d80ef18183 to your computer and use it in GitHub Desktop.
Examples using Invoke-RestMethod
This file contains hidden or 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
# Get a page over http | |
Invoke-RestMethod -URI https://www.google.com -Method "GET" | |
# Post text content over http | |
Invoke-RestMethod -URI http://mvcsampleapp.apphb.com/Feedback -Body "Email=afsd&FirstName=sdfasdf&Surname=fasdfsd&Text=fasdfsdafsd" -ContentType "text/html" -Method POST | |
# Get a page over http specifying the IE proxey server | |
$Webproxy = (get-itemproperty 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings').ProxyServer | |
Invoke-RestMethod -URI https://www.google.com -Method "GET" -Proxy $Webproxy -UseDefaultCredentials |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment