TextResponse and AsText #598

merged 4 commits into from Apr 25, 2012


None yet
2 participants

prabirshrestha commented Apr 24, 2012

This is similar to the asp.net mvc's ContentResult. It makes returning plain text easier. I named it TextResponse rather then ContentResponse coz I think Text is more precise.

I have created a new response called TextResponse.

var response = new TextRespone("sample text");
response = new TextResponse("sample text", "text/cache-manifest");

I have also added response formatter extension methods.

return Response.AsText("sample text");
return Response.AsText("sample text", "text/cache-manifest");

@thecodejunkie thecodejunkie added a commit that referenced this pull request Apr 25, 2012

@thecodejunkie thecodejunkie Merge pull request #598 from prabirshrestha/TextResponse
TextResponse and AsText

@thecodejunkie thecodejunkie merged commit 87dcda5 into NancyFx:master Apr 25, 2012

prabirshrestha deleted the prabirshrestha:TextResponse branch Feb 20, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment