大家好!尝试使用 OData 协议更改项目时发生错误
这是代码:
def update(entity, guid, data, select=None, username=username, password=password):
url = f'''http://localhost/mc/odata/standard.odata/{entity}(guid'{guid}')'''
headers = dict(Accept='application/json')
response = requests.patch(url, auth=(username, password), headers=headers, data=data)
response.encoding = 'utf-8-sig'
json_response = response.json()
return json_response
update(entity='Catalog_Номенклатура', guid='6831eb5d-4fc9-11ef-a320-000ec6c817c0', data={'Вес': 8}, username='Nick', password='')
这是错误:
{'odata.error': {'code': '-1','message': {'lang': 'ru', 'value': 'Непредвиденный символ при чтении JSON'}}}