WebAPI & REST Flashcards

1
Q

What is WebAPI ?

A

Web API controller delivers data and services easily by using HTTP REST services.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the advantage of WebAPI ?

A

HTTP is a most used protocol so by exposing your service over HTTP any nature of clients
can consume it , making it a true client server model. So your client can now be a mobile app
or app made in JS frameworks like react/Angular or must be a simple browser , every one
can integrate with WebAPI seamlessly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Explain REST and Architectural constraints of REST?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Can we use UDP/TCPIP protocol with Web API?

A

NO

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How WebAPI different from MVC controller ?

A

In MVC Controller we can return RAZOR views but in WebAPI we can not return Views.
WebAPI follows REST principles and does things like content negotiations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is content negotiations in Web API ?

A

Content negotiations looks at client accept type and depending on the client accept type it
provides data format. So if in the accept client sends XML it will send XML , if it sends
JSON it will send JSON.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

WebAPI vs WCF ?

A

WCF was meant for SOA , XML is compulsory format and support any protocol.
WebAPI was meant for REST, No compulsion on Format and supports only HTTP protocol.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

WCF REST vs WebAPI REST ?

A

WCF REST was creates to ensure that old legacy WCF can be REST enabled , While
WebAPI was built from scratch to serve REST architecture.For new project use WebAPI. If
you want to make legacy WCF compatible with REST you will used WCF REST.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How to return HTTP status codes ?

A

return StatusCode(StatusCodes.Status200OK,”Test”);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

For error which status code is returned ?

A

500 internal server error.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How did you secure your web API ?

A

By using JWT token.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do current JS frameworks work with webAPI ?

A

Client side is built usin JS frameworks like Angular , React and they communicate to MVC
using HTTP.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Further questions for self learning.

A
  • What is the difference between creating .net std library and .net core library?
  • what is use of UseRouting and UseEndpoints in Startup Configure method
  • How to store ServiceCollection in different location other than ConfigureServices method
  • What is ViewComponent? and can we inject Dependency in ViewComponent?
  • how to use in-memory cache in asp.net core
  • how to store object in session other than string and int in asp.net core.
  • how to create CUSTOM MIDDLEWARE in ASP.NET CORE
  • use of launchsetting.json in ASP.NET Core
  • how to configure runtime compilation of views while development. :- AddRazorRuntimeCompilation();
  • Health checks
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

ASYNCACTIONFILTER IN ASP.NET CORE MVC

A

How to Secure asp.net core with oAuth2.0 and what is oAuth middle ware
2. Authentication in asp.net core web api and OWIN
3. Explain factory pattern using built - in DI in asp.net core
.csproj file, and it’s importance in .net core. comparison of .csproj file with previous version of .net
Ways of implementing versioning in Asp.net core Api

What is IOption in ASP.NET core

How well did you know this?
1
Not at all
2
3
4
5
Perfectly