Files
Rick Newton-Rogers c621142327 Adopt GitHub actions (#780)
Migrate CI to use GitHub Actions.

### Motivation:

To migrate to GitHub actions and centralised infrastructure.

### Modifications:

Changes of note:
* Adopt swift-format using rules from SwiftNIO.
* Remove scripts and docker files which are no longer needed.
* Disabled warnings-as-errors on Swift 6.0 CI pipelines for now.

### Result:

Feature parity with old CI.
2024-10-29 15:01:46 +00:00
..
2024-10-29 15:01:46 +00:00
2024-10-29 15:01:46 +00:00
2024-10-29 15:01:46 +00:00
2022-02-10 10:05:13 +01:00

Examples

This folder includes a couple of Examples for AsyncHTTPClient. You can run them by opening the Package.swift in this folder through Xcode. In Xcode you can then select the scheme for the example you want run e.g. GetHTML.

You can also run the examples from the command line by executing the follow command in this folder:

swift run GetHTML

To run other examples you can just replace GetHTML with the name of the example you want to run.

GetHTML

This examples sends a HTTP GET request to https://apple.com/ and first awaits and prints the HTTP Response Head. Afterwards it buffers the full response body in memory and prints the response as a String.

GetJSON

This examples sends a HTTP GET request to https://xkcd.com/info.0.json and first awaits and prints the HTTP Response Head. Afterwards it buffers the full response body in memory, decodes the buffer using a JSONDecoder and dumps the decoded response.

StreamingByteCounter

This examples sends a HTTP GET request to https://apple.com/ and first awaits and prints the HTTP Response Head. Afterwards it asynchronously iterates over all body fragments, counts the received bytes and prints a progress indicator (if the server send a content-length header). At the end the total received bytes are printed. Note that we drop all received fragment and therefore do not buffer the whole response body in-memory.