邮差模拟服务器路线参数

时间:2017-09-11 10:36:09

标签: mocking postman routeparams mockserver

使用邮递员模拟服务器时出现问题。它不响应具有路由参数的请求。例如,我的uri看起来像这样:

PUT : {{server_url}}/order/{id}

但是当我以这种方式调用mock服务器时:

{{mock_server}}/order/{id}

{{mock_server}}/order/1 or any other examples 

模拟服务器响应是:

{
"error": {
    "name": "mockRequestNotFoundError",
    "message": "We were unable to find any matching requests for this method type and the mock path, '/fa/order/', in your collection."
}

}

身体可以帮助我吗?

1 个答案:

答案 0 :(得分:2)

您可以将已保存的示例编辑为PUT : {{server_url}}/order/1

然后 PUT {{mock_server}}/order/1PUT {{mock_server}}/order/5PUT {{mock_server}}/order/<any number>应该有效。