Files
TEngine/Assets/GameScripts/DotNet/Hotfix/Server/Demo/HttpHelper.cs
ALEXTANG 336d4b2eb9 [+] 接入ET8服务端
[+] 接入ET8服务端
2023-07-13 12:23:48 +08:00

17 lines
530 B
C#

using System.Net;
using System.Text;
namespace ET.Server
{
public static partial class HttpHelper
{
public static void Response(HttpListenerContext context, object response)
{
byte[] bytes = MongoHelper.ToJson(response).ToUtf8();
context.Response.StatusCode = 200;
context.Response.ContentEncoding = Encoding.UTF8;
context.Response.ContentLength64 = bytes.Length;
context.Response.OutputStream.Write(bytes, 0, bytes.Length);
}
}
}