Код: Выделить всё
import requests
import json
ROOT = "https://myapi.com/"
DATASET_ID = "1632"
LOGIN_NAME = "user"
LOGIN_PASSWORD = "my_paswd"
url = ROOT + f"api/v2/datasets/{DATASET_ID}"
auth = (LOGIN_NAME, LOGIN_PASSWORD)
data = {abstract for metadata}
response = requests.patch(url, auth=auth, json=data)
Код: Выделить всё
import requests
import json
ROOT = "https://myapi.com/"
DATASET_ID = "1632"
LOGIN_NAME = "user"
LOGIN_PASSWORD = "my_paswd"
url = ROOT + f"api/v2/datasets/{DATASET_ID}"
auth = (LOGIN_NAME, LOGIN_PASSWORD)
data = {
"Text abstract for metadata",
"keywords": [{"name": "Keyword1","slug": "keyword1"},{"name": "Keywords2","slug": "keywords2"}],
}
response = requests.patch(url, auth=auth, json=data)
Код: Выделить всё
keywords Errore nella richiesta: 400 {"success":false,"errors":["Invalid value for 'keywords': HierarchicalKeyword object with ID={'name': 'Keywords2', 'slug': 'keywords2'} not found"],"code":"invalid"}
Подробнее здесь: https://stackoverflow.com/questions/792 ... ests-patch