DeleteFileAsync doesn't work on hololens
I test this function but it doesn't work : Task deleteTask = new Task( async () => {
await portal.DeleteFileAsync("Documents", "test.txt");
Debug.Log("delete finished!");
});
deleteTask.Start();
Hello,
After experiencing the same problem (on a project aiming for file transfer on hololens) I noticed that the request sent to the device wasn't including authorization headers (401 error). Further investigations made me notice that POST request has the same issue, but when my client receive the error message, it sends again the request including authorization headers.
In order to bypass this problem, I had to add the following code line in RestDelete.cs before calling "DeleteAsync".
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue( "Basic", Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes(string.Format("{0}:{1}",this.deviceConnection.Credentials.UserName,this.deviceConnection.Credentials.Password))));
Having the same problem! Trying to figure out a better solution, anyone know why the header isn't included?