dreamhead / moco

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

如果使用match()匹配器? #250

Open hiiloveyou opened 5 years ago

hiiloveyou commented 5 years ago

我在使用文件或者json的方式作为request中请求参数的时候,由于代码中请求参数部分有变动,我只想要匹配文件中不变参数的部分,请问match()匹配器支持这样的功能吗,能否增加相应的例子,文档内容很少,不知道该怎么去使用

dreamhead commented 5 years ago

match supports Java regex and you can read Java api for more details.

hiiloveyou commented 5 years ago

请问match在file中使用的时候匹配的是文件名吗?如果我想要匹配文件中的内容,应该怎么去做? 如 [ { "request": { "uri": "/xml", "file": { "match": "your_file.xml" } }, "response": { "text": "foo" } } ] 我需要匹配your_file.xml中的内容