TextResponse and AsText #598

Merged
merged 4 commits into from Apr 25, 2012

Conversation

Projects
None yet
2 participants
Contributor

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
87dcda5

@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