Use same code for Json Platform as TE (#7292)
This commit is contained in:
parent
6e253996d9
commit
9f9c79bbe8
|
|
@ -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; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue