{"id":1727,"date":"2021-08-25T20:18:59","date_gmt":"2021-08-25T20:18:59","guid":{"rendered":"https:\/\/www.reloadly.com\/blog\/?p=1727"},"modified":"2021-10-05T11:47:32","modified_gmt":"2021-10-05T11:47:32","slug":"consuming-rest-apis-in-java-applications","status":"publish","type":"post","link":"https:\/\/blog.reloadly.com\/blog\/consuming-rest-apis-in-java-applications\/","title":{"rendered":"Consuming REST APIs in Java Applications"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_46 ez-toc-wrap-left counter-hierarchy ez-toc-counter ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"ez-toc-toggle-icon-1\"><label for=\"item-69d272c8c4b4c\" aria-label=\"Table of Content\"><span style=\"display: flex;align-items: center;width: 35px;height: 30px;justify-content: center;direction:ltr;\"><svg style=\"fill: #000000;color:#000000\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #000000;color:#000000\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/label><input  type=\"checkbox\" id=\"item-69d272c8c4b4c\"><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-visibility-hide-by-default' ><ul class='ez-toc-list-level-3'><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/blog.reloadly.com\/blog\/consuming-rest-apis-in-java-applications\/#Tools_you_will_need\" title=\"Tools you will need\">Tools you will need<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/blog.reloadly.com\/blog\/consuming-rest-apis-in-java-applications\/#Initializing_a_Java_Application_with_Spring\" title=\"Initializing a Java Application with Spring\">Initializing a Java Application with Spring<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/blog.reloadly.com\/blog\/consuming-rest-apis-in-java-applications\/#Defining_classes_for_REST_APIs\" title=\"Defining classes for REST APIs\">Defining classes for REST APIs<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/blog.reloadly.com\/blog\/consuming-rest-apis-in-java-applications\/#Fetching_a_REST_API_resource\" title=\"Fetching a REST API resource\">Fetching a REST API resource<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/blog.reloadly.com\/blog\/consuming-rest-apis-in-java-applications\/#Summary\" title=\"Summary\">Summary<\/a><\/li><\/ul><\/nav><\/div>\n\n<p>Working with and processing responses from REST APIs in Java can be daunting for developers who are not very familiar with the language. In this tutorial, we will demystify the process behind parsing API responses in Java. We will be working with&nbsp;<a href=\"https:\/\/spring.io\/quickstart\">Spring<\/a>&nbsp;\u2014 a framework for building Java applications.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Tools_you_will_need\"><\/span>Tools you will need<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p><a href=\"https:\/\/www.oracle.com\/java\/technologies\/javase\/javase-jdk8-downloads.html\">Java Development Kit (JDK)<\/a>: A software development environment used to develop Java applications. (At the time of writing, JDK 8 is most compatible with this tutorial).<\/p>\n\n\n\n<p><a href=\"https:\/\/maven.apache.org\/\">Maven<\/a>: A build automation tool used in Java projects. (At the time of writing this article, version 3.2 is most compatible with this tutorial).<\/p>\n\n\n\n<p><a href=\"https:\/\/start.spring.io\/\">Spring Initializr<\/a>: An application that generates a basic Spring project structure.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Initializing_a_Java_Application_with_Spring\"><\/span>Initializing a Java Application with Spring<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The first step to getting started is to initiate a new project with Spring. You can do this by navigating to Spring Initializr\u2019s web application and start a new project using the configurations specified below:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Project - Maven Project\n# Language - Java\n# Spring Boot Version - 2.4.9\n\n# Project Metadata\n# Group - com.example\n# Artifact - restapi\n# Name - restapi\n# Description - A demo project to showcase REST APIs\n# Package name - com.example.restapi\n# Packaging - JAR\n# Java - 8<\/code><\/pre>\n\n\n\n<p>When you are done configuring your project, click on the&nbsp;<code>GENERATE CTRL + ENTER<\/code>&nbsp;button to generate a Spring project that can be downloaded and accessed via your IDE. Let\u2019s take a moment to go over some of the configurations selected in creating this project:<\/p>\n\n\n\n<ul id=\"block-910d357d-1caa-4e1c-95c0-3c5749fe73fa\"><li><strong>Project<\/strong>: Requires you to choose from either one of two build tools &#8211; Maven or Gradle<\/li><li><strong>Language<\/strong>: Requires you to choose from among one of three languages &#8211; Java, Kotlin, or Groovy<\/li><li><strong>Group<\/strong>: Requires you to specify the package name of your project<\/li><li><strong>Artifact<\/strong>: Requires you specify the name of your project\u2019s application<\/li><li><strong>Packaging<\/strong>: Requires you to specify your packaged file format<\/li><\/ul>\n\n\n\n<p>When you are done configuring your project, click on the&nbsp;<code>GENERATE CTRL + ENTER<\/code>&nbsp;button to generate a Spring project that can be downloaded and accessed via your IDE. Let\u2019s take a moment to go over some of the configurations selected in creating this project:<\/p>\n\n\n\n<p>Your downloaded project should have a structure similar to the illustration below:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"983\" height=\"592\" src=\"https:\/\/www.reloadly.com\/blog\/wp-content\/uploads\/2021\/08\/snapshot.png\" alt=\"\" class=\"wp-image-1738\" srcset=\"https:\/\/blog.reloadly.com\/blog\/wp-content\/uploads\/2021\/08\/snapshot.png 983w, https:\/\/blog.reloadly.com\/blog\/wp-content\/uploads\/2021\/08\/snapshot-300x181.png 300w, https:\/\/blog.reloadly.com\/blog\/wp-content\/uploads\/2021\/08\/snapshot-768x463.png 768w\" sizes=\"(max-width: 983px) 100vw, 983px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Defining_classes_for_REST_APIs\"><\/span>Defining classes for REST APIs<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>For our API data, we will make use of an endpoint from Reloadly\u2019s API that returns details on any country based on its&nbsp;<a href=\"https:\/\/www.nationsonline.org\/oneworld\/country_code_list.htm#:~:text=The%20ISO%20country%20codes%20are,two%2Dletter%20suffixes%20such%20as%20.\">ISO code<\/a>. The URL for accessing this is:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><a href=\"https:\/\/topups.reloadly.com\/countries\/%7Bcountrycode%7D\">https:\/\/topups.reloadly.com\/countries\/{countrycode}<\/a><\/pre>\n\n\n\n<p>Where the <code>countrycode<\/code> parameter represents the ISO code of the country whose data is to be retrieved. For our example, we\u2019ll use the United States (US). When a successful response is gotten, the data will be in JSON and will be similar to this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n    \"isoName\": \"US\",\n    \"name\": \"United States\",\n    \"currencyCode\": \"USD\",\n    \"currencyName\": \"US Dollar\",\n    \"currencySymbol\": \"$\",\n    \"flag\": \"https:\/\/s3.amazonaws.com\/rld-flags\/us.svg\",\n    \"callingCodes\": &#91;\n        \"+1\"\n    ]\n}<\/code><\/pre>\n\n\n\n<p>To process this data in your application, you\u2019ll need to create a domain class that contains properties and matching getter methods for the data you intend to retrieve from Reloadly\u2019s API. Your property names should match the exact names of each response parameter in the data to be retrieved as shown in the code sample below:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Countries.java\n\npackage com.example.restapi;\n\nimport com.fasterxml.jackson.annotation.JsonIgnoreProperties;\n\nimport java.util.List;\n\n@JsonIgnoreProperties(ignoreUnknown = true)\n\npublic class Countries {\n\n    private String isoName;\n    private String name;\n    private String currencyCode;\n    private String currencyName;\n    private String currencySymbol;\n    private String flag;\n    private List&lt;String> callingCodes;\n\n    public Countries() {\n    }\n\n    public String getIsoName() {\n        return isoName;\n    }\n\n    public void setIsoName(String isoName) {\n        this.isoName = isoName;\n    }\n\n    public String getName() {\n        return name;\n    }\n\n    public void setName(String name) {\n        this.name = name;\n    }\n\n    public String getCurrencyCode() {\n        return currencyCode;\n    }\n\n    public void setCurrencyCode(String currencyCode) {\n        this.currencyCode = currencyCode;\n    }\n\n    public String getCurrencyName() {\n        return currencyName;\n    }\n\n    public void setCurrencyName(String currencyName) {\n        this.currencyName = currencyName;\n    }\n\n    public String getCurrencySymbol() {\n        return currencySymbol;\n    }\n\n    public void setCurrencySymbol(String currencySymbol) {\n        this.currencySymbol = currencySymbol;\n    }\n\n    public String getFlag() {\n        return flag;\n    }\n    public void setFlag(String flag) {\n        this.flag = flag;\n    }\n\n    public List&lt;String> getCallingCodes() {\n        return callingCodes;\n    }\n\n    public void setCallingCodes(List&lt;String> callingCodes) {\n        this.callingCodes = callingCodes;\n    }\n\n    @Override\n    public String toString() {\n        return \"Country{\" +\n                \"isoName='\" + isoName + '\\'' +\n                \"name='\" + name + '\\'' +\n                \"currencyCode='\" + currencyCode + '\\'' +\n                \"currencyName='\" + currencyName + '\\'' +\n                \"currencySymbol='\" + currencySymbol + '\\'' +\n                \"flag='\" + flag + '\\'' +\n                \"callingCodes='\" + callingCodes + '\\'' +\n                '}';\n    }\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Fetching_a_REST_API_resource\"><\/span>Fetching a REST API resource<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Once you\u2019re done creating a class that handles your response data, the next step is to make a request to Reloadly\u2019s API to fetch the data. Upon creating your project, Spring Initializr creates a class that is named after your project and used to run your project. It is from this class that a request to Reloadly\u2019s API endpoint will be made. Let\u2019s take a look at how this is achieved in the code sample below:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ RestApiApplication.java\n\npackage com.example.restapi;\n\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.springframework.boot.CommandLineRunner;\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\nimport org.springframework.boot.web.client.RestTemplateBuilder;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.web.client.RestTemplate;\n\n@SpringBootApplication\npublic class RestApiApplication {\n\n   private static final Logger log = LoggerFactory.getLogger(RestApiApplication.class);\n\n   public static void main(String&#91;] args) {\n      SpringApplication.run(RestApiApplication.class, args);\n   }\n\n   @Bean\n   public RestTemplate restTemplate(RestTemplateBuilder builder) {\n      return builder.build();\n   }\n\n   @Bean\n   public CommandLineRunner run(RestTemplate restTemplate) throws Exception {\n      return args -> {\n         Countries countries = restTemplate.getForObject(\n               \"https:\/\/topups.reloadly.com\/countries\/US\", Countries.class);\n         log.info(countries.toString());\n      };\n   }\n}<\/code><\/pre>\n\n\n\n<p>In the code sample above, we defined the following:<\/p>\n\n\n\n<ul><li>A class called&nbsp;<code>RestApiApplication<\/code>&nbsp;is created. This contains the methods that run and create a build for our application.<\/li><li>A logger which logs our API response to the console is also created.<\/li><li>A bean annotation which serves as the backbone of our application. It also creates a build for our application.<\/li><li><code>RestTemplate<\/code>&nbsp;&#8211; a web client abstraction built on the&nbsp;<a href=\"https:\/\/www.javatpoint.com\/servlet-api\">Java Servlet API<\/a>. It will be used to make our request to Reloadly\u2019s API.<\/li><\/ul>\n\n\n\n<p>Reloadly\u2019s endpoint can be broken down into:<\/p>\n\n\n\n<ul><li><code>https:\/\/topups.reloadly.com<\/code>&nbsp;: This is the base URL that makes a request to Reloadly\u2019s servers<\/li><li><code>\/countries\/US<\/code>&nbsp;: This is the endpoint where data is to be fetched from,&nbsp;<code>US<\/code>&nbsp;is the country code for the United States &#8211; the country whose data we\u2019re going to view. You can find out more details on Reloadly\u2019s documentation&nbsp;<a href=\"https:\/\/docs.reloadly.com\/airtime\/countries\/get-country-by-iso-code\">here<\/a><\/li><\/ul>\n\n\n\n<p>At this point, our application should be complete. Let\u2019s run it by navigating to our terminal and using Maven\u2019s run command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.\/mvnw spring-boot:run<\/code><\/pre>\n\n\n\n<p>The video clip below depicts how to do this:<\/p>\n\n\n\n<figure class=\"wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-4-3 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"consuming-rest-apis-with-java-applications-1\" width=\"500\" height=\"375\" src=\"https:\/\/www.youtube.com\/embed\/I-ChVgJd09k?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Summary\"><\/span>Summary<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Spring is a great framework for developers getting started with Java to get a grasp of the language. In this tutorial, we were able to go through the process of making a basic API call from an endpoint and retrieve a response. Should you need to go through the code sample for this, you can find it&nbsp;<a href=\"https:\/\/github.com\/fullstackmafia\/restapi-spring-java\">here<\/a>&nbsp;on GitHub.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<div class=\"wp-block-group is-layout-flow wp-block-group-is-layout-flow\"><div class=\"wp-block-group__inner-container\"><\/div><\/div>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Get ready to demystify the process behind parsing API responses in Java. <\/p>\n","protected":false},"author":17,"featured_media":1729,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[274],"tags":[277,276,275,278],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v15.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Consuming REST APIs in Java Applications - Reloadly<\/title>\n<meta name=\"description\" content=\"Reloadly Resources. Insights, Info and Analysis For The Mobile Airtime API Community\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.reloadly.com\/blog\/consuming-rest-apis-in-java-applications\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Consuming REST APIs in Java Applications - Reloadly\" \/>\n<meta property=\"og:description\" content=\"Reloadly Resources. Insights, Info and Analysis For The Mobile Airtime API Community\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.reloadly.com\/blog\/consuming-rest-apis-in-java-applications\/\" \/>\n<meta property=\"og:site_name\" content=\"Reloadly\" \/>\n<meta property=\"article:published_time\" content=\"2021-08-25T20:18:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-10-05T11:47:32+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/blog.reloadly.com\/blog\/wp-content\/uploads\/2021\/08\/blog-dev-aug2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1250\" \/>\n\t<meta property=\"og:image:height\" content=\"1251\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\">\n\t<meta name=\"twitter:data1\" content=\"5 minutes\">\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.reloadly.com\/blog\/#organization\",\"name\":\"Reloadly\",\"url\":\"https:\/\/www.reloadly.com\/blog\/\",\"sameAs\":[],\"logo\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.reloadly.com\/blog\/#logo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/blog.reloadly.com\/blog\/wp-content\/uploads\/2020\/11\/logo-1.svg\",\"width\":100,\"height\":100,\"caption\":\"Reloadly\"},\"image\":{\"@id\":\"https:\/\/www.reloadly.com\/blog\/#logo\"}},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.reloadly.com\/blog\/#website\",\"url\":\"https:\/\/www.reloadly.com\/blog\/\",\"name\":\"Reloadly\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.reloadly.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/www.reloadly.com\/blog\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/blog.reloadly.com\/blog\/consuming-rest-apis-in-java-applications\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/blog.reloadly.com\/blog\/wp-content\/uploads\/2021\/08\/blog-dev-aug2.png\",\"width\":1250,\"height\":1251},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.reloadly.com\/blog\/consuming-rest-apis-in-java-applications\/#webpage\",\"url\":\"https:\/\/blog.reloadly.com\/blog\/consuming-rest-apis-in-java-applications\/\",\"name\":\"Consuming REST APIs in Java Applications - Reloadly\",\"isPartOf\":{\"@id\":\"https:\/\/www.reloadly.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/blog.reloadly.com\/blog\/consuming-rest-apis-in-java-applications\/#primaryimage\"},\"datePublished\":\"2021-08-25T20:18:59+00:00\",\"dateModified\":\"2021-10-05T11:47:32+00:00\",\"description\":\"Reloadly Resources. Insights, Info and Analysis For The Mobile Airtime API Community\",\"breadcrumb\":{\"@id\":\"https:\/\/blog.reloadly.com\/blog\/consuming-rest-apis-in-java-applications\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blog.reloadly.com\/blog\/consuming-rest-apis-in-java-applications\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blog.reloadly.com\/blog\/consuming-rest-apis-in-java-applications\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.reloadly.com\/blog\/\",\"url\":\"https:\/\/www.reloadly.com\/blog\/\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"position\":2,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.reloadly.com\/blog\/consuming-rest-apis-in-java-applications\/\",\"url\":\"https:\/\/blog.reloadly.com\/blog\/consuming-rest-apis-in-java-applications\/\",\"name\":\"Consuming REST APIs in Java Applications\"}}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/blog.reloadly.com\/blog\/consuming-rest-apis-in-java-applications\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/blog.reloadly.com\/blog\/consuming-rest-apis-in-java-applications\/#webpage\"},\"author\":{\"@id\":\"https:\/\/www.reloadly.com\/blog\/#\/schema\/person\/2400042054e3b3009489e487224a6984\"},\"headline\":\"Consuming REST APIs in Java Applications\",\"datePublished\":\"2021-08-25T20:18:59+00:00\",\"dateModified\":\"2021-10-05T11:47:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/blog.reloadly.com\/blog\/consuming-rest-apis-in-java-applications\/#webpage\"},\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.reloadly.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/blog.reloadly.com\/blog\/consuming-rest-apis-in-java-applications\/#primaryimage\"},\"keywords\":\"api,java,reloadly,springboot\",\"articleSection\":\"Developer Blog\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/blog.reloadly.com\/blog\/consuming-rest-apis-in-java-applications\/#respond\"]}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.reloadly.com\/blog\/#\/schema\/person\/2400042054e3b3009489e487224a6984\",\"name\":\"Raphael Ugwu\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.reloadly.com\/blog\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/656844c0101d37e5695eee915ed3a49d?s=96&d=mm&r=g\",\"caption\":\"Raphael Ugwu\"},\"url\":\"https:\/\/blog.reloadly.com\/blog\/author\/fullstackmafia\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","authors":[{"term_id":359,"user_id":17,"is_guest":0,"slug":"fullstackmafia","display_name":"Raphael Ugwu"}],"_links":{"self":[{"href":"https:\/\/blog.reloadly.com\/blog\/wp-json\/wp\/v2\/posts\/1727"}],"collection":[{"href":"https:\/\/blog.reloadly.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.reloadly.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.reloadly.com\/blog\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.reloadly.com\/blog\/wp-json\/wp\/v2\/comments?post=1727"}],"version-history":[{"count":16,"href":"https:\/\/blog.reloadly.com\/blog\/wp-json\/wp\/v2\/posts\/1727\/revisions"}],"predecessor-version":[{"id":1911,"href":"https:\/\/blog.reloadly.com\/blog\/wp-json\/wp\/v2\/posts\/1727\/revisions\/1911"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.reloadly.com\/blog\/wp-json\/wp\/v2\/media\/1729"}],"wp:attachment":[{"href":"https:\/\/blog.reloadly.com\/blog\/wp-json\/wp\/v2\/media?parent=1727"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.reloadly.com\/blog\/wp-json\/wp\/v2\/categories?post=1727"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.reloadly.com\/blog\/wp-json\/wp\/v2\/tags?post=1727"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}