# The Web

The Web: APIs as Objects: \`Invoke-RestMethod\`, Pages and Downloads: \`Invoke-WebRequest\`.

Updated: November 10, 2026

1. [APIs as Objects: \`Invoke-RestMethod\`](https://www.ask-codey.com/lessons/powershell-invoke-restmethod) (Journeyman): Invoke-RestMethod asks a web API for data and turns its JSON answer into objects, so a weather forecast arrives ready for Select-Object, Where-Object and the rest of the pipeline, and query parameters after a ? in the address ask for exactly what you want.
2. [Pages and Downloads: \`Invoke-WebRequest\`](https://www.ask-codey.com/lessons/powershell-invoke-webrequest) (Journeyman): Invoke-WebRequest gives you the whole answer from a web address, not only its data, so you can read the status code that says whether a page is there, read the headers that describe it, and save what it sends as a file with -OutFile.

Source: https://www.ask-codey.com/courses/powershell-in-depth/topics/powershell-the-web
