Files
RobustToolbox/Robust.Server/ServerStatus/IStatusHandlerContext.cs
2022-01-10 01:36:00 +01:00

44 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
using Microsoft.Extensions.Primitives;
namespace Robust.Server.ServerStatus
{
public interface IStatusHandlerContext
{
HttpMethod RequestMethod { get; }
IPEndPoint RemoteEndPoint { get; }
Uri Url { get; }
bool IsGetLike { get; }
IReadOnlyDictionary<string, StringValues> RequestHeaders { get; }
public T? RequestBodyJson<T>();
void Respond(
string text,
HttpStatusCode code = HttpStatusCode.OK,
string contentType = "text/plain");
void Respond(
string text,
int code = 200,
string contentType = "text/plain");
void Respond(
byte[] data,
HttpStatusCode code = HttpStatusCode.OK,
string contentType = "text/plain");
void Respond(
byte[] data,
int code = 200,
string contentType = "text/plain");
void RespondError(HttpStatusCode code);
void RespondJson(object jsonData, HttpStatusCode code = HttpStatusCode.OK);
}
}