There seems to be so many ways to do this, I have tried a number of them this seems to get the closest to working. Countless you tube videos, there always seems to be a piece missing in the solutions.
I get this error on create file to SharePoint. "The URL '' is invalid. It may refer to a nonexistent file or folder, or refer to a valid file or folder that is not in the current Web.clientRequestId: 531e99e5-f762-4ba2-be16-31739ad9135fserviceRequestId: 531e99e5-f762-4ba2-be16-31739ad9135f"
{ "status": 400,
"message": "The URL '' is invalid. It may refer to a nonexistent file or folder, or refer to a valid file or folder that is not in the current Web.\r\nclientRequestId: 531e99e5-f762-4ba2-be16-31739ad9135f\r\nserviceRequestId: 531e99e5-f762-4ba2-be16-31739ad9135f"}
The site is valid the folder is there.