Posts

Showing posts with the label Jersey

Getting started with Dropwizard: Connecting to external REST Web-services using Jersey Client

Here is a link to my Getting Started with Dropwizard course on Udemy. Only $10! Imagine a situation that you would like to create a currency conversion API using Dropwizard , but exchange rates are fickle and change on daily if not hourly basis. So, you need an external source of exchange rate data and luckily, Google search returns a list of such APIs. In this tutorial will connect to Open Exchange Rates which has a free option. To use the API one needs to obtain a free API key which is an alphanumeric string supplied as part of request string when accessing the API. Here is the description of how to obtain the key . From this moment it is supposed that you have obtained the key, otherwise you will be unable to follow the examples from this tutorial. Let’s play a little with the API before we start writing the actual code. First, one can obtain the list of supported currencies, this can be accomplished by navigating the following URL https://openexchangerates.org/a...

Getting started with Dropwizard: First steps

Image
Here is a link to my Getting Started with Dropwizard course on Udemy. Only $10! Dropwizard is a bunch of superb frameworks glued together to provide a fast way of building web applications including REST APIs. We'll talk about great frameworks which are parts of Dropwizard as we go over our examples. The full code for the examples can be obtained here . The simplest way to create a Dropwizard project is to use the Maven archetype called java-simple which is a part of Dropwizard. This can be accomplished either via the command line or using your favorite IDE. Let's stick to the former approach. The command below is formatted for clarity but it should be pasted as a single line to the terminal. After the project was created it can be modified using an editor or opened in an IDE. All the three IntelliJ, Eclipse and Netbeans have Maven support. An important parameter to note in the pom.xml file of the newly created project is dropwizard.version , which at ...