Invoke-RestMethod
CautionCall REST APIs
Invoke-RestMethod <url>
Calls APIs and auto-parses JSON into objects (irm) — the API counterpart to iwr. Automation's workhorse.
Examples
irm https://api.example.com/status | select stateRead a status field
Syntax
Invoke-RestMethod <uri> [-Method POST] [-Body json] [-Headers @{}]
Before you run it
Mutating methods really mutate.
Related commands
- Invoke-WebRequestHTTP request (PS)
- ConvertTo-JsonConvert to/from JSON
- curlHTTP client
The same reference, with no signal at all
Every command on this site, held on your device. The app adds 632 more: 1,510 commands and 120 fix flows, searchable with no connection. Free to install, no ads (some content is a one-time purchase).
Get it free on the App Store