Any update on this? Having similar problems in python trying to write a sample file to sharepoint
{'error': {'code': 'BadRequest', 'message': 'Unable to read JSON request payload. Please ensure Content-Type header is set and payload is of valid JSON format.', 'innerError': {'date': '2021-01-27T18:08:43', 'request-id': '13db30a4-9ba1-49de-aa4b-ce97d8ea91bf', 'client-request-id': '13db30a4-9ba1-49de-aa4b-ce97d8ea91bf'}}}
base_url = 'https://graph.microsoft.com/v1.0/'
path = 'sites/mediamathsp.sharepoint.com/drive/items/mmoroch-test/mmoroch-test-2/test.csv:/content'
requests.put(base_url + path,headers=headers, data='{"name":"John","age":31,"city":"New York"}').json()
Out[72]: {'error': {'code': 'invalidRequest', 'message': 'Invalid request', 'innerError': {'date': '2021-01-27T18:31:18', 'request-id': 'f88e9a8e-d8ea-4107-bbfc-83cf35fe3754', 'client-request-id': 'f88e9a8e-d8ea-4107-bbfc-83cf35fe3754'}}}