Bird
0
0

Which parameter is used with Invoke-RestMethod to include HTTP headers in the request?

easy📝 Conceptual Q2 of 15
PowerShell - Cross-Platform PowerShell
Which parameter is used with Invoke-RestMethod to include HTTP headers in the request?
A-Headers
B-Body
C-Uri
D-Method
Step-by-Step Solution
Solution:
  1. Step 1: Identify parameter for HTTP headers

    The -Headers parameter allows passing a dictionary of headers to the request.
  2. Step 2: Differentiate from other parameters

    -Body is for data payload, -Uri is the URL, and -Method specifies HTTP method.
  3. Final Answer:

    -Headers -> Option A
  4. Quick Check:

    Headers parameter = -Headers [OK]
Quick Trick: Use -Headers to add HTTP headers [OK]
Common Mistakes:
  • Using -Body for headers
  • Confusing -Uri with headers
  • Omitting headers parameter

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes