Is there a way to execute a batch request in the Asp.net core?

We have an API built using ASP.Net Core, and we would like to combine several requests into one HTTP request for performance reasons.

In previous versions of asp.net, you could allow batch requests through the DefaultHttpBatchHandler .

Unfortunately, such a thing does not exist in Asp.net Core.

Does anyone know of any way to make HTTP packets in the kernel?

+7
c # asp.net-mvc asp.net-core
source share
2 answers

After my research on this issue, it is quite simple to implement. However, I think this should be supported by the official asp.net core team.

It seems to me that middleware is required that creates several RouteContext according to the entered text and just calls their handlers - and changes in their response. this can be a little more complicated because it will require multiple response support for the HttpContext (as far as I know, it looks like it will be shared between controllers).

In any case, there is an open issue in the official repository that I raised from the dead, hoping that it will move things along. I can work on the implementation in the future if there are no changes soon.

Update

It seems that the asp.net team responded to the request and created a new issue that is installed on the 2.0 milestones, so I assume this feature will be available during the release of asp.net 2.0.

+6
source share

Not sure what I understand? Do you mean 1 exposed endpoint that makes several calls?

Can you not have 1 API action that simply creates several Tasks (which will be executed in parallel), waits for them to complete, and then returns all the response data (combined or divided as necessary)?

+3
source share

All Articles