Web API with Angular 2 Front End

Slides:



Advertisements
Similar presentations
Give it a REST already Arnon Rotem-Gal-Oz VP R&D xsights
Advertisements

 2002 Prentice Hall. All rights reserved. Chapter 9: Servlets Outline 9.1 Introduction 9.2 Servlet Overview and Architecture Interface Servlet and.
1 Configuring Internet- related services (April 22, 2015) © Abdou Illia, Spring 2015.
CSC 450/550 Part 6: The Application Layer Example: The World Wide Web.
06 | Implementing Web APIs Jon Galloway | Tech Evangelist Christopher Harrison | Head Geek.
CS 415 N-Tier Application Development By Umair Ashraf July 6,2013 National University of Computer and Emerging Sciences Lecture # 9 Introduction to Web.
Web Client/Server Communication A290/A590, Fall /09/2014.
RESTful Web Development With Nodejs and Express. REST Stands for REpresentational State Transfer Has the following constraints: ◦Client-Server ◦Stateless.
Chapter 9 Using Perl for CGI Programming. Computation is required to support sophisticated web applications Computation can be done by the server or the.
Module 10: Designing an AD RMS Infrastructure in Windows Server 2008.
Beyond the UI Using Tools to Improve Testing Jeremy Traylor
ASP.NET Web API Udaiappa Ramachandran NHDN-Nashua.NET/Cloud Computing UG Lead Blog:
REST.  REST is an acronym standing for Representational State Transfer  A software architecture style for building scalable web services  Typically,
Getting Started with the ASP.NET Web API Dhananjay Kumar Infragistics Consultant Microsoft MVP
USING PERL FOR CGI PROGRAMMING
SUSE Linux Enterprise Desktop Administration Chapter 12 Administer Printing.
Python and REST Kevin Hibma. What is REST? Why REST? REST stands for Representational State Transfer. (It is sometimes spelled "ReST".) It relies on a.
1 Dr Alexiei Dingli Web Science Stream Introducing Rails.
Application code Registry 1 Alignment of R-GMA with developments in the Open Grid Services Architecture (OGSA) is advancing. The existing Servlets and.
Copyright © Cybage Software Pvt. Ltd. All Rights Reserved. Cybage Confidential. Drupal Web Services 1 Authored by: Chaitanya Anil Kulkarni Presented.
Introduction to the SharePoint 2013 REST API. 2 About Me SharePoint Solutions Architect at Sparkhound in Baton Rouge
1 WWW. 2 World Wide Web Major application protocol used on the Internet Simple interface Two concepts –Point –Click.
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
RESTful Web Services What is RESTful?
Securing Angular Apps Brian Noyes
Chapter 4 Request and Response. Servlets are controlled by the container.
COSC 2328 – Web Programming.  PHP is a server scripting language  It’s widely-used and free  It’s an alternative to Microsoft’s ASP and Ruby  PHP.
JAVA, JEE Training Introduction to Web Harinath Mallepally
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
WebApi: What is it? How can I use it? Guy In Front of the Whittaker.
© 2010 IBM Corporation RESTFul Service Modelling in Rational Software Architect April, 2011.
Module 4: Troubleshooting Web Servers. Overview Use IIS 7.0 troubleshooting features to gather troubleshooting information Use the Runtime Control and.
National College of Science & Information Technology.
Data and tools on the Web have been exposed in a RESTful manner. Taverna provides a custom processor for accessing such services.
Lesson 11: Web Services and API's
ArcGIS for Server Security: Advanced
Doron Orbach UCMDB Product Manager
Tiny http client and server
Introduction to .NET Florin Olariu
Azure Identity Premier Fast Start
The Client-Server Model
WWU Hackathon May 6 & 7.
Content from Python Docs.
Better RESTFul API – Best Practices
Node.js Express Web Applications
API Security Auditing Be Aware,Be Safe
Data Virtualization Tutorial… CORS and CIS
ASP.NET Core 2.0 Fundamentals
Node.js Express Web Services
C++ Tango REST API implementation
An introduction to REST for SharePoint 2013
What is REST API ? A REST (Representational State Transfer) Server simply provides access to resources and the REST client accesses and presents the.
Lesson 11: Web Services & API's
Sarang Nazari California State University, Los Angeles
Introduction Web Environments
Introduction to Persistent Identifiers
Build Better Apps with MEAN.
Testing REST IPA using POSTMAN
WEB API.
Anatomy of an ASP.NET Page
Configuring Internet-related services
CS5220 Advanced Topics in Web Programming Angular – Services
J2EE Lecture 1:Servlet and JSP
Python and REST Kevin Hibma.
Web APIs In computer programming, an application programming interface (API) is a set of subroutine definitions, protocols, and tools for building application.
Week 05 Node.js Week 05
REST Services Data and tools on the Web have been exposed in both WSDL and REST. Taverna provides a custom processor for accessing REST services Peter.
CS5220 Advanced Topics in Web Programming Angular – Services
Chengyu Sun California State University, Los Angeles
HTTP and HTML HTML HTTP HTTP – Standardize the packaging
Presentation transcript:

Web API with Angular 2 Front End Carolyn Schroeder, August 15, 2017

What is a RESTFul Web API? Lookups should use GET requests. PUT, POST, and DELETE requests Lookups should use GET requests. PUT, POST, and DELETE requests What is a RESTFul Web API? The term API stands for ‘Application Programming Interface’. These are online web services which client apps can consume REST stands for ‘Representational State Transfer’ and it is an architectural pattern for creating an API that uses HTTP as its underlying communication method RESTFul APIs use the verbs Get, Post, Put and Delete

RESTFul Urls Action Http Verb Relative Url Get All Contacts Get /api/contacts Get Single Contact /api/contacts/id Add Contact Post New contact is sent in POST body Update Contact Put or Patch Updated contact is sent in POST body Delete Contact Delete

Status Codes Status Codes are used to describe the response 200 –OK 201 – Created 204 – No Content 404 – Not Found 500 – Internal Server Error

Enable CORS CORS is a mechanism that essentially lets a server say I allow cross domain calls from the domains I specify When browsers make cross domain calls, they request CORS headers to decide whether the target server allows access to the source domain Here the source domain is the Angular dev server and the target server is the Web API dev server To do this start with registering CORS functionality in ConfigureServices() of Startup.cs You can apply the policy globally to every request in the application by call app.useCors() in the Configure() method of Startup UseCors() has to be called before UseMvc()

Structure of an Angular 2 Application Root Module Component 1 Component 2 Component 3 The AppModule is the Root Module It is bootstrapped by main.ts

An Angular Components: Template Class containing properties and methods Metadata defined with a decorator Components must be declared in the Root module We have two components, AppComponent and ContactListComponent

They require a class to deserialze the data returned from the Web API Angular Services They require a class to deserialze the data returned from the Web API A life cycle hook can be used to fill the data in the html view The life cycle hook OnInit is implemented in ContactListComponent to obtain the data from ContactService

Then this class can be injection into the constructor of a component Dependency Injection To inject a dependency a class needs to be marked with the decorator @Injectable Then this class can be injection into the constructor of a component The ContactService class is injected into the ContactListComponent

Pipes A pipe takes data as input and transforms it to the desired output You can define custom pipes A custom pipe needs the decorator @Pipe The transform method is essential to a pipe The ContactFilterPipe is used to filter data in the ContactListComponent template

Angular 2 Starter Project Right click on package.json and select “Restore Packages” This installs the node_modules folder

https://github.com/carolynlschroed er/WebAPIWithAngular Resources https://github.com/carolynlschroed er/WebAPIWithAngular http://schroederconsulting.business