我使用C#库Refit自动创建REST客户端。 我的api客户端具有以下界面:
public interface IMyApi
{
[Head("/content/{someRouteParam}")]
Task<string> SomeMethod(string someRouteParam);
}
'SomeMethod'具有字符串参数someRouteParameter
,如果它具有类似':'的符号,则将对其进行编码。但我想避免对该参数进行编码。
例如,我具有以下route参数:first:second
而且我希望url为https://somehost.com/content/first:second
但是我得到了诸如https://somehost.com/content/first%3Asecond
之类的网址。
是否可以禁止为改装客户端编码路径参数?预先谢谢你