From 4dd365faa4ecbcd201169f36daa0b37fd065159a Mon Sep 17 00:00:00 2001 From: David Nadoba Date: Thu, 11 Nov 2021 15:37:50 +0100 Subject: [PATCH 1/2] state in readme that we support HTTP/2 and how to disable it --- README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 94f700004..bb1f5bc4e 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ This library provides the following: 3. Streaming body download 4. TLS support 5. Cookie parsing (but not storage) +6. Automatic HTTP/2 over HTTPS (since version 1.7.0) --- @@ -216,7 +217,7 @@ httpClient.execute( ).whenComplete (...) ``` -Direct URLs can easily be contructed to be executed in other scenarios: +Direct URLs can easily be constructed to be executed in other scenarios: ```swift let socketPathBasedURL = URL( httpURLWithSocketPath: "/tmp/myServer.socket", @@ -228,6 +229,17 @@ let secureSocketPathBasedURL = URL( ) ``` +### Disabling HTTP/2 +The exclusive use of HTTP/1 is possible by setting `httpVersion` to `.http1Only` on `HTTPClient.Configuration`: +```swift +var configuration = HTTPClient.Configuration() +configuration.httpVersion = .http1Only +let client = HTTPClient( + eventLoopGroupProvider: .createNew, + configuration: configuration +) +``` + ## Security Please have a look at [SECURITY.md](SECURITY.md) for AsyncHTTPClient's security process. From a3d3a0800e2e9405673e64f1da5c90308fe8760f Mon Sep 17 00:00:00 2001 From: David Nadoba Date: Thu, 11 Nov 2021 16:16:59 +0100 Subject: [PATCH 2/2] move HTTP/2 up and use bullet points --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index bb1f5bc4e..1ce470bbc 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,12 @@ This package provides simple HTTP Client library built on top of SwiftNIO. This library provides the following: -1. Asynchronous and non-blocking request methods -2. Simple follow-redirects (cookie headers are dropped) -3. Streaming body download -4. TLS support -5. Cookie parsing (but not storage) -6. Automatic HTTP/2 over HTTPS (since version 1.7.0) +- Asynchronous and non-blocking request methods +- Simple follow-redirects (cookie headers are dropped) +- Streaming body download +- TLS support +- Automatic HTTP/2 over HTTPS (since version 1.7.0) +- Cookie parsing (but not storage) ---