Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use mock with REST urls #177

Open
LironEr opened this issue Mar 2, 2017 · 2 comments
Open

How to use mock with REST urls #177

LironEr opened this issue Mar 2, 2017 · 2 comments

Comments

@LironEr
Copy link

LironEr commented Mar 2, 2017

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 (:

@JonasJonny
Copy link

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, ...

@zhangqqqf
Copy link

同样的问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants