Replies: 1 comment
-
You can inject the HttpClient and implement the logging inside the handler: https://stackoverflow.com/a/18925296/1229622 EDIT: Sorry, I have no read your question properly. But the answer is the same. You could store the request / response somewhere, e.g. in AsyncLocal value: https://learn.microsoft.com/en-us/dotnet/api/system.threading.asynclocal-1?view=net-7.0 |
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
-
In the context of the generated client, is there a possibility to get the HttpRequest that was sent to the endpoint?
In my case, I'm trying to scaffold tests out of calls that someone performs using a tool that targets a application using a auto generated client. In order to scaffold tests, I need both the request and response. The response is provided, but the request is created and disposed inside of the generated code.
If it is not possible still, do you think it would be a good idea to add the possibility to do this in Client.Class.liquid template for C#?Maybe add it as a new config option and create a method that returns the created request for each endpoint, or make the methods return a tuple, with both response and requests?
Beta Was this translation helpful? Give feedback.
All reactions