ASP.NET,如何将URL作为URL参数传递

我是ASP Net的新手,在将URL作为简单参数传递时遇到了一些麻烦。 这些是我尝试过的解决方案:

     [ApiController]
[Route("api/[controller]")]
public class LoginRedditController : ControllerBase
{        
    [HttpGet("{*longUrl}")]
    public ActionResult<string> Get(string longUrl)
    {
        Console.WriteLine(longUrl);
        return "OK";
    }
}

这是我尝试调用的URL:

http://localhost:5001/LoginReddit?longUrl=https://www.reddit.com/r/playmygame/comments/glftsj/stickn_roll_collect_everything_as_you_roll/

我也尝试对URL进行编码,但结果是相同的:我得到了“ ERR_EMPTY_RESPONSE” 这是我的第二次尝试:

    [ApiController]
[Route("api/[controller]")]
public class LoginRedditController : ControllerBase
{        
    [HttpGet]
    public ActionResult<string> Get([FromQuery]string url)
    {
       Console.WriteLine(longUrl);
       return "OK";
    }
}

我使用了以前使用的相同URL,但得到了相同结果。

在我尝试的尝试中,我像这样更改了路线:

    [Route("api/[controller]/{url}")]
    public class LoginRedditController : ControllerBase
{        
    [HttpGet]
    public ActionResult<string> Get([FromQuery]string url)
    {
        Console.WriteLine(longUrl);
        return "OK";      
    }
}

我尝试使用以下网址:

http://localhost:5001/LoginReddit/https://www.reddit.com/r/playmygame/comments/glftsj/stickn_roll_collect_everything_as_you_roll/

也编码,但我得到了相同的结果。

有问题的人在哪里?