IHttpRequestBodyDetectionFeature.CanHaveBody Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Indicates if the request can have a body.
public:
property bool CanHaveBody { bool get(); };
public bool CanHaveBody { get; }
member this.CanHaveBody : bool
Public ReadOnly Property CanHaveBody As Boolean
Property Value
Remarks
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.
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.