小编Vin*_*ira的帖子

Refit - 使用 refit 参数(字符串)作为控制器参数传递

有没有办法使用Refit动态输入参数?

我的 Refit 界面中有以下代码:

      [Get("/click?{parm}")]
      Task<ApiResponse<TAny>> SaveClick(string parm);
Run Code Online (Sandbox Code Playgroud)

parm 的值为:

        "id=1234&x=567"
Run Code Online (Sandbox Code Playgroud)

我的路线:

        [HttpGet]
        [Route("click")]
        public  void test ([FromQuery] string id)
        {
            Ok("Ok");
        }
Run Code Online (Sandbox Code Playgroud)

我得到的只是 id 参数的值为空。预期结果将是一个值为“ 1234 ”的字符串

有什么帮助吗:D?

c# refit asp.net-core

6
推荐指数
1
解决办法
1万
查看次数

标签 统计

asp.net-core ×1

c# ×1

refit ×1