Comments (2)
Hi, now isn't straightforward way to do this. I can provide some interface but I don't know when...
from mock-server.
Hi I add custom_provider command line option so you can now implement custom response provider.
mock-server --dir=/path/to/api/ --custom_provider=/path/provider.py
Your module must have callable (function or custom object with __call__
method) provider attribute. Provider can return Response object or None.
You can see example implementation here:
https://github.com/tomashanacek/mock-server/blob/master/mock_server/tests/provider.py
Request object documentaion: http://tornado.readthedocs.org/en/branch3.1/httpserver.html#httprequest-objects
from mock-server.
Related Issues (20)
- need support custom status code
- I cannot add new api, and get this error message HOT 2
- mock-server not accepting file put request
- HTML response doesn't seem to work HOT 3
- Cannot access service by IP (localhost or 127.0.0.1 works) HOT 6
- There's a typo in the default response
- HTTPHeaders object is not JSON serializable (tornado 4.3) HOT 6
- Response codes triggered by url params HOT 1
- Creating mock meets server 's 500 error HOT 7
- not able to install using "easy_install mock-server" throwing error HOT 4
- SSL client certificate support? HOT 1
- error HOT 2
- http://localhost:8888/__manager/list_resource.html HOT 1
- Returning 500 server error HOT 3
- mock-server doesn't work on Windows: it's not a command when I run "mock-server --dir" HOT 2
- Create resource method
- Error: NameError: name 'unicode' is not defined HOT 6
- No longer installs [for python3.9] HOT 3
- Dependency clash
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mock-server.