Skip to content

Instantly share code, notes, and snippets.

@pedroreys
Created March 10, 2012 21:33
Show Gist options
  • Save pedroreys/2013364 to your computer and use it in GitHub Desktop.
Save pedroreys/2013364 to your computer and use it in GitHub Desktop.
public HttpResponseMessage<Person> Post(Person person)
{
_repository.Save(person);
var responseMessage = new HttpResponseMessage(person, HttpStatusCode.Created);
responseMessage.Headers.Location = new Uri(“http://api.example.com/People/”+person.Id);
return responseMessage;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment