2
2
This package provides simple HTTP Client library built on top of SwiftNIO.
3
3
4
4
This 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)
10
11
11
12
---
12
13
@@ -216,7 +217,7 @@ httpClient.execute(
216
217
).whenComplete (... )
217
218
```
218
219
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:
220
221
``` swift
221
222
let socketPathBasedURL = URL (
222
223
httpURLWithSocketPath : " /tmp/myServer.socket" ,
@@ -228,6 +229,17 @@ let secureSocketPathBasedURL = URL(
228
229
)
229
230
```
230
231
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
+
231
243
## Security
232
244
233
245
Please have a look at [ SECURITY.md] ( SECURITY.md ) for AsyncHTTPClient's security process.
0 commit comments