what’s the recommended way to do networking for REST API calls
Asked on 08/02/2024
1 search
The recommended way to do networking for REST API calls in the context of Apple's WWDC sessions involves using Swift on the server. Specifically, you can use frameworks like Vapor or Hummingbird to set up your HTTP server and handle REST API calls.
Here are some key points from the sessions:
-
Swift on Server: Swift is highlighted as an excellent choice for writing server applications due to its strong typing, optionals, memory safety, and first-class concurrency features. These properties make Swift services less prone to crashes and security vulnerabilities, and allow for scalable and responsive server applications. (Explore the Swift on Server ecosystem)
-
Vapor Framework: Vapor is a popular framework for building server-side applications in Swift. It can be used to set up an HTTP server, define routes, and handle requests and responses. For example, you can create a Vapor application, register your service, and start the server to listen for incoming connections. (Explore the Swift on Server ecosystem)
-
OpenAPI Generator: The Swift OpenAPI generator can be used to document your service in YAML and generate code for servers and clients. This can help in defining and implementing REST API endpoints. (Explore the Swift on Server ecosystem)
-
Webhooks: For integrating with other services and tools, you can use webhooks. Xcode Cloud, for instance, allows you to set up webhooks to respond to build events and automate deployments. (Extend your Xcode Cloud workflows)
Relevant Sessions
These sessions provide a comprehensive overview of how to set up and manage REST API calls using Swift on the server.

A Swift Tour: Explore Swift’s features and design
Learn the essential features and design philosophy of the Swift programming language. We’ll explore how to model data, handle errors, use protocols, write concurrent code, and more while building up a Swift package that has a library, an HTTP server, and a command line client. Whether you’re just beginning your Swift journey or have been with us from the start, this talk will help you get the most out of the language.

Extend your Xcode Cloud workflows
Discover how Xcode Cloud can adapt to your development needs. We’ll show you how to streamline your workflows, automate testing and distribution with start conditions, custom aliases, custom scripts, webhooks, and the App Store Connect API.

What’s new in privacy
At Apple, we believe privacy is a fundamental human right. Learn about new and improved permission flows and other features that manage data in a privacy-preserving way, so that you can focus on creating great app experiences.