dreamhead / moco

Easy Setup Stub Server
MIT License
4.36k stars 1.08k forks source link

HTTP协议下,支持相同Path,根据请求体来区分规则吗? #287

Open waitshang opened 3 years ago

waitshang commented 3 years ago

请求1:

<xml>
    <write>
        <str>write</str>
    </write>
</xml>

请求2:

<xml>
    <read>
        <str>read</str>
    </read>
</xml>

他们都请求/path/demo

dreamhead commented 3 years ago

Yes, you can do this.

Refer to Moco composite API design

liangguohao66 commented 7 months ago

能不能通过config.json配置实现?post请求不同参数,返回不同response

dreamhead commented 7 months ago

@liangguohao66 You can match different parameters.

Refer to API document: https://github.com/dreamhead/moco/blob/master/moco-doc/apis.md

liangguohao66 commented 7 months ago

@liangguohao66 You can match different parameters.

Refer to API document: https://github.com/dreamhead/moco/blob/master/moco-doc/apis.md

我的请求json是嵌套的,没找到样例啊

liangguohao66 commented 7 months ago

@liangguohao66 You can match different parameters.

Refer to API document: https://github.com/dreamhead/moco/blob/master/moco-doc/apis.md

我的请求json是嵌套的,没找到样例啊

dreamhead commented 7 months ago

@liangguohao66 Try JsonPath

liangguohao66 commented 7 months ago

@liangguohao66 Try JsonPath

it works . Thanks!