From the course: Complete Guide to PowerShell 7
Unlock this course with a free trial
Join today to access over 24,400 courses taught by industry experts.
Making HTTP requests with Invoke-RestMethod - PowerShell Tutorial
From the course: Complete Guide to PowerShell 7
Making HTTP requests with Invoke-RestMethod
- [Instructor] Now one of the powerful features of working with PowerShell is the ability to connect to remote APIs and be able to retrieve information. So what I've set up here is a API that's running on local host 8080, and I have it enabled to return some information. It'll just be some basic sample data. Now, to request that information, we're going to use invoke Rest method and pass it the URI, which will be the URL that we have here. And then I'm going to specify the method. So in this instance, I want to get information. So let's execute this command and put that into the response. I'm going to say run selection. And then when I do the response object, you can see I get some basic information, and it's just a list of fictitious security events, security event 1, 2, 3, 4, 5, all the way through to 25. So that wasn't the anonymous way of doing it. And sometimes, APIs are anonymous, so we can literally just call the endpoint and it returns the values that are there. Sometimes…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
-
-
-
-
(Locked)
Working with APIs and web services11m 36s
-
(Locked)
Making HTTP requests with Invoke-RestMethod8m 33s
-
(Locked)
Making HTTP requests with Invoke-WebRequest1m 59s
-
(Locked)
Parsing JSON data2m 27s
-
(Locked)
Parsing XML data3m 23s
-
(Locked)
Creating custom API integrations9m 4s
-
(Locked)
Automating web operations5m 47s
-
(Locked)
Handling other data formats4m 34s
-
(Locked)
-
-
-