Click or drag to resize

AspNetRequestHasPostedBodyLayoutRenderer Class

Used to indicate if the request has a body. Uses IHttpRequestBodyDetectionFeature This returns true when: - It's an HTTP/1.x request with a non-zero Content-Length or a 'Transfer-Encoding: chunked' header. - It's an HTTP/2 request that did not set the END_STREAM flag on the initial headers frame. The final request body length may still be zero for the chunked or HTTP/2 scenarios. This returns false when: - It's an HTTP/1.x request with no Content-Length or 'Transfer-Encoding: chunked' header, or the Content-Length is 0. - It's an HTTP/1.x request with Connection: Upgrade(e.g.WebSockets). There is no HTTP request body for these requests and no data should be received until after the upgrade. - It's an HTTP/2 request that set END_STREAM on the initial headers frame. When false, the request body should never return data.
Inheritance Hierarchy
SystemObject
  NLog.LayoutRenderersLayoutRenderer
    NLog.Web.LayoutRenderersAspNetLayoutRendererBase
      NLog.Web.LayoutRenderersAspNetRequestHasPostedBodyLayoutRenderer

Namespace:  NLog.Web.LayoutRenderers
Assemblies:   NLog.Web.AspNetCore (in NLog.Web.AspNetCore.dll) Version: 5.3.13+628b0876960af3ee3454c99b7985dbb5e1c46bf0
  NLog.Web (in NLog.Web.dll) Version: 5.3.13+628b0876960af3ee3454c99b7985dbb5e1c46bf0
Syntax
public class AspNetRequestHasPostedBodyLayoutRenderer : AspNetLayoutRendererBase

The AspNetRequestHasPostedBodyLayoutRenderer type exposes the following members.

Constructors
  NameDescription
Public methodAspNetRequestHasPostedBodyLayoutRenderer
Initializes a new instance of the AspNetRequestHasPostedBodyLayoutRenderer class
Top
Properties
  NameDescription
Public propertyHttpContextAccessor
Provides access to the current request HttpContext.
(Inherited from AspNetLayoutRendererBase.)
Protected propertyLoggingConfiguration
Gets the logging configuration this target is part of.
(Inherited from LayoutRenderer.)
Protected propertyValueFormatter
Value formatter
(Inherited from LayoutRenderer.)
Top
Methods
  NameDescription
Protected methodAppend
Validates that the HttpContext is available and delegates append to subclasses.StringBuilder.
(Inherited from AspNetLayoutRendererBase.)
Protected methodCloseLayoutRenderer
Closes the layout renderer.
(Inherited from AspNetLayoutRendererBase.)
Protected methodDoAppend
Renders the value of layout renderer in the context of the specified log event into StringBuilder.
(Overrides AspNetLayoutRendererBaseDoAppend(StringBuilder, LogEventInfo).)
Protected methodGetCulture
Get the CultureInfo for rendering the messages to a String
(Inherited from LayoutRenderer.)
Protected methodGetFormatProvider
Get the IFormatProvider for rendering the messages to a String
(Inherited from LayoutRenderer.)
Protected methodInitializeLayoutRenderer
Initializes the layout renderer.
(Inherited from LayoutRenderer.)
Public methodRender
Renders the value of layout renderer in the context of the specified log event.
(Inherited from LayoutRenderer.)
Protected methodResolveServiceT
Resolves the interface service-type from the service-repository
(Inherited from LayoutRenderer.)
Public methodToString
Returns a string that represents the current object.
(Inherited from LayoutRenderer.)
Top
Remarks
1${aspnet-request-has-body}
See Also