简体   繁体   English

Elasticsearch 巢6.5.1。 如何将原始请求发送到 Elasticsearch

[英]Elasticsearch Nest 6.5.1. How do I get the Raw Request being sent to Elasticsearch

I am using Elasticsearch 6.5.1 and would like to see the raw request being sent to Elasticsearch.我正在使用 Elasticsearch 6.5.1 并希望看到原始请求被发送到 Elasticsearch。 I have set DisableDirectStreaming on my ConnectionSettings, but after making a GetAsync call the IGetResponse.ApiCall.RequestBodyInBytes is always null.我在我的 ConnectionSettings 上设置了 DisableDirectStreaming,但是在进行 GetAsync 调用后,IGetResponse.ApiCall.RequestBodyInBytes 始终是 null。 However, the ResponseBodyInbytes is fine.但是, ResponseBodyInbytes 很好。

Please can someone explain how I can see the RequestBodyInBytes when using Elasticsearch Nest 6.5.1.请有人解释我在使用 Elasticsearch Nest 6.5.1 时如何看到 RequestBodyInBytes。

You can see the request being sent to elasticsearch in DebugInformation of every response object once DisableDirectStreaming is enabled.启用DisableDirectStreaming后,您可以在每个响应 object 的DebugInformation中看到发送到 elasticsearch 的请求。 Link to NEST documentation . 链接到 NEST 文档

Hope that helps.希望有帮助。

I believe you also have to call EnableDebugMode() on your connection settings.我相信您还必须在连接设置上调用EnableDebugMode()

Another option would be to call另一种选择是致电

var jsonString = yourclient.RequestResponseSerializer.SerializeToString(yourdescriptor);

on your descriptor, but debugMode is alot more convenient in my opinion.在您的描述符上,但我认为 debugMode 更方便。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM