public HttpResponseMessage Put(Friend friend) { var response = Request.CreateResponse(HttpStatusCode.OK, friend); _repository.Save(friend); string uri = Url.Route(null, new { id = friend.Id }); // Where is the modified timesheet? response.Headers.Location = new Uri(Request.RequestUri, uri); return response; }
public HttpResponseMessage Post(Friend friend) { _repository.Insert(friend); string uri = Url.Route(null, new { id = friend.Id }); // Where is the new timesheet? var response = Request.CreateResponse(HttpStatusCode.Created, friend); response.Headers.Location = new Uri(Request.RequestUri, uri); return response; }