Mock
Mock copied to clipboard
How to use mock with REST urls
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 (:
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, ...
同样的问题