michielpost / Q42.HueApi

C# helper library to talk to the Philips Hue bridge
MIT License
412 stars 114 forks source link

Logging of Http Request/Response #189

Closed spudwebb closed 4 years ago

spudwebb commented 4 years ago

Is there an easy way to log all the json traffic between the Q42.HueApi and a bridge?

If not, would it be possible to pass an optional HttpMessageHandler to the HttpClient of a HueClient object, so that we can implement logging of requests/responses as explained here: https://stackoverflow.com/questions/18924996/logging-request-response-messages-when-using-httpclient?answertab=votes#tab-top

?

michielpost commented 4 years ago

I created a PR so you can provide your own HttpClient. Will this work for your scenario? https://github.com/Q42/Q42.HueApi/pull/190

spudwebb commented 4 years ago

Yes this will work. thanks

michielpost commented 4 years ago

Ok, this is now included in version 3.11.0, available on NuGet: https://www.nuget.org/packages/Q42.HueApi