Skip to content
This repository has been archived by the owner on Nov 19, 2023. It is now read-only.

A simple service extension using AsyncHTTPClient as a HTTP client for Hummingbird.

Notifications You must be signed in to change notification settings

BinaryBirds/hummingbird-http-client

Repository files navigation

Hummingbird HTTP Client

A simple service extension using AsyncHTTPClient as a HTTP client for Hummingbird.

Getting started

Adding the dependency

Add the following entry in your Package.swift to start using HummingbirdHTTPClient:

.package(url: "https://github.com/feathercms/hummingbird-http-client", from: "1.0.0"),

and HummingbirdHTTPClient dependency to your target:

.product(name: "HummingbirdHTTPClient", package: "hummingbird-http-client"),

Example

Simple usage

import Hummingbird
import HummingbirdHTTPClient

let app = HBApplication()
app.services.httpClient = .init(
    eventLoopGroupProvider: .shared(app.eventLoopGroup)
)

let res = try await app.httpClient.execute(
    .init(url: "https://jsonserver.binarybirds.com/api/v1/posts/")
)

// process response

try app.shutdownApplication()

About

A simple service extension using AsyncHTTPClient as a HTTP client for Hummingbird.

Resources

Stars

Watchers

Forks

Releases

No releases published