You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are currently building a suite of applications using the microservice design-pattern. One of our big pain-points and a frequent source of errors is building the URLs to access resources on other microservices.
Desired Solution
ASP.NET Core route templates would offer a powerful and well-known syntax for generating URLs. I would like to have a simple solution for creating URLs from route templates and be able to use them together with HttpClient for accessing ASP.NET Core APIs. This could look like:
My preferred solution would be to have a Microsoft.Extensions.* package that contains the route template logic, including URL matching and generating.
Alternatives
LinkGenerator already has similar capabilities but it is designed to work for the Web-API being served and not for different Web-API being accessed via HTTP.
It is quite simple to build a custom implementation of this using TemplateParser and TemplateBinderbut those types require "pubternal" types (e.g. UriBuildingContext), which means the custom implementation could break at any time.
The text was updated successfully, but these errors were encountered:
Eilon
added
the
area-mvc
Includes: MVC, Actions and Controllers, Localization, CORS, most templates
label
Feb 14, 2019
@koenigst rather than manually constructing URLs manually, you should consider generating a client based on the swagger document of your service and then just calling methods passing proper parameters to them. This is an area we're making active improvements and things will get even simpler in the near future: #4896
Issue
We are currently building a suite of applications using the microservice design-pattern. One of our big pain-points and a frequent source of errors is building the URLs to access resources on other microservices.
Desired Solution
ASP.NET Core route templates would offer a powerful and well-known syntax for generating URLs. I would like to have a simple solution for creating URLs from route templates and be able to use them together with
HttpClient
for accessing ASP.NET Core APIs. This could look like:My preferred solution would be to have a
Microsoft.Extensions.*
package that contains the route template logic, including URL matching and generating.Alternatives
LinkGenerator
already has similar capabilities but it is designed to work for the Web-API being served and not for different Web-API being accessed via HTTP.TemplateParser
andTemplateBinder
but those types require "pubternal" types (e.g.UriBuildingContext
), which means the custom implementation could break at any time.The text was updated successfully, but these errors were encountered: