From 31d6c0e0582a0cf9f1f75b42ea11ce65f82f7245 Mon Sep 17 00:00:00 2001 From: omma Date: Thu, 22 Aug 2024 10:59:40 +0330 Subject: [PATCH] Update ReadMe.md --- ReadMe.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/ReadMe.md b/ReadMe.md index 59bffc1..154ae17 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -14,6 +14,29 @@ POST "password": "" } ``` +**How it works?** + +### To optain the jwt Token for the first time from other services +```python +import requests +url = 'http:///token/' + +credentials = { + "username": "your_username", + "password": "your_password" +} + +response = requests.post(url, data=credentials) +token = response.json().get('access') +``` +Store this token to use in future requests like this: +```python +headers = { + 'Authorization': f'Bearer {token}', +} +response = requests.post('http:///<...>/', headers=headers, json=data_to_send) +``` + ## Well related end-points ### 1. create **URL:**