Exemple #1
0
        public HttpResponseMessage PostImage()
        {
            var httpRequest = HttpContext.Current.Request;

            if (httpRequest.Files.Count == 1)
            {
                var inputFile   = httpRequest.Files[0];
                var bookPicture = _pictureService.CreateBookPicture(inputFile.InputStream);

                return(Request.CreateResponse(HttpStatusCode.Created, bookPicture));
            }
            else
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest));
            }
        }