// POST: api/tasks public HttpResponseMessage Post([FromBody] Task value) { TasksConfig task = new TasksConfig(); int lastindex = task.postTask(value); HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created); response.Headers.Location = new Uri(Request.RequestUri, String.Format("tasks/{0}", lastindex)); return(response); }