Last active
August 29, 2015 14:20
-
-
Save salmanwahed/131ae771d4c553964709 to your computer and use it in GitHub Desktop.
testing rest api
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [1]: from requests import get, post, put, delete | |
In [2]: get("http://127.0.0.1:5000/api") | |
In [3]: data = {"name": "Example Name", "registration": "123433199", "department": "cse"} | |
In [4]: post("http://127.0.0.1:5000/api", json=data).json() | |
In [5]: put("http://127.0.0.1:5000/api/123433199", json={"website": "www.example.com"}).json() | |
In [6]: delete("http://127.0.0.1:5000/api/123433199").json() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment