C# JsonServiceClient向url添加路径
我使用的是一个JsonServiceClient,使用url参数初始化,如下所示:C# JsonServiceClient向url添加路径,c#,
servicestack,C#,
servicestack,我使用的是一个JsonServiceClient,使用url参数初始化,如下所示: JsonServiceClient client = new JsonServiceClient("http://dis.dat/whatever/coolService"); client.Post(new MyRequest{ Foo = "bar"}); 但当我检查输出url时,我可以看到服务使用了不同的url,更准确地说 http://dis.dat/whatever/coolServ
JsonServiceClient client = new JsonServiceClient("http://dis.dat/whatever/coolService");
client.Post(new MyRequest{ Foo = "bar"});
但当我检查输出url时,我可以看到服务使用了不同的url,更准确地说
http://dis.dat/whatever/coolService/json/reply/MyRequest
请求类型非常简单
public class MyRequest
{
public string Foo {get; set;}
}
当然,我想阻止这种行为
谢谢您似乎应该使用:
工作出色。我不知道这也适用于即将离职的职位
[Route("/")]
public class MyRequest
{
public string Foo {get; set;}
}