// POST: api/StockTransaction public HttpResponseMessage PostStockTransaction(StockTransaction stockTransaction) { if (_productService.AddAPIStockTransaction(stockTransaction) == true) { HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created, stockTransaction); response.Headers.Location = new Uri(Request.RequestUri, "/api/StockTransaction" + stockTransaction.TransactionId.ToString()); return(response); } else { HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.NotAcceptable, stockTransaction); return(response); } }