Raj*_*Raj 3 c# asp.net-core-mvc asp.net-core
有谁知道如何传递URL作为查询字符串参数,然后在HttpGet方法中获取URl作为参数?
非常感谢所有答案.最后我把它分类了.请参阅下面的我的修复:
[Route("api/[controller]")]
public class UrlController : Controller
{
[HttpGet("{*longUrl}")]
public string ShortUrl(string longUrl)
{
var test = longUrl + Request.QueryString;
return JsonConvert.SerializeObject(GetUrlToken(test));
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4137 次 |
| 最近记录: |