我在api网址下方
http://myapi/api/getproduct?
这些参数将从下面的类中创建
public class ApiParamters
{
public string id {get;set;}
public string name {get;set;}
public List<string> otherNames {get;set;}
}
如果上述参数的值是
id=1
name="product1"
OtherNames="oldProduct1" and "oldProduct2"
然后api网址应如下
http://myapi/api/getproduct?id=1&name=product1&OtherNames=oldProduct1&OtherNames=oldProduct2
如何动态创建此类url(一般解决方案是必需的,因为我也必须为其他API实现类似的逻辑)