Releases: anaisbetts/ModernHttpClient
ModernHttpClient 2.1.0
What's New
OkHttp 2.0 Async (#67)
ModernHttpClient 2.0 now uses the new, fully asynchronous OkHttp 2.0 API. This means that requests will no longer create additional threads and affect app performance.
Server Certificate Validation (#79, #81)
ModernHttpClient now allows you to customize TLS certificate validation via the ServicePointManager
class, including accepting self-signed or invalid certificates. This feature is disabled by default, enable it by passing true
into the NativeMessageHandler
constructor. A huge thanks to @sebfia for the primary work on this!
Other Fixes
- Improved exception handling on iOS (#73, thanks @cleardemon)
ModernHttpClient 2.0.1
What's New
- Fix a dumb mistake in the PLibs facade (#61)
ModernHttpClient 2.0.0
What's New
Built-in Portable Library Support
ModernHttpClient 2.0 now makes it even easier to use inside a portable library (PCL) project. Instead of the workarounds previously listed in the README, you now can just use a new class everywhere:
var httpClient = new HttpClient(new NativeMessageHandler());
On Windows-based platforms, this will still work but be a no-op (i.e. it will use the underlying default HttpMessageHandler).
Download progress
Thanks to @nberardi (#59), ModernHttpClient now makes it easier to track the progress of large downloads:
var handler = new NativeMessageHandler();
var request = new HttpRequestMessage(HttpMethod.Get, url);
handler.RegisterForProgress(request, HandleDownloadProgress);
void HandleDownloadProgress(long bytesInThisChunk, long totalBytesDownloaded, long totalBytesExpected)
{
}
Captive Network Detection
ModernHttpClient now extends Captive Network detection to both iOS and Android, thanks to @molinch (#60). If enabled via the NativeMessageHandler constructor parameter, an exception will be thrown if a request is redirected to a different domain (i.e. if the user is at a coffee shop and is being presented with a "Please Sign In" dialog).
This defaults to false
because there are non-captive network cases where a redirect will send you to a different domain (for example, downloading a file from S3). If you're using HttpClient with a REST API that you know won't redirect you off-domain, this is good to enable.
Bug Fixes
- Handle connection failures and timeouts better (#49, thanks @guillaume-fr)
- Correctly pass through cancellation to more methods (#51, thanks @nberardi)
- Correctly bump the OkHttp version
ModernHttpClient 1.2.2
What's New
Bug Fixes
- Fixed a rare deadlock in NSURLSessionHandler which resulted in HTTP requests never returning (#46, thanks @seed-seifer!)
ModernHttpClient 1.2.1
What's New
OkHttp 1.5.0
This release updates OkHttp to v1.5.0, which adds support to HTTP 2.0 (v9) and SPDY 3.1. This update also fixes a bug related to compatibility between OkHttp and other Java network libraries (#40)
Bug Fixes
- Mark AFNetworkHandler as obsolete (#38, thanks @nberardi)
- Fix a Java exception being incorrectly marshaled (#41, thanks @guillaume-fr)
ModernHttpClient 1.2.0
What's New
AFNetworking is Dead, Long Live NSURLSession
ModernHttpClient now uses NSURLSession on iOS, which provides the same speed benefits as AFNetworking, but without the 1MB dependency. This has the side effect that ModernHttpClient 1.2.0 is now iOS 7+ only. If you need iOS 6.0 support, either fall back to stock HttpClient or stay with the 1.1.0 version of ModernHttpClient.
The AFNetworkHandler
class name is now aliased to NSUrlSessionHandler
, so no code changes need to be made for existing code
Bug Fixes
- Fix handling of Content-Type headers (#29, thanks @ChuckPinkert)
- Add an optional constructor parameter to OkHttpHandler to throw exceptions if you are on a captive network (i.e. the request was redirected to a domain you don't expect ala Airport WiFi)
- Correctly return content response headers (#30)
- Make sure Unknown Host exceptions get thrown as .NET style exceptions on Android (#31, thanks @tpurcell)
- Don't check the wrong content stream on errors on Android (#33, thanks @Cheesebaron)
- Fix race condition on iOS which resulted in NSMutableData being corrupted (#22)
ModernHttpClient 1.1
What's New
ModernHttpClient is now a NuGet package
In addition to binaries distributed via GitHub Releases as well as the Xamarin Component Store, ModernHttpClient is now also available via NuGet for those developing in Visual Studio. Grab the NuGet package here
Bug Fixes
1.0.1
What's New
Bug Fixes
- Return WebException in more cases instead of an unrelated exception on iOS (#13, thanks @SeeD-Seifer!)
- Correct the samples to use the
INTERNET
permission (#16, thanks @pupitetris!)
ModernHttpClient 1.0
What's New
Cancellation and Headers
ModernHttpClient now correctly handles cancellation, closing the underlying connection as soon as possible. To do this fully, you must both supply and cancel a CancellationToken
, and should you receive an HttpResponseMessage
, you must Dispose
the Content
of the message.
Both iOS and Android also now correctly support HttpCompletionOption.ResponseHeadersRead
, meaning that HttpClient will return as soon as headers are available, which means you can cancel a request based on the header content (i.e. if you determine that the request is not actually needed, you can Dispose
the Content
and close the underlying socket connection).
Other Bug Fixes
- Build fixes and Xamarin Component support thanks to @pupitetris!
- For reals support Gingerbread and higher on Android
ModernHttpClient 0.9
What's New
All of the bug fixes:
- Correctly handle content-based request headers (#4, thanks @nberardi)
- Mark Android version as >= Gingerbread-compatible
- Fix bug where HTTP method wasn't getting propagated on Android
- Perf optimization on iOS (#5, thanks @nberardi)
- Throw a more appropriate error when there is no Internet (#8, thanks @SeeD-Seifer)