Exercises
- How would we send a delete request to the following URL:
https://httpbin.org/delete
? - What parameters would we need to use
Invoke-WebRequest
with a stateful endpoint? - We try to connect to a website and see the following error:
Invoke-WebRequest: The remote certificate is invalid because of errors in the certificate chain: NotTimeValid
How can we continue to the site with
Invoke-WebRequest
? - Which type of API is stateful? What does this mean?
- We sign up to a web service and get an authentication token. We encode the token using
ConvertTo-SecureString
, store it in a variable called$token
, and then use the variable to create a web request like this:Invoke-WebRequest -Uri 'https://webservice.com/endpoint' -Headers @{Authorization = "Bearer $token"}
We get an authentication error. Have we done something wrong, or is the token bad?
- Get the latitude and longitude of the ISS right now. You can use http://api.open-notify.org/iss-now.json. ...