“application/json” constant in .NET framework

后端 未结 2 1133
栀梦
栀梦 2021-02-04 22:44

I\'ve just declared a constant for the \"application/json\" content type in one of my classes.

public const string JsonContentType = \"application/json\";
         


        
2条回答
  •  盖世英雄少女心
    2021-02-04 23:24

    In order to add an up-to-date answer: since dotnet core 2.1 MediaTypeNames.Application.Json has been defined.

    See https://github.com/dotnet/corefx/pull/26701 for the changeset.

提交回复
热议问题