Demo server for testing / demonstrating Postman. Postman collection with the api endpoints can be downloaded here.
Make sure you have sqlite
installed.
$ git clone https://github.com/prakhar1989/Postman-demo-server.git
$ virtualenv venv
$ source venv/bin/activate
$ pip install -r requirements.txt
$ python setup.py # sets up the database
$ python app.py
* Running on https://127.0.0.1:5000/
* Restarting with reloader
To deploy a flask app I have a blogpost written here which you can follow.
Method | Endpoint | Description | |
---|---|---|---|
1 | GET | {{url}}/blog/posts | Return all blog posts |
2 | DELETE | {{url}}/blog/posts/{{id}} | Delete the existing blog post |
3 | GET | {{url}} | Returns a JSON with all the available API endpoints. |
4 | GET | {{url}}/blog/users/{{user_id}} | Get user details for a user |
5 | GET | {{url}}/blog/posts/{{id}} | Return blog post with that ID |
6 | POST | {{url}}/blog/users/ | Create a new user with the given username and password. |
7 | POST | {{url}}/blog/posts | Create a new blog post |
8 | GET | {{url}}/cookies/delete?name | Similar to httpbin.org/cookies. Delete a cookie. |
9 | GET | {{url}}/delay/10 | Return response after a few seconds |
10 | POST | {{url}}/post | Similar to httpbin.org/post. Return POST data. |
11 | POST | {{url}}/blog/users/tokens/ | POST on this endpoint will create a new token provided the username and password is correct. The returned token will be used to make subsequent requests. |
12 | GET | {{url}}/cookies | Similar to httpbin.org/cookies. Return cookies set in the domain. |
13 | DELETE | {{url}}/blog/users/tokens/{{token_id}} | Delete the token. Effectively signing out the user. |
14 | GET | {{url}}/get | Similar to httpbin.org/get. Return GET data. |
15 | GET | {{url}}/headers | Similar to httpbin.org/headers. Return all the headers passed to it. |
16 | GET | {{url}}/cookies/set?name=value | Similar to httpbin.org/cookies. Set a cookie |
17 | PUT | {{url}}/blog/posts/{{id}} | Modify the existing post |
18 | GET | {{url}}/blog/users/ | Get all current users of the blog. |
19 | GET | {{url}}/status | Return the status of the API with the timestamp. |
HTTPBIN for inspiration