If you’re familiar with the command-line tool curl, you may wonder how to use curl in Xojo effectively. Curl is a powerful tool for making HTTP requests, but it’s not always the most convenient for working within a graphical application like Xojo. That’s where Xojo’s URLConnection class shines! It provides a simple and elegant way to make HTTP requests directly from your Xojo code, making it easy to use curl in Xojo. In this article, you will learn how to adapt common curl commands to Xojo’s URLConnection. Let’s get started.
Comments closedTag: CURL
Recently, I was asked by a client if it would be possible to build language translation functionality into a Xojo-based middleware solution that I had developed for them. The Xojo app obtains product information (including product names, descriptions, and other marketing-related information) from suppliers via a SOAP call, and returns the data in a JSON-encoded response. They wanted to be able to translate the product information, which is provided in English, to other languages (such as French, German, etc). The client wanted something similar to Google Translate. However, they wanted the translation function to be built directly into the app and to be performed “on demand.”
I did some research and found that Amazon provides a service that does exactly what the client was asking for. The service, called Amazon Translate, is available as one of many services that are available through Amazon Web Services.
In this post, I’ll walk you through the process of getting signed up for Amazon Translate, and then share some code that you can use to add language translation to your own Xojo projects. We’ll use the MBS Xojo CURL Plugin, which makes calling the Amazon Translate API easy. But first, let’s learn a little about Amazon Translate.
Comments closed