Using REST with PowerShell Objects to Get and Put individual data

suggest change

jsonplaceholder.typicode.com echoes the request and does not store it. GET one item into a PowerShell object:

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

Modify your data:

$Post.title = "New Title"

PUT the object 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