// POST api/student //public HttpResponseMessage Post() public HttpResponseMessage Post(order ord) { DetailsRepository.save(ord); //If the orderEvent is not null the f****r fails !! serveral // hours wasted. ord.orderEvent = null; var response = Request.CreateResponse(HttpStatusCode.Created, ord); string url = Url.Link("DefaultApi", new { ord.id }); response.Headers.Location = new Uri(url); //response.Content.Dispose(); return(response); }