Using REST with PowerShell Objects to Get and Put individual data

suggest change

GET your REST data and store in a PowerShell object:

$Post = Invoke-RestMethod -Uri "http://jsonplaceholder.typicode.com/posts/1"

Modify your data:

$Post.title = "New Title"

PUT the REST data back

$Json = $Post | ConvertTo-Json
Invoke-RestMethod -Method Put -Uri "http://jsonplaceholder.typicode.com/posts/1" -Body $Json -ContentType 'application/json'

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents