public static async Task WriteJsonAsync(this HttpResponse response, object o, string contentType = null)
        {
            var json = ObjectSerializer.ToString(o);
            await response.WriteJsonAsync(json, contentType);

            await response.Body.FlushAsync();
        }
예제 #2
0
 public static async Task WriteJsonAsync(this HttpResponse response, object o)
 {
     var json = ObjectSerializer.ToString(o);
     await response.WriteJsonAsync(json);
 }
예제 #3
0
 /// <summary>
 /// Write json
 /// </summary>
 /// <param name="response">Response</param>
 /// <param name="data">Data</param>
 /// <returns></returns>
 public static async Task WriteJsonAsync(this HttpResponse response, object data)
 {
     var json = JsonSerializeHelper.ObjectToJson(data);
     await response.WriteJsonAsync(json).ConfigureAwait(false);
 }