Update ReadMe.md
This commit is contained in:
parent
7ef4bda603
commit
31d6c0e058
1 changed files with 23 additions and 0 deletions
23
ReadMe.md
23
ReadMe.md
|
@ -14,6 +14,29 @@ POST
|
|||
"password": "<password>"
|
||||
}
|
||||
```
|
||||
**How it works?**
|
||||
|
||||
### To optain the jwt Token for the first time from other services
|
||||
```python
|
||||
import requests
|
||||
url = 'http://<well_service_url>/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://<well_service_url>/<...>/', headers=headers, json=data_to_send)
|
||||
```
|
||||
|
||||
## Well related end-points
|
||||
### 1. create
|
||||
**URL:**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue