remove hardcoded application/json in favour of MediaTypeNames and use ContentTypeApplicationJson property

This commit is contained in:
jbw 2021-05-11 12:18:02 +01:00 committed by Ryan Nowak
parent fc7b666fbe
commit 33d7a2dafd
2 changed files with 4 additions and 2 deletions

View File

@ -3,11 +3,13 @@
// Licensed under the MIT License.
// ------------------------------------------------------------
using System.Net.Mime;
namespace Dapr.Client
{
internal class Constants
{
public const string ContentTypeApplicationJson = "application/json";
public const string ContentTypeApplicationJson = MediaTypeNames.Application.Json;
public const string ContentTypeApplicationGrpc = "application/grpc";
}
}

View File

@ -129,7 +129,7 @@ namespace Dapr.Client
if (content != null)
{
envelope.Data = content;
envelope.DataContentType = "application/json";
envelope.DataContentType = Constants.ContentTypeApplicationJson;
}
if (metadata != null)