Skip to content

[HTTP2] State in README that we support HTTP/2 #475

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +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)
- 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)

---

Expand Down Expand Up @@ -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",
Expand All @@ -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.