-
Notifications
You must be signed in to change notification settings - Fork 8k
Improve debug logging of Web cmdlet request and response #25479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve debug logging of Web cmdlet request and response #25479
Conversation
...t.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs
Outdated
Show resolved
Hide resolved
...t.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs
Show resolved
Hide resolved
try | ||
{ | ||
//NOTE: Because the request content is directly stringified via HttpResponseMessage, there's no need to do a culture format, it has already been performed. | ||
WriteDebug(request.ToString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to start only with this in the PR and remove all new code below.
...t.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1
Show resolved
Hide resolved
1221e9f
to
580a97b
Compare
d40f1c8
to
d836f7c
Compare
@iSazonov requested changes implemented. I also added response logging per the original issue specification. |
@JustinGrote Please fix CodeFactor issues. |
d836f7c
to
fdd1bb7
Compare
@iSazonov done. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
@JustinGrote Thanks for your contribution! |
@iSazonov thanks for your time and patience of the review, I am well aware of the commitment it requires on your side and it is valued and appreciated. I have filed two follow-on issues for the reasonings we discussed in this PR. |
PR Summary
Log Body when -DebugRequestContent is specifiedPR Context
Closes #23879
PR Checklist
.h
,.cpp
,.cs
,.ps1
and.psm1
files have the correct copyright header