我想更新Sharepoint项中的某些属性。
我正在使用以下代码:
body = '{"__metadata": {"type": "SP.Data.Documentos_x0020_compartidosItem"}, "Tarea": "TP 15"}'
header = {'Authorization': 'Bearer ' + bearer + '', 'Accept': 'application/json;odata=verbose', 'X-HTTP-Method':'MERGE','content-type': 'application/json', 'IF-MATCH'
: '*'}
然后我打电话:
import requests
requests.post("https://[sharepoint URL]/_api/web/lists/GetByTitle('Documentos')/items(232)",json=body,headers=header).json()
但是我总是得到相同的答案:
{'error': {'code': '-1, '
'Microsoft.SharePoint.Client.InvalidClientQueryException',
'message': {'lang': 'es-ES',
'value': "Se encontró un nodo 'PrimitiveValue' "
'inesperado al leer del lector JSON. Se '
"esperaba un nodo 'StartObject'."}}}
有人可以给我关于这个问题的任何线索吗?
感谢和亲切问候