using System; using System.Collections.Generic; using System.IO; using System.Net; using System.Net.Http; using System.Net.WebSockets; using System.Threading.Tasks; using Microsoft.Extensions.Primitives; namespace Robust.Server.ServerStatus { [NotContentImplementable] public interface IStatusHandlerContext { HttpMethod RequestMethod { get; } IPEndPoint RemoteEndPoint { get; } /// /// Stream that reads the request body data, /// Stream RequestBody { get; } Uri Url { get; } bool IsGetLike { get; } IReadOnlyDictionary RequestHeaders { get; } IDictionary ResponseHeaders { get; } bool KeepAlive { get; set; } bool IsWebSocketRequest { get; } Task RequestBodyJsonAsync(); Task RespondNoContentAsync(); Task RespondAsync( string text, HttpStatusCode code = HttpStatusCode.OK, string contentType = "text/plain"); Task RespondAsync( string text, int code = 200, string contentType = "text/plain"); Task RespondAsync( byte[] data, HttpStatusCode code = HttpStatusCode.OK, string contentType = "text/plain"); Task RespondAsync( byte[] data, int code = 200, string contentType = "text/plain"); Task RespondErrorAsync(HttpStatusCode code); Task RespondJsonAsync(object jsonData, HttpStatusCode code = HttpStatusCode.OK); Task RespondStreamAsync(HttpStatusCode code = HttpStatusCode.OK); Task AcceptWebSocketAsync(); } }