示例#1
0
        public HttpResponseMessage GetFastlySettings()
        {
            var result = FastlyCacheComponent.GetSettingsJSON();

            return(new HttpResponseMessage()
            {
                Content = new StringContent(string.Concat(result), Encoding.UTF8, "application/json")
            });
        }
示例#2
0
        public async Task <HttpResponseMessage> SaveFastlySettings()
        {
            string rawData = await Request.Content.ReadAsStringAsync();

            HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK);

            if (FastlyCacheComponent.SaveSettingsJSON(rawData))
            {
                response.Content = new StringContent("success");
            }
            else
            {
                response.Content    = new StringContent("error");
                response.StatusCode = HttpStatusCode.InternalServerError;
            }

            return(response);
        }