Mock icon indicating copy to clipboard operation
Mock copied to clipboard

How to use mock with REST urls

Open LironEr opened this issue 9 years ago • 2 comments

Hi,

Is there a way to put variables in url without '?' Like: Mock.mock('api/users/@userId, 'PUT', updateUser); '@userId' is variable that I need in the updateUser function

Thanks (:

LironEr avatar Mar 02 '17 14:03 LironEr

I found you can use /api/users/[0-9] as optional url match and get id from body (if you passed it with request). But there should be a better solution to get id directly from url.

CC @nuysoft, @Yakima-Teng, @JounQin, ...

JonasJonny avatar Mar 15 '17 21:03 JonasJonny

同样的问题

zhangqqqf avatar Mar 21 '17 05:03 zhangqqqf