22This package provides simple HTTP Client library built on top of SwiftNIO.
33
44This library provides the following:
5- 1 . Asynchronous and non-blocking request methods
6- 2 . Simple follow-redirects (cookie headers are dropped)
7- 3 . Streaming body download
8- 4 . TLS support
9- 5 . Cookie parsing (but not storage)
5+ - Asynchronous and non-blocking request methods
6+ - Simple follow-redirects (cookie headers are dropped)
7+ - Streaming body download
8+ - TLS support
9+ - Automatic HTTP/2 over HTTPS (since version 1.7.0)
10+ - Cookie parsing (but not storage)
1011
1112---
1213
@@ -216,7 +217,7 @@ httpClient.execute(
216217).whenComplete (... )
217218```
218219
219- Direct URLs can easily be contructed to be executed in other scenarios:
220+ Direct URLs can easily be constructed to be executed in other scenarios:
220221``` swift
221222let socketPathBasedURL = URL (
222223 httpURLWithSocketPath : " /tmp/myServer.socket" ,
@@ -228,6 +229,17 @@ let secureSocketPathBasedURL = URL(
228229)
229230```
230231
232+ ### Disabling HTTP/2
233+ The exclusive use of HTTP/1 is possible by setting ` httpVersion ` to ` .http1Only ` on ` HTTPClient.Configuration ` :
234+ ``` swift
235+ var configuration = HTTPClient.Configuration ()
236+ configuration.httpVersion = .http1Only
237+ let client = HTTPClient (
238+ eventLoopGroupProvider : .createNew ,
239+ configuration : configuration
240+ )
241+ ```
242+
231243## Security
232244
233245Please have a look at [ SECURITY.md] ( SECURITY.md ) for AsyncHTTPClient's security process.
0 commit comments