{"id":91059,"date":"2019-04-23T07:00:41","date_gmt":"2019-04-23T04:00:41","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=91059"},"modified":"2019-04-19T14:53:14","modified_gmt":"2019-04-19T11:53:14","slug":"angular-http-client-module-example","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2019\/04\/angular-http-client-module-example.html","title":{"rendered":"Angular Http Client Module Example"},"content":{"rendered":"<p>Welcome readers, in this tutorial, we will learn about the <strong>Http Client Module<\/strong> to interact with the restful endpoints.<\/p>\n<h2>1. Introduction<\/h2>\n<p>In 2K17, Angular 6 framework introduced the Http Client Module to fetch the data from the restful endpoints. This module,<\/p>\n<ul>\n<li>Allows developers to send HTTP requests or make API calls to the external servers<\/li>\n<li>Replaces the old Http Client and is available in the <code>@angular\/common\/http<\/code> package<\/li>\n<li>An abstract to <code>XMLHttpRequest<\/code> interface and provides new features like \u2013 Request and Response Interceptors, Observables, Better testing support, and error handling, etc.<\/li>\n<\/ul>\n<p>Now open the visual studio code and let us see how to implement this tutorial in angular 6 frameworks.<\/p>\n<h2>2. Angular Http Client Module Example<\/h2>\n<p>Here is a systematic guide for implementing this tutorial.<\/p>\n<h3>2.1 Tools Used<\/h3>\n<p>We are using Visual Studio Code and Node Terminal to compile and execute the angular code on a browser.<\/p>\n<h3>2.2 Project Structure<\/h3>\n<p>In case you are confused about where you should create the corresponding files or folder, let us review the project structure of the angular application.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"258\" height=\"440\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/04\/angular-httpclient-project-structure-guide1_1.jpg\" alt=\"Angular Http Client Module - Application Structure\" class=\"wp-image-91065\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/04\/angular-httpclient-project-structure-guide1_1.jpg 258w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/04\/angular-httpclient-project-structure-guide1_1-176x300.jpg 176w\" sizes=\"(max-width: 258px) 100vw, 258px\" \/><figcaption>Fig. 1: Application Structure<\/figcaption><\/figure>\n<\/div>\n<h2>3. Creating Angular application<\/h2>\n<p>Run the <code>ng new angular-httpclient-tutorial<\/code> command in the npm console to create a new angular project. Once the new project is created, following the below steps.<\/p>\n<h3>3.1 Import Http Client module<\/h3>\n<p>To start working we will need to import the <code>HttpClientModule<\/code> module in <code>src\/app\/app.module.ts<\/code> file.<\/p>\n<p><span style=\"text-decoration: underline\"><em>app.module.ts<\/em><\/span><\/p>\n<pre class=\"brush:js; wrap-lines:false;\">\/\/ Injecting http client module in the angular application.\nimport { HttpClientModule } from '@angular\/common\/http';\n\n\/\/ Declaring the http client module in the imports section of NgModule decorator.\nimports: [\n    BrowserModule, HttpClientModule\n  ],\n<\/pre>\n<h3>3.2 Creating a Service<\/h3>\n<p>To start using the Http Client Module in our application, we will need to create a service. Run the <code>ng g s service\/newsservice<\/code> command in the npm console to create a news service. This service,<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<ul>\n<li>Will use the <code>HttpClient<\/code> to send the HTTP requests<\/li>\n<li>Will be injected in our application to perform the HTTP operations<\/li>\n<\/ul>\n<p>Make note, users\u2019 needs to generate a new token for serving the requests from the newsapi.org!<\/p>\n<p><span style=\"text-decoration: underline\"><em>newsservice.service.ts<\/em><\/span><\/p>\n<pre class=\"brush:js; wrap-lines:false;\">import { Injectable } from '@angular\/core';\nimport { HttpClient } from '@angular\/common\/http';\n\n@Injectable({\n  providedIn: 'root'\n})\n\nexport class NewsserviceService {\n\n  constructor(private _http: HttpClient) { }\n\n  \/\/ Service method to fetch the top news headlines.\n  getHeadlines() {\n    console.log('Fetching top headlines from the server.');\n    \n    let apitoken = \"72eb33ec969544a0af14de32981747cc\";\n    return this._http.get(\"https:\/\/newsapi.org\/v2\/top-headlines?sources=techcrunch&amp;apiKey=\" + apitoken);\n  }\n}\n<\/pre>\n<h3>3.3 Creating Model<\/h3>\n<p>To start using the Http Client, we will inject the news service in our component model.<\/p>\n<p><span style=\"text-decoration: underline\"><em>app.component.ts<\/em><\/span><\/p>\n<pre class=\"brush:js; wrap-lines:false;\">import { Component } from '@angular\/core';\nimport { NewsserviceService } from '.\/service\/newsservice.service';\n\n@Component({\n  selector: 'app-root',\n  templateUrl: '.\/app.component.html',\n  styleUrls: ['.\/app.component.css']\n})\n\nexport class AppComponent {\n  \n  title = 'Angular HttpClient Tutorial';\n\n  \/\/ Variable to store the response for the news headline.\n  news: any;\n\n  constructor(private _serv: NewsserviceService) {}\n\n  \/\/ Angular method to fetch the news headlines.\n  getNews() {\n    this._serv.getHeadlines().subscribe(res =&gt; {\n      this.news = res;\n    });\n  }\n}\n<\/pre>\n<h3>3.4 Creating Component<\/h3>\n<p>To view the data fetched from the service we will need to update the HTML view where we will render the news array.<\/p>\n<p><span style=\"text-decoration: underline\"><em>app.component.html<\/em><\/span><\/p>\n<pre class=\"brush:html; wrap-lines:false;\">&lt;html&gt;\n\n&lt;head&gt;\n  &lt;link rel=\"stylesheet\" href=\"https:\/\/stackpath.bootstrapcdn.com\/bootstrap\/4.3.1\/css\/bootstrap.min.css\"&gt;\n&lt;\/head&gt;\n\n&lt;body&gt;\n  &lt;!--The content below is only a placeholder and can be replaced.--&gt;\n  &lt;div class=\"container\"&gt;\n    &lt;h2 class=\"text-info text-center\"&gt;{{ title }}!&lt;\/h2&gt;\n    &lt;hr \/&gt;\n\n    &lt;div id=\"submit_btn\"&gt;\n      &lt;button type=\"button\" class=\"btn btn-outline-primary\" (click)=\"getNews();\"&gt;Get News&lt;\/button&gt;\n    &lt;\/div&gt;\n    &lt;div&gt;&nbsp;&lt;\/div&gt;\n\n    &lt;div *ngIf=\"news\"&gt;\n      &lt;table id=\"table\" class=\"table table-bordered\"&gt;\n        &lt;thead&gt;\n          &lt;th&gt;#&lt;\/th&gt;\n          &lt;th&gt;Source&lt;\/th&gt;\n          &lt;th&gt;Title&lt;\/th&gt;\n          &lt;th&gt;Description&lt;\/th&gt;\n          &lt;th&gt;Author&lt;\/th&gt;\n          &lt;th&gt;Time&lt;\/th&gt;\n        &lt;\/thead&gt;\n        &lt;tbody&gt;\n          &lt;tr *ngFor=\"let a of news.articles; let i=index\"&gt;\n            &lt;td&gt;{{i+1}}&lt;\/td&gt;\n            &lt;td&gt;{{a.source.name}}&lt;\/td&gt;\n            &lt;td&gt;{{a.title}}&lt;\/td&gt;\n            &lt;td&gt;{{a.description}}&lt;\/td&gt;\n            &lt;td&gt;{{a.author | titlecase}}&lt;\/td&gt;\n            &lt;td&gt;{{a.publishedAt | date:'medium'}}&lt;\/td&gt;\n          &lt;\/tr&gt;\n        &lt;\/tbody&gt;\n      &lt;\/table&gt;\n    &lt;\/div&gt;\n  &lt;\/div&gt;\n&lt;\/body&gt;\n\n&lt;\/html&gt;\n<\/pre>\n<h2>4. Run the Application<\/h2>\n<p>As we are ready with all the changes, let us compile and run the angular application with <code>ng serve<\/code> command. Once the projects are successfully compiled and deployed, open the browser to test it.<\/p>\n<h2>5. Project Demo<\/h2>\n<p>Open your favorite browser and hit the angular application url (<code>http:\/\/localhost:4200\/<\/code>) to display the index page of the application.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"818\" height=\"99\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/04\/angular-httpclient-project-demo-guide1_1.jpg\" alt=\"Angular Http Client Module - Welcome Page\" class=\"wp-image-91068\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/04\/angular-httpclient-project-demo-guide1_1.jpg 818w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/04\/angular-httpclient-project-demo-guide1_1-300x36.jpg 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/04\/angular-httpclient-project-demo-guide1_1-768x93.jpg 768w\" sizes=\"(max-width: 818px) 100vw, 818px\" \/><figcaption>Fig. 2: Welcome Page<\/figcaption><\/figure>\n<\/div>\n<p>Users can click the button to fetch the top news headlines as shown in Fig. 3.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"818\" height=\"497\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/04\/angular-httpclient-project-demo-guide2_1.jpg\" alt=\"Angular Http Client Module - News Headlines\" class=\"wp-image-91069\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/04\/angular-httpclient-project-demo-guide2_1.jpg 818w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/04\/angular-httpclient-project-demo-guide2_1-300x182.jpg 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/04\/angular-httpclient-project-demo-guide2_1-768x467.jpg 768w\" sizes=\"(max-width: 818px) 100vw, 818px\" \/><figcaption>Fig. 3: News Headlines<\/figcaption><\/figure>\n<\/div>\n<p>That is all for this tutorial and I hope the article served you whatever you were expecting for. Happy Learning and do not forget to share!<\/p>\n<h2>6. Conclusion<\/h2>\n<p>In this section, we learned how to create a simple Http Client Module application. Developers can download the sample application as an Eclipse project in the <a href=\"#projectDownload\">Downloads<\/a> section.<\/p>\n<h2><a name=\"projectDownload\"><\/a>7. Download the Eclipse Project<\/h2>\n<p>This was a tutorial of Http Client Module in the angular framework.<\/p>\n<div class=\"download\"><strong>Download<\/strong><br \/>You can download the full source code of this example here: <a target=\"_blank\" href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/04\/angular-httpclient-tutorial.zip\" rel=\"noopener noreferrer\"><strong>Angular Http Client Module Example<\/strong><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Welcome readers, in this tutorial, we will learn about the Http Client Module to interact with the restful endpoints. 1. Introduction In 2K17, Angular 6 framework introduced the Http Client Module to fetch the data from the restful endpoints. This module, Allows developers to send HTTP requests or make API calls to the external servers &hellip;<\/p>\n","protected":false},"author":26931,"featured_media":49726,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1880],"tags":[740],"class_list":["post-91059","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-angular","tag-angular"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Angular Http Client Module Example - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Interested to learn more about Angular? Then check out our detailed example on Angular Http Client Module!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2019\/04\/angular-http-client-module-example.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Angular Http Client Module Example - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Interested to learn more about Angular? Then check out our detailed example on Angular Http Client Module!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2019\/04\/angular-http-client-module-example.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2019-04-23T04:00:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/angularjs-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Yatin Batra\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Yatin Batra\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/04\\\/angular-http-client-module-example.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/04\\\/angular-http-client-module-example.html\"},\"author\":{\"name\":\"Yatin Batra\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/cda31a4c1965373fed40c8907dc09b8d\"},\"headline\":\"Angular Http Client Module Example\",\"datePublished\":\"2019-04-23T04:00:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/04\\\/angular-http-client-module-example.html\"},\"wordCount\":504,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/04\\\/angular-http-client-module-example.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2015\\\/12\\\/angularjs-logo.jpg\",\"keywords\":[\"Angular\"],\"articleSection\":[\"Angular\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/04\\\/angular-http-client-module-example.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/04\\\/angular-http-client-module-example.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/04\\\/angular-http-client-module-example.html\",\"name\":\"Angular Http Client Module Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/04\\\/angular-http-client-module-example.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/04\\\/angular-http-client-module-example.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2015\\\/12\\\/angularjs-logo.jpg\",\"datePublished\":\"2019-04-23T04:00:41+00:00\",\"description\":\"Interested to learn more about Angular? Then check out our detailed example on Angular Http Client Module!\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/04\\\/angular-http-client-module-example.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/04\\\/angular-http-client-module-example.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/04\\\/angular-http-client-module-example.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2015\\\/12\\\/angularjs-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2015\\\/12\\\/angularjs-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/04\\\/angular-http-client-module-example.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Web Development\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/web-development\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"JavaScript\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/web-development\\\/javascript\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Angular\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/web-development\\\/javascript\\\/angular\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Angular Http Client Module Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/cda31a4c1965373fed40c8907dc09b8d\",\"name\":\"Yatin Batra\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/Yatin.batra_.jpg\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/Yatin.batra_.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/Yatin.batra_.jpg\",\"caption\":\"Yatin Batra\"},\"description\":\"An experience full-stack engineer well versed with Core Java, Spring\\\/Springboot, MVC, Security, AOP, Frontend (Angular &amp; React), and cloud technologies (such as AWS, GCP, Jenkins, Docker, K8).\",\"sameAs\":[\"https:\\\/\\\/www.javacodegeeks.com\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/yatin-batra\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Angular Http Client Module Example - Java Code Geeks","description":"Interested to learn more about Angular? Then check out our detailed example on Angular Http Client Module!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2019\/04\/angular-http-client-module-example.html","og_locale":"en_US","og_type":"article","og_title":"Angular Http Client Module Example - Java Code Geeks","og_description":"Interested to learn more about Angular? Then check out our detailed example on Angular Http Client Module!","og_url":"https:\/\/www.javacodegeeks.com\/2019\/04\/angular-http-client-module-example.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2019-04-23T04:00:41+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/angularjs-logo.jpg","type":"image\/jpeg"}],"author":"Yatin Batra","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Yatin Batra","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2019\/04\/angular-http-client-module-example.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/04\/angular-http-client-module-example.html"},"author":{"name":"Yatin Batra","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/cda31a4c1965373fed40c8907dc09b8d"},"headline":"Angular Http Client Module Example","datePublished":"2019-04-23T04:00:41+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/04\/angular-http-client-module-example.html"},"wordCount":504,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/04\/angular-http-client-module-example.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/angularjs-logo.jpg","keywords":["Angular"],"articleSection":["Angular"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2019\/04\/angular-http-client-module-example.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2019\/04\/angular-http-client-module-example.html","url":"https:\/\/www.javacodegeeks.com\/2019\/04\/angular-http-client-module-example.html","name":"Angular Http Client Module Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/04\/angular-http-client-module-example.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/04\/angular-http-client-module-example.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/angularjs-logo.jpg","datePublished":"2019-04-23T04:00:41+00:00","description":"Interested to learn more about Angular? Then check out our detailed example on Angular Http Client Module!","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/04\/angular-http-client-module-example.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2019\/04\/angular-http-client-module-example.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2019\/04\/angular-http-client-module-example.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/angularjs-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/angularjs-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2019\/04\/angular-http-client-module-example.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Web Development","item":"https:\/\/www.javacodegeeks.com\/category\/web-development"},{"@type":"ListItem","position":3,"name":"JavaScript","item":"https:\/\/www.javacodegeeks.com\/category\/web-development\/javascript"},{"@type":"ListItem","position":4,"name":"Angular","item":"https:\/\/www.javacodegeeks.com\/category\/web-development\/javascript\/angular"},{"@type":"ListItem","position":5,"name":"Angular Http Client Module Example"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/cda31a4c1965373fed40c8907dc09b8d","name":"Yatin Batra","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/12\/Yatin.batra_.jpg","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/12\/Yatin.batra_.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/12\/Yatin.batra_.jpg","caption":"Yatin Batra"},"description":"An experience full-stack engineer well versed with Core Java, Spring\/Springboot, MVC, Security, AOP, Frontend (Angular &amp; React), and cloud technologies (such as AWS, GCP, Jenkins, Docker, K8).","sameAs":["https:\/\/www.javacodegeeks.com"],"url":"https:\/\/www.javacodegeeks.com\/author\/yatin-batra"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/91059","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/26931"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=91059"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/91059\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/49726"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=91059"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=91059"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=91059"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}