Chapter 6. Swift Client Libraries
The previous chapter introduced the Swift HTTP API, and demonstrated how it can be used with low-level HTTP tools such as cURL. Introducing the API with examples in cURL highlighted the key pieces of information that are exchanged (such as auth credentials and tokens), and how they map to the underlying wire protocol, particularly with the use of HTTP headers. But pragmatically, using cURL for extended Swift sessions can get tedious and repetitive. Although cURL is commonly used to run quick experiments against a Swift cluster, for more extended uses we tend to turn to client libraries in our language of choice. Fortunately, Swift works with a wide array of open source libraries and languages.
This chapter offers an overview of some of the open source client libraries that have been developed for Swift. Although we’ll draw most of our examples from Python—the language in which Swift is written—there are strong similarities across Swift client libraries. This means you’ll also gain insights into how to use client libraries beyond Python.
Client Libraries
Open source client libraries have been developed for Swift in many languages, including Python, Ruby, PHP, C#/.NET, Java, and others. By looking at the HTTP communication in the previous chapter, we’ve seen what information these libraries need to:
- Send auth credentials for an auth request
- Receive an auth token (and the storage URL for the primary account) for an auth response
- Send the auth ...
Get OpenStack Swift now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.