Beispiel #1
0
        public HttpResponseMessage AddGallery(HttpRequestMessage request)
        {
            var data = request.Content.ReadAsStringAsync().Result;

            if (data == null)
            {
                return(new HttpResponseMessage(HttpStatusCode.BadRequest)
                {
                    Content = new StringContent("Post data is empty")
                });
            }
            else
            {
                Debug.WriteLine(data);
                var blogdata = JsonConvert.DeserializeObject <ImageWrapper>(data);
                blogService.AddGallery(blogdata.images);
                return(new HttpResponseMessage(HttpStatusCode.OK));
            }
        }