I\'m new to Nest, and I very likely am not creating my query like I think I am. My question is more along the lines of teach a man to fish rather than give me a fish. However,
Tested in Nest 6.2.0
You can now just do:
#if DEBUG
connectionSettings.EnableDebugMode(details =>
{
Logger.Debug($"ES Request: {Encoding.UTF8.GetString(details.RequestBodyInBytes ?? new byte[0])}");
Logger.Verbose($"ES Response: {Encoding.UTF8.GetString(details.ResponseBodyInBytes ?? new byte[0])}");
});
#endif
The call EnableDebugMode
will automatically call DisableDirectStreaming
, PrettyJson
, and then OnRequestCompleted
, passing in the function you gave it.
NOTE: There may be a bug somewhere in their response stuff. The response seems to be lacking some closing brackets for some reason.