You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AndroidClientHandler: Return 308 response code to client instead of throwing exception #4477
Configure the library to use the AndroidClientHandler instead of the default HttpClientHandler by subclassing HttpClientFactory
Uploade file with resumable upload
In some cases Google Drive returns error code 308 Resume Incomplete (which is usually 308 Permanent Redirect) to indicate that an incomplete upload has stalled
System.InvalidOperationException: HTTP Redirection status code PermanentRedirect (308) not supported
at Xamarin.Android.Net.AndroidClientHandler.HandleRedirect (System.Net.HttpStatusCode redirectCode, Java.Net.HttpURLConnection httpConnection, Xamarin.Android.Net.AndroidClientHandler+RequestRedirectionState redirectState, System.Boolean& disposeRet) <0x7237a0dc20 + 0x00384> in <6071f7bd4f0c4adf848cbcbba2dc27fe>:0
at Xamarin.Android.Net.AndroidClientHandler.DoProcessRequest (System.Net.Http.HttpRequestMessage request, Java.Net.URL javaUrl, Java.Net.HttpURLConnection httpConnection, System.Threading.CancellationToken cancellationToken, Xamarin.Android.Net.AndroidClientHandler+RequestRedirectionState redirectState) [0x00552] in <6071f7bd4f0c4adf848cbcbba2dc27fe>:0
at Xamarin.Android.Net.AndroidClientHandler.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) <0x7237a0fe7c + 0x00657> in <6071f7bd4f0c4adf848cbcbba2dc27fe>:0
at Google.Apis.Http.ConfigurableMessageHandler.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) [0x00681] in <5c06fc9cf97c400ea14364d81accc883>:0
at System.Net.Http.HttpClient.FinishSendAsyncBuffered (System.Threading.Tasks.Task`1[TResult] sendTask, System.Net.Http.HttpRequestMessage request, System.Threading.CancellationTokenSource cts, System.Boolean disposeCts) [0x0017e] in <ea2d1c6f7b4d4daba354b37d249494a8>:0
at Google.Apis.Upload.ResumableUpload.SendNextChunkAsync (System.IO.Stream stream, System.Threading.CancellationToken cancellationToken) <0x723524b2fc + 0x0051f> in <089d88fa5ccb4f7abc33a244904740b6>:0
I also reported this problem here but I feel like this problem likely has to be taken care of on the Xamarin-side, possible in the same switch-case as already been done for response code 304 here
With support for Classic Xamarin.Android ended May 1st, 2024, this issue is likely no longer relevant.
If this still persists in .NET 8+, please open a new issue with updated information based on net8.0-android or greater. Please include a link to this issue for context.
Activity
tarvy commentedon Oct 7, 2021
Any word on when this change will be made?
Having the 308 return a system exception is pretty troublesome.
jpobst commentedon May 13, 2024
With support for Classic Xamarin.Android ended May 1st, 2024, this issue is likely no longer relevant.
If this still persists in .NET 8+, please open a new issue with updated information based on
net8.0-androidor greater. Please include a link to this issue for context.