/
yeskteck
/
smartsupport_live_coding
Обзор
Документация
Войти
/
yeskteck
/
smartsupport_live_coding
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
test_service.py
27 строк
669 B
Ivan Anufriev
test task
25 июл 2025, 00:11
25 июл 2025, 00:11
4e81e98
Код
Авторство
О чём код?
# Если удобнее курлом # curl -X POST http://localhost:8080/embed_and_save -H "Content-Type: application/json" -d '{"texts":["текст 1", "текст 2"]}' # curl -X POST http://localhost:8080/embed_and_save -H "Content-Type: application/json" -d '{"texts": "error"}' import requests import json URL = "http://localhost:8080/embed_and_save" print('Test case 1') res = requests.post( URL, json={'texts': ["текст 1", "текст 2"]} ) print(res.status_code) print(json.loads(res.content)) print('Test case 2') res = requests.post( URL, json={'texts': "текст 3"} ) print(res.status_code) print(json.loads(res.content))