I have a folder in sharepoint. I wanted to move a file from one folder to another.
As per documentation, my trial was like below.
headers = {"Authorization" : "Barer" + Token,
'Accept': 'application/json;odata=nometadata',
'Content-Type': 'application/json;odata=verbose',
'X-HTTP-Method': "POST",
'X-RequestForceAuthentication': 'true'
}
url = "https://sharepointDomain/sites/<app_name>/_api/web/getFileByServerRelativeUrl('/sites/SourceFoldername/test.xlsx')/moveto(newurl=/sites/DestinationFolderName/Test.xlsx',flags=1)?@target=sharepointDomain"
response = request.post(url, headers = headers)
print(response)
And the response I get is
The HTTP method 'GET' cannot be used to access the resource 'moveto'. The operation type of the resource is specified as 'Default'
Thanks in advance.