From f2ca9b843314fd62c7376a8a918ba885c88f16b1 Mon Sep 17 00:00:00 2001 From: Christopher Warrington Date: Wed, 13 Aug 2025 14:46:14 -0700 Subject: [PATCH] Copy edit Body parameter of Invoke-RestMethod (#12280) * Copy edit Body parameter of Invoke-RestMethod The documentation for the `-Body` parameter of `Invoke-RestMethod` incorrectly uses "response" when it means "request". * Copy changes to all versions --------- Co-authored-by: Sean Wheeler --- .../5.1/Microsoft.PowerShell.Utility/Invoke-RestMethod.md | 3 ++- .../7.4/Microsoft.PowerShell.Utility/Invoke-RestMethod.md | 2 +- .../7.5/Microsoft.PowerShell.Utility/Invoke-RestMethod.md | 2 +- .../7.6/Microsoft.PowerShell.Utility/Invoke-RestMethod.md | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Invoke-RestMethod.md b/reference/5.1/Microsoft.PowerShell.Utility/Invoke-RestMethod.md index a6caad55b9d..4778d2ed768 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Invoke-RestMethod.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Invoke-RestMethod.md @@ -184,8 +184,9 @@ Specifies the body of the request. The body is the content of the request that f You can also pipe a body value to `Invoke-RestMethod`. The **Body** parameter can be used to specify a list of query parameters or specify the content of -the response. +the . +request. When the input is a GET request, and the body is an IDictionary (typically, a hash table), the body is added to the URI as query parameters. For other request types (such as POST), the body is set as the value of the request body in the standard name=value format. diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Invoke-RestMethod.md b/reference/7.4/Microsoft.PowerShell.Utility/Invoke-RestMethod.md index 9a378d02951..cd6d6461aa2 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Invoke-RestMethod.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Invoke-RestMethod.md @@ -408,7 +408,7 @@ Specifies the body of the request. The body is the content of the request that f You can also pipe a body value to `Invoke-RestMethod`. The **Body** parameter can be used to specify a list of query parameters or specify the content of -the response. For query parameters, the cmdlet uses the **System.Net.WebUtility.UrlEncode** method +the request. For query parameters, the cmdlet uses the **System.Net.WebUtility.UrlEncode** method method to encode the key-value pairs. For more information about encoding strings for URLs, see [the UrlEncode() method reference](xref:System.Net.WebUtility.UrlEncode*). diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Invoke-RestMethod.md b/reference/7.5/Microsoft.PowerShell.Utility/Invoke-RestMethod.md index 729e5a7f16f..210a3134947 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Invoke-RestMethod.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Invoke-RestMethod.md @@ -408,7 +408,7 @@ Specifies the body of the request. The body is the content of the request that f You can also pipe a body value to `Invoke-RestMethod`. The **Body** parameter can be used to specify a list of query parameters or specify the content of -the response. For query parameters, the cmdlet uses the **System.Net.WebUtility.UrlEncode** method +the request. For query parameters, the cmdlet uses the **System.Net.WebUtility.UrlEncode** method method to encode the key-value pairs. For more information about encoding strings for URLs, see [the UrlEncode() method reference](xref:System.Net.WebUtility.UrlEncode*). diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Invoke-RestMethod.md b/reference/7.6/Microsoft.PowerShell.Utility/Invoke-RestMethod.md index 935aeab87cc..c6e1f250d5c 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Invoke-RestMethod.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Invoke-RestMethod.md @@ -408,7 +408,7 @@ Specifies the body of the request. The body is the content of the request that f You can also pipe a body value to `Invoke-RestMethod`. The **Body** parameter can be used to specify a list of query parameters or specify the content of -the response. For query parameters, the cmdlet uses the **System.Net.WebUtility.UrlEncode** method +the request. For query parameters, the cmdlet uses the **System.Net.WebUtility.UrlEncode** method method to encode the key-value pairs. For more information about encoding strings for URLs, see [the UrlEncode() method reference](xref:System.Net.WebUtility.UrlEncode*).