Tracing cliche fails to trace for 'GET'. #6705
Unanswered
bimargulies
asked this question in
Q&A
Replies: 3 comments 1 reply
-
|
what's the code for the logging handler? |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
internal class LoggingRequestHandler : DelegatingHandler
{
protected override async Task<HttpResponseMessage> SendAsync(
HttpRequestMessage request, CancellationToken cancellationToken)
{
Console.WriteLine(request.ToString());
Console.WriteLine($"requesting {request.RequestUri}");
if (request.Content is not null)
{
var jsonContent = await
request.Content.ReadAsStringAsync(cancellationToken);
Console.WriteLine($"Request: {jsonContent}");
}
Console.WriteLine($"Headers: {request.Headers}");
var response = await base.SendAsync(request, cancellationToken);
Console.WriteLine("Response:");
Console.WriteLine(response.ToString());
Console.WriteLine(await
response.Content.ReadAsStringAsync(cancellationToken));
Console.WriteLine();
return response;
}
}
…On Mon, Jun 30, 2025 at 12:59 PM Vincent Biret ***@***.***> wrote:
what's the code for the logging handler?
—
Reply to this email directly, view it on GitHub
<#6705 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACE7UQQ4TITKE4OQONND7L3GFUFZAVCNFSM6AAAAACAORHLNSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTGNRSGAZDINA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
-
|
Vincent, thanks for the help. It's working fine now, and I really have no
clue as to how I convinced myself that I was not hitting a breakpoint in
the handler.
…On Wed, Jul 2, 2025 at 10:32 AM Vincent Biret ***@***.***> wrote:
Thank you for the additional information.
I suspect that with this code you're at least getting the request URI in
the logs?
The content not being logged is expected since GET requests do not have a
body.
—
Reply to this email directly, view it on GitHub
<#6705 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACE7UWSI753EWC2B7GTWNT3GPUQBAVCNFSM6AAAAACAORHLNSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTGNRUGE4TANY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The code below works as intended when making Post requests via the kiota client: the handler is called and can spy on the traffic.
But when the call is a GET, the handler is not called.
Beta Was this translation helpful? Give feedback.
All reactions