Skip to content

Instantly share code, notes, and snippets.

@mandykoh
Created April 25, 2010 00:19
Show Gist options
  • Select an option

  • Save mandykoh/378061 to your computer and use it in GitHub Desktop.

Select an option

Save mandykoh/378061 to your computer and use it in GitHub Desktop.
var content = Encoding.UTF8.GetBytes("Hello, World!");
using (var contentSource = new ByteArraySource(content)) {
var response = new HttpResponse(HttpStatuses.OK, "OK");
response.Headers.Set("Content-Type", "text/plain");
response.Body = contentSource;
/* Do something with the response ... */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment