7

I am new to .NET and I want to develop the application which send multiple HTTP responses to the single HTTP Request.

Is there any way that I can store HTTP Handler on server which can be used when it is needed.

3
  • 2
    I'm very curious, why do you need multiple responses per request? What client app? Commented Dec 7, 2010 at 5:09
  • 9
    dont thank in advance, thank by selecting answers to your old questions. Commented Dec 7, 2010 at 5:09
  • stackoverflow.com/questions/4198287/… check out this Commented Dec 7, 2010 at 5:21

2 Answers 2

7

You would break the HTTP standard by sending multiple responses to a request.

However, you can use Transfer-Encoding "chunked" which sends a response in multiple parts. In regular ASP.Net you would use Response.Flush() to achieve this.

I guess that you have to execute the ActionResult and send it manually with the response object to be able to send multiple parts in the same response.

Sign up to request clarification or add additional context in comments.

Comments

0

Static members persist across multiple requests, so you could do this:

public static class HttpHandlerStorage
{
    //  this should still be here, unless the HttpApplication reloads.
    public static IHttpHandler StoredHandler { get; set; }
}

However, your HttpContext will get destroyed at the end of the request.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.