diff --git a/README.md b/README.md index 4a768bf..ff02fce 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ | 03.10.2024 | [MLFlow - практика](./assets/mlflow/research.ipynb) | | 10.10.2024 | [Feature engineering](./lectures/lec6-feature_engineering.odp) - [в формате pptx](./lectures/lec6-feature_engineering.pptx) - код в [ноутбуке к mlflow](./assets/mlflow/research.ipynb) | | 17.10.2024 | [Feature extraction. Настройка гиперпараметров](./lectures/lec7-feature_selection_hyperparams.odp) - [в формате pptx](./lectures/lec7-feature_selection_hyperparams.pptx) - код в [ноутбуке к mlflow](./assets/mlflow/research.ipynb) | +| 24.10.2024 | [Архитекура сервиса. API](./lectures/lec8-api.odp) - [в формате pptx](./lectures/lec8-api.pptx) | ## Перенос занятий diff --git a/assets/api/http_req.py b/assets/api/http_req.py new file mode 100644 index 0000000..e124ac3 --- /dev/null +++ b/assets/api/http_req.py @@ -0,0 +1,45 @@ +import requests + +# GET +payload = {'key1': 'value1', 'key2': 'value2'} +response = requests.get( + 'https://api.github.com/', + params=payload +) + +print("Status Code", response.status_code) +print("Response content ", response.text) + +# POST +payload = { + "id": 1001, + "name": "geek", + "passion": "coding", +} + +response = requests.post( + 'https://httpbin.org/post', + json=payload) + +print("Status Code", response.status_code) +print("JSON Response ", response.json()) + + +# DELETE not allowed + + +# POST +payload = { + "id": 1001, + "name": "geek", + "passion": "coding", +} + +response = requests.delete( + 'https://httpbin.org/post', + json=payload) + +print("Status Code", response.status_code) +print("JSON Response ", response.json()) + + diff --git a/lectures/lec8-api.odp b/lectures/lec8-api.odp new file mode 100644 index 0000000..a4e8713 Binary files /dev/null and b/lectures/lec8-api.odp differ diff --git a/lectures/lec8-api.pptx b/lectures/lec8-api.pptx new file mode 100644 index 0000000..2eedd32 Binary files /dev/null and b/lectures/lec8-api.pptx differ