KEMBAR78
C# web api | PPTX
Agenda
What is Web API?
Agenda
ASP .NET Web API
Agenda
ASP .NET Web API Characteristics
Agenda
ASP.NET Web API Version
Agenda
ASP.NET Web API vs WCF
When to choose ASP.NET Web API?
Agenda
What is Web API?
An application programming interface (API) is a set of subroutine definitions, protocols, and tools
for developing software and applications in computer programming.
What is Web API?
API is a type of interface with a set of functions that allow programmers to access specific
features or data of an application, operating system, or other services.
What is Web API?
As the name implies, Web API is a web-based API that can be accessed via the HTTP protocol.
It is a concept rather than a technology. We can create Web APIs using various technologies
such as Java, NET, and others. Twitter's REST APIs, for example, provide programmatic access
to read and write data, allowing us to integrate Twitter's capabilities into our application.
ASP .NET Web API
Web API
HTTP Response Data
(JSON/XML/Other
Format)
HTTP Request
HTTP Response Data
(JSON/XML/Other
Format)
HTTP Request
HTTP
Request
HTTP
Response
Data
(JSON/XML/Other
Format)
The ASP.NET Web API is an extensible framework for creating HTTP-based services that can be
accessed in various applications on various platforms such as web, windows, mobile etc.
Web
Application
Mobile
Application
Win Form
Application
ASP .NET Web API
It functions similarly to an ASP.NET MVC web application, except it sends data as a response
instead of an HTML view. It functions similarly to a web service or WCF service, except it only
supports the HTTP protocol.
Web API
HTTP Response Data
(JSON/XML/Other
Format)
HTTP Request
HTTP Response Data
(JSON/XML/Other
Format)
HTTP Request
HTTP
Request
HTTP
Response
Data
(JSON/XML/Other
Format)
Web
Application
Mobile
Application
Win Form
Application
The ASP.NET Web API platform is ideal for developing RESTful
services.
ASP .NET Web API Characteristics
ASP.NET Web API is based on ASP.NET and supports the
ASP.NET request/response pipeline. HTTP verbs are
translated into method names by ASP.NET Web API.
ASP .NET Web API Characteristics
The ASP.NET Web API supports a variety of response data
formats. JSON, XML, and BSON format support is built-in.
ASP .NET Web API Characteristics
ASP.NET Web API can be hosted in IIS, Self-hosted, or any
other web server that supports.NET 4.0 or higher.
ASP .NET Web API Characteristics
To communicate with the Web API server, the ASP.NET Web
API framework includes a new HTTP Client. HTTP Client can
be used on the server-side of ASP, MVC, in Windows Form
applications, Console applications, and other apps.
ASP .NET Web API Characteristics
ASP .NET Web API Versions
Web API Version Supported .NET
Framework
Coincides with Supported in
Web API 1.0 .NET Framework 4.0 ASP.NET MVC 4 VS 2010
Web API 2 - Current .NET Framework 4.5 ASP.NET MVC 5 VS 2012, 2013
ASP .NET Web API vs WCF
Web API WCF
It is open source and comes with the.NET
framework.
The.NET framework is included.
Only the HTTP protocol is supported. HTTP, TCP, UDP, and custom transport protocols
are all supported.
Http verbs to methods mapping The attributes-based programming model is
used.
Like ASP.NET MVC, it employs a routing and
controller concept.
Contracts for Service, Operation, and Data are
used.
It does not support Reliable Messaging or
transactions.
Reliable Messaging and Transactions are
supported.
The HTTP Configuration class can configure web
APIs, but not web. Config.
To configure a service, use the web. Config and
attributes.
It's ideal for creating RESTful services. RESTful services are supported but with
limitations.
ASP .NET Web API vs WCF
If you're using.NET Framework 3.5, go with WCF. Web API
does not work with.NET 3.5 or lower.
ASP .NET Web API vs WCF
If your service must support multiple protocols, such as
HTTP, TCP, and Named Pipes, use WCF.
ASP .NET Web API vs WCF
Choose WCF if you want to create services that adhere to
WS-* standards such as Reliable Messaging, Transactions,
and Message Security.
ASP .NET Web API vs WCF
If you want to use the Request-Reply, One-Way, and Duplex
message exchange patterns, go with WCF.
When to Choose ASP .NET Web API
If you are using.NET framework 4.0 or higher, select Web
API.
If you want to build a service that only supports the HTTP
protocol, goes with Web API.
When to Choose ASP .NET Web API
To create RESTful HTTP-based services, use Web API.
When to Choose ASP .NET Web API
If you're familiar with ASP.NET MVC, go with Web API.
When to Choose ASP .NET Web API
C# web api
C# web api

C# web api

  • 3.
  • 4.
  • 5.
    Agenda ASP .NET WebAPI Characteristics
  • 6.
  • 7.
  • 8.
    When to chooseASP.NET Web API? Agenda
  • 10.
    What is WebAPI? An application programming interface (API) is a set of subroutine definitions, protocols, and tools for developing software and applications in computer programming.
  • 11.
    What is WebAPI? API is a type of interface with a set of functions that allow programmers to access specific features or data of an application, operating system, or other services.
  • 12.
    What is WebAPI? As the name implies, Web API is a web-based API that can be accessed via the HTTP protocol. It is a concept rather than a technology. We can create Web APIs using various technologies such as Java, NET, and others. Twitter's REST APIs, for example, provide programmatic access to read and write data, allowing us to integrate Twitter's capabilities into our application.
  • 14.
    ASP .NET WebAPI Web API HTTP Response Data (JSON/XML/Other Format) HTTP Request HTTP Response Data (JSON/XML/Other Format) HTTP Request HTTP Request HTTP Response Data (JSON/XML/Other Format) The ASP.NET Web API is an extensible framework for creating HTTP-based services that can be accessed in various applications on various platforms such as web, windows, mobile etc. Web Application Mobile Application Win Form Application
  • 15.
    ASP .NET WebAPI It functions similarly to an ASP.NET MVC web application, except it sends data as a response instead of an HTML view. It functions similarly to a web service or WCF service, except it only supports the HTTP protocol. Web API HTTP Response Data (JSON/XML/Other Format) HTTP Request HTTP Response Data (JSON/XML/Other Format) HTTP Request HTTP Request HTTP Response Data (JSON/XML/Other Format) Web Application Mobile Application Win Form Application
  • 17.
    The ASP.NET WebAPI platform is ideal for developing RESTful services. ASP .NET Web API Characteristics
  • 18.
    ASP.NET Web APIis based on ASP.NET and supports the ASP.NET request/response pipeline. HTTP verbs are translated into method names by ASP.NET Web API. ASP .NET Web API Characteristics
  • 19.
    The ASP.NET WebAPI supports a variety of response data formats. JSON, XML, and BSON format support is built-in. ASP .NET Web API Characteristics
  • 20.
    ASP.NET Web APIcan be hosted in IIS, Self-hosted, or any other web server that supports.NET 4.0 or higher. ASP .NET Web API Characteristics
  • 21.
    To communicate withthe Web API server, the ASP.NET Web API framework includes a new HTTP Client. HTTP Client can be used on the server-side of ASP, MVC, in Windows Form applications, Console applications, and other apps. ASP .NET Web API Characteristics
  • 23.
    ASP .NET WebAPI Versions Web API Version Supported .NET Framework Coincides with Supported in Web API 1.0 .NET Framework 4.0 ASP.NET MVC 4 VS 2010 Web API 2 - Current .NET Framework 4.5 ASP.NET MVC 5 VS 2012, 2013
  • 25.
    ASP .NET WebAPI vs WCF Web API WCF It is open source and comes with the.NET framework. The.NET framework is included. Only the HTTP protocol is supported. HTTP, TCP, UDP, and custom transport protocols are all supported. Http verbs to methods mapping The attributes-based programming model is used. Like ASP.NET MVC, it employs a routing and controller concept. Contracts for Service, Operation, and Data are used. It does not support Reliable Messaging or transactions. Reliable Messaging and Transactions are supported. The HTTP Configuration class can configure web APIs, but not web. Config. To configure a service, use the web. Config and attributes. It's ideal for creating RESTful services. RESTful services are supported but with limitations.
  • 26.
    ASP .NET WebAPI vs WCF If you're using.NET Framework 3.5, go with WCF. Web API does not work with.NET 3.5 or lower.
  • 27.
    ASP .NET WebAPI vs WCF If your service must support multiple protocols, such as HTTP, TCP, and Named Pipes, use WCF.
  • 28.
    ASP .NET WebAPI vs WCF Choose WCF if you want to create services that adhere to WS-* standards such as Reliable Messaging, Transactions, and Message Security.
  • 29.
    ASP .NET WebAPI vs WCF If you want to use the Request-Reply, One-Way, and Duplex message exchange patterns, go with WCF.
  • 31.
    When to ChooseASP .NET Web API If you are using.NET framework 4.0 or higher, select Web API.
  • 32.
    If you wantto build a service that only supports the HTTP protocol, goes with Web API. When to Choose ASP .NET Web API
  • 33.
    To create RESTfulHTTP-based services, use Web API. When to Choose ASP .NET Web API
  • 34.
    If you're familiarwith ASP.NET MVC, go with Web API. When to Choose ASP .NET Web API