.NET Core (2.1) web API controller accepting all that follows within the request url as parameter
Clash Royale CLAN TAG #URR8PPP .NET Core (2.1) web API controller accepting all that follows within the request url as parameter What I have is a .NET Core 2.1 web API controller (in the following the TestController) that should generate redirects to other urls when receiving GET requests. Example: The controller is called like: http://localhost/api/v1/Test/somedir/somesubdir/filename.extension and it should return a redirect to https://example-domain.com/somedir/somesubdir/filename.extension My example controller for this question looks like: [Authorize] [Route("api/v1/[controller]")] public class TestController : ControllerBase { [HttpGet("{path}")] public async Task<IActionResult> Get(string path) { //path e.g. is somedir/somesubdir/filename.extension string prefix = "https://example-domain.com/api/v1/Other/"; //string path2 = HttpContext.Request.Path.Value.Replace("/api/v1/Test/", "/api/v1/Othe...