what’s the recommended way to do networking for REST API calls
Generated on 8/2/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.
What’s new in Swift
Join us for an update on Swift. We’ll briefly go through a history of Swift over the past decade, and show you how the community has grown through workgroups, expanded the package ecosystem, and increased platform support. We’ll introduce you to a new language mode that achieves data-race safety by default, and a language subset that lets you run Swift on highly constrained systems. We’ll also explore some language updates including noncopyable types, typed throws, and improved C++ interoperability.
Explore the Swift on Server ecosystem
Swift is a great language for writing your server applications, and powers critical services across Apple’s cloud products. We’ll explore tooling, delve into the Swift server package ecosystem, and demonstrate how to interact with databases and add observability to applications.
Broadcast updates to your Live Activities
With broadcast push notifications, your app can send updates to thousands of Live Activities with a single request. We’ll discover how broadcast push notifications work between an app, a server, and the Apple Push Notification service, then we’ll walk through best practices for this capability and how to implement it.