Azure-从API管理将请求详细信息记录到EventHub

Azure-从API管理将请求详细信息记录到EventHub,azure,azure-eventhub,azure-api-management,Azure,Azure Eventhub,Azure Api Management,Microsoft在将Log to EventHub操作添加到传入处理时提供的基本示例非常有用,但我希望能够记录请求内容和内容长度。目前,我找不到本例中使用的context或context.Request对象的任何文档或定义 <log-to-eventhub logger-id ='logger-id'> @( string.Join(",", DateTime.UtcNow, context.Deployment.ServiceName, context.RequestId,

Microsoft在将Log to EventHub操作添加到传入处理时提供的基本示例非常有用,但我希望能够记录请求内容和内容长度。目前,我找不到本例中使用的context或context.Request对象的任何文档或定义

<log-to-eventhub logger-id ='logger-id'>
  @( string.Join(",", DateTime.UtcNow, context.Deployment.ServiceName, context.RequestId, context.Request.IpAddress, context.Operation.Name))
</log-to-eventhub>

@(string.Join(“,”,DateTime.UtcNow,context.Deployment.ServiceName,context.RequestId,context.Request.IpAddress,context.Operation.Name))

有人能给我指出这方面的文档吗,或者至少告诉我如何获取请求正文的内容或正文长度吗?

以下是获取正文的方法:

string inBody = context.Request.Body.As<string>(preserveContent: true); 
string inBody=context.Request.Body.As(preserveContent:true);
有关更多信息,请参阅表中的
上下文
上下文.请求
IMessage
部分