示例#1
0
        public void GetServerInfo(HttpListenerContext context)
        {
            string endpoint = ReqExtracters.ExtractEndpoint(context.Request);

            EndpointInfo.ServerInfo serverInfo = _db.GetServerInfo(endpoint);

            if (serverInfo == null)
            {
                this.SendResponse(context.Response, "", HttpStatusCode.NotFound);
                return;
            }

            string serverInfoJson = JsonConvert.SerializeObject(serverInfo);

            this.SendResponse(context.Response, serverInfoJson, HttpStatusCode.OK);
        }