Document the new `Query` value for the `-Method` parameter of Invoke-WebRequest and Invoke-RestMethod
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 86/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- powershell
- Lĩnh vực
- documentation
Hướng nghiên cứu
Bắt đầu với reference/7.6/Microsoft.PowerShell.Utility/Invoke-WebRequest.md và Invoke-RestMethod.md, đọc các phần về tham số -Method và các ví dụ lân cận. Thêm Query vào các giá trị hợp lệ và ghi lại hành vi của request body bằng các ví dụ phù hợp, sau đó xác minh rằng cả hai bài viết đều tuân theo các quy ước tài liệu của repository và được render chính xác.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Prerequisites
- Existing Issue: Search the existing issues for this repository. If there is an issue that fits your needs do not file a new one. Subscribe, react, or comment on that issue instead.
- Descriptive Title: Write the title for this issue as a short synopsis. If possible, provide context. For example, "Document new
Get-Foocmdlet" instead of "New cmdlet."
Summary
PowerShell is adding support for the standard HTTP QUERY method to Invoke-WebRequest and Invoke-RestMethod. A new Query value has been added to the WebRequestMethod enum (the valid set for the -Method parameter), implemented on top of .NET 10's new System.Net.Http.HttpMethod.Query API.
Details
The QUERY method is a safe, idempotent method defined by the IETF that is like GET, but sends its payload in the request body instead of the URI. This allows large or structured search/query parameters to be submitted without URI length limits. For more information, see the HTTP QUERY method (IETF) and MDN: HTTP QUERY method.
Articles
- Invoke-WebRequest (
reference/7.6/Microsoft.PowerShell.Utility/Invoke-WebRequest.md) - Invoke-RestMethod (
reference/7.6/Microsoft.PowerShell.Utility/Invoke-RestMethod.md)
Suggested updates:
- Add
Queryto the-Methodparameter description and the list of valid values. - Add one or two examples (see below).
Suggested content
Parameter description for -Method:
Specifies the HTTP method used for the request.
QUERYsends a safe, idempotent request whose parameters are carried in the request body rather than the URI. When-Bodyis a hashtable, it is sent as the request content (not converted into URI query parameters as withGET).
Example:
Invoke-RestMethod -Uri 'https://api.example.com/search' -Method Query `
-Body @{ q = 'powershell'; limit = 10 } `
-ContentType 'application/x-www-form-urlencoded'
Example:
$body = @{ query = 'SELECT * FROM events'; from = '2026-01-01' } | ConvertTo-Json
Invoke-WebRequest -Uri 'https://api.example.com/sql' -Method Query -Body $body -ContentType 'application/json'
Related Source Pull Requests
Related Source Issues
- Ngôn ngữ chính
- PowerShell
- Star
- 2.6k
- Fork
- 1.7k
- Merge trung bình
- 4 giờ 11 phút
- Pull request đã merge (30 ngày)
- 8
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của MicrosoftDocs/PowerShell-Docs
-
needs-triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
MicrosoftDocs/PowerShell-Docs#13332 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
issue-doc-bug up-for-grabs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
MicrosoftDocs/PowerShell-Docs#13324 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
hold-for-pr hold-for-release issue-doc-idea
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
MicrosoftDocs/PowerShell-Docs#13319 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
issue-doc-bug needs-triage up-for-grabs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
MicrosoftDocs/PowerShell-Docs#13305 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
hold-for-pr hold-for-release issue-doc-idea
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
MicrosoftDocs/PowerShell-Docs#13195 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của MicrosoftDocs/PowerShell-Docs
Issue tương tự
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
components-web-app/docs#260 ·
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
dense-analysis/ale#5174 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
aws-samples/sample-per-model-bedrock#321 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
topoteretes/cognee#6005 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 68/100
FavioVazquez/showtime#101 ·
Maintainer thường phản hồi trong vòng 1 ngày