Skip to content

Commit

Permalink
Update api.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
kingmalza committed Jan 26, 2019
1 parent df62e2a commit b7138e5
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,21 @@ Using the link in the main menu "**Schema API**" it will be possible to display

.. code-block:: python
def test():
print('Ciao')
import requests
# api-endpoint
URL = "http://demo.myaida.io/temp_mainapi/"
# param defined here
user_name = "demo"
pass = "xxxxxxx"
# defining a params dict for the parameters to be sent to the API
PARAMS = {'username':user_name, 'password':pass}
# sending get request and saving the response as response object
r = requests.get(url = URL, params = PARAMS)
# extracting data in json format
data = r.json()

0 comments on commit b7138e5

Please sign in to comment.