Getting hold of raw POST data when using [FromBody]

后端 未结 3 1053
情话喂你
情话喂你 2020-12-20 16:09

I have a controller running on ASP.NET Core 1.0 RC2 and I\'d like to dump the raw POST data out to telemetry as ApplicationInsights doesn\'t do this for you. My code looks l

3条回答
  •  囚心锁ツ
    2020-12-20 16:41

    You need to enable buffering the request body: services.Configure(options => options.BufferBody = true); https://github.com/aspnet/HttpAbstractions/blob/dev/src/Microsoft.AspNetCore.Http/Features/FormOptions.cs#L20

提交回复
热议问题