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.
A HTTP request can have multiple 'responses', but the responses all have statuscodes in the 1xx range, such as 102 Processing. However, these responses are only headers, never bodies. HTTP/1.1 (like 1.0 before it) is a request/response protocol. Sending a response unsolicited is not allowed.
No. In http, one request gets one response. The client must send a second request to get a second response.
A "payload" in HTTP is always a partial or complete representation of some resource. We use separate terms for payload and representation because some messages contain only the associated representation's header fields (e.g., responses to HEAD) or only some part(s) of the representation (e.g., the 206 status code).
With regard to a TCP connection, a single connection can be used for multiple HTTP requests, for example in case several images are being fetched from the same server. However, this still requires a FIFO queue of requests and responses. Thus, browsers prefer separate TCP connections per HTTP request.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With