WebDavClient: Java.Net.ProtocolException when using AndroidClientHandler: PROPFIND (and others) unsupported
I am using this library in my multi-platform Xamarin app and attempt to use the native HttpClientHandler on each platform (Windows -> HttpClientHandler, iOS -> NSUrlSessionHandler, Android -> AndroidClientHandler).
In the case of Android:
var httpHandler = new AndroidClientHandler() { AutomaticDecompression = DecompressionMethods.Deflate | DecompressionMethods.GZip };
httpHandler.Credentials = new NetworkCredential(credentials.Username, credentials.Password);
var client = new WebDavClient(new HttpClient(httpHandler, true) { BaseAddress = new Uri(credentials.URL) });
Unfortunately, this causes the following exception when using the WebDavClient:
Java.Net.ProtocolException: Expected one of [OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, PATCH] but was PROPFIND
A few possible solutions/workarounds are mentioned here: https://stackoverflow.com/questions/25163131/httpurlconnection-invalid-http-method-patch (X-HTTP-Method-Override, Reflection, …)
I understand that this is not a bug in your library, but maybe you are interested in adding a workaround anyways…
About this issue
- Original URL
- State: open
- Created 6 years ago
- Comments: 21 (1 by maintainers)
@cesarchefinho
The issue has also been discussed here
I am in the same situation, the AndroidClientHandler is not working with PROPFIND and the HttpClientHandler is not working with some certificates. So it is not possible to use this library to access some servers.