JsonServiceClient adding path to url

ε祈祈猫儿з 提交于 2019-12-25 02:58:37

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!