Use same code for Json Platform as TE (#7292)

This commit is contained in:
Ben Adams 2019-05-29 00:59:11 +01:00 committed by Sébastien Ros
parent 6e253996d9
commit 9f9c79bbe8
1 changed files with 6 additions and 1 deletions

View File

@ -117,7 +117,7 @@ namespace PlatformBenchmarks
// Content-Length header
writer.Write(_headerContentLength);
var jsonPayload = JsonSerializer.ToBytes(new { message = "Hello, World!" }, SerializerOptions);
var jsonPayload = JsonSerializer.ToUtf8Bytes(new JsonMessage { message = "Hello, World!" }, SerializerOptions);
writer.WriteNumeric((uint)jsonPayload.Length);
// End of headers
@ -155,5 +155,10 @@ namespace PlatformBenchmarks
PlainText,
Json
}
public struct JsonMessage
{
public string message { get; set; }
}
}
}