Introducing Swift HTTP Types

We’re excited to announce a new open source package called Swift HTTP Types. Building upon insights from Swift on server, app developers, and the broader Swift community, Swift HTTP Types is designed to provide a shared set of currency types for client/server HTTP operations in Swift.

swift.org/blog/introducing-swift-http-types/

Apple announced Swift HTTP Types, a new open-source package providing shared, Swift-first currency types for HTTP operations, enhancing code sharing between clients and servers.

It includes HTTPRequest and HTTPResponse for modern HTTP versions (HTTP/3, HTTP/2) with compatibility for HTTP/1.1, designed to replace SwiftNIO’s HTTPRequestHead and HTTPResponseHead and Foundation’s URLRequest and URLResponse details.

The API supports ergonomic operations like setting methods, paths, and header fields, with extensions for custom headers, and integrates seamlessly with URLSession for clients and SwiftNIO for servers via the swift-nio-extras package.


Category:

Tag:

Year: