Xamarin.Forms problems sending large picture over HttpClient SendAsync in Json format
Date : March 29 2020, 07:55 AM
help you fix your problem from my Xamarin.Forms app I'm sending a picture and other fields to the server using HttpClient in Json format. If I send a little picture I've got with my front camera it's working fine, if I send a larger picture I've got with the rear camera it doesn't work and I always get an exception: "Excepional error". , From the stacktrace, try
{
}
catch(WebException ex){
}
((HttpWebResponse)e.Response).StatusDescription
<configuration>
<system.web>
<httpRuntime maxRequestLength="50000" />
</system.web>
</configuration>
|
Xamarin Forms HttpClient GetAsync
Tag : chash , By : UnKnownUser
Date : March 29 2020, 07:55 AM
it should still fix some issue I have had this exact problem, and it is being caused by a deadlock, How are you calling this method? usually I go: Device.BeginInvokeInMainThread(async () =>
{
var categoriesList = await GetCategories();
});
|
HttpClient using Xamarin Forms
Tag : chash , By : Chris Lomax
Date : March 29 2020, 07:55 AM
I hope this helps you . Ok! So this was solved by doing the following: Upgrade to latest version of Xamarin forms. Get rid of ModernHttpClient as it is not required any more due to point # 3. The functionality of ModernHttpClient (i.e Native SSL/Tls) is now built into Xamarin and can now be configured at the platform level as per below links:
|
First try at HTTPClient in Xamarin.Forms not working
Date : March 29 2020, 07:55 AM
hop of those help? Calling asynchronous method from constructor is not a good idea. This will work in console applications but not on UI applications. Because this will block the UI thread, and control never returns to the code due to deadlock. If you can call your async method in OnAppearing, it should work fine.
|
Xamarin Forms: singleton or new HttpClient
Date : March 29 2020, 07:55 AM
|