HttpRequestJsonExtensions.HasJsonContentType(HttpRequest) 方法

定义

检查 Content-Type 标头中的 JSON 类型。

public:
[System::Runtime::CompilerServices::Extension]
 static bool HasJsonContentType(Microsoft::AspNetCore::Http::HttpRequest ^ request);
public static bool HasJsonContentType (this Microsoft.AspNetCore.Http.HttpRequest request);
static member HasJsonContentType : Microsoft.AspNetCore.Http.HttpRequest -> bool
<Extension()>
Public Function HasJsonContentType (request As HttpRequest) As Boolean

参数

request
HttpRequest

返回

如果 Content-Type 标头表示 JSON 内容类型,则为 true;否则为 false。

适用于