Skip to content

Instantly share code, notes, and snippets.

@Auronmatrix
Last active August 1, 2016 17:52
Show Gist options
  • Save Auronmatrix/d25aed98364ed7a3ab673a4699427a42 to your computer and use it in GitHub Desktop.
Save Auronmatrix/d25aed98364ed7a3ab673a4699427a42 to your computer and use it in GitHub Desktop.
public async Task<HttpResponseMessage> Post(string name)
{
var response = "Success!";
var httpResponse = new HttpResponseMessage(HttpStatusCode.OK);
httpResponse.Headers.ConnectionClose = true;
string body = Request.Content.ReadAsStringAsync().Result;
// Do your thing with the body content
// Update the response
httpResponse.Content = new StringContent(response);
return httpResponse;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment