Exemple #1
0
        public void PutServerMatch(HttpListenerContext context)
        {
            var inpStream = new StreamReader(context.Request.InputStream);

            string   endpoint  = ReqExtracters.ExtractEndpoint(context.Request);
            DateTime timestamp = ReqExtracters.ExtractTimestamp(context.Request);

            MatchInfo matchInfo =
                JsonConvert.DeserializeObject <MatchInfo>(inpStream.ReadToEnd());

            this.SendResponse(context.Response, "",
                              _db.PutServerMatch(endpoint, timestamp, matchInfo) ? HttpStatusCode.OK : HttpStatusCode.BadRequest);
        }