问题
I'm using a JsonServiceClient, initialized with the url parameter like:
JsonServiceClient client = new JsonServiceClient("http://dis.dat/whatever/coolService");
client.Post(new MyRequest{ Foo = "bar"});
But when i check for the output url, I can see that the service used a different URL, more precisely
http://dis.dat/whatever/coolService/json/reply/MyRequest
The request type is as simple as
public class MyRequest
{
public string Foo {get; set;}
}
Of course, I would like to prevent this behaviour.
Thanks
回答1:
It seems you should use custom routes:
[Route("/")]
public class MyRequest
{
public string Foo {get; set;}
}
来源:https://stackoverflow.com/questions/31402628/jsonserviceclient-adding-path-to-url