0% found this document useful (0 votes)
4 views2 pages

Web API Interview Questions

The document provides an overview of Web API, highlighting its purpose to expose data over HTTP using REST principles, distinguishing it from WCF and ASP.NET MVC. It outlines advantages of using Web API, such as OData support and content negotiation, and explains HTTP methods used in RESTful APIs. Additionally, it includes instructions for unit testing Web API methods using Fiddler for both JSON and XML content types.

Uploaded by

jojivarghesein
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

Web API Interview Questions

The document provides an overview of Web API, highlighting its purpose to expose data over HTTP using REST principles, distinguishing it from WCF and ASP.NET MVC. It outlines advantages of using Web API, such as OData support and content negotiation, and explains HTTP methods used in RESTful APIs. Additionally, it includes instructions for unit testing Web API methods using Fiddler for both JSON and XML content types.

Uploaded by

jojivarghesein
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

8/19/2020 Web API Interview questions

What is WebAPI?
Web API is the technology by which you can expose data over HTTP following REST principles
2. With WCF also you can implement REST, So why WebAPI?
WCF was brought in to implement SOA, never the intention was to implement REST.
WebAPI is built from Scratch and the only goal is to create HTTP services using REST.
3. What is the difference between [Link] MVC Vs [Link] WebAPI?
MVC vs [Link] WebAPI
[Link] MVC [Link] WebAPI
used to create web applications that returns both view and data used to create HTTP services, It returns only data.
return data in json format using jsonResult return data in JSON, XML
Requests are mapped to actions name. Requests are mapped to the actions based on HTTP verbs

4. WebAPI where is the proxy?


Web API doesn't make it easy for consumers to generate a service client like a SOAP WSDL does.
If you're only ever going to have .NET clients it's not a big deal because they can share the contract objects you
implement, but other language clients will need to manually create their client objects if you don't use SOAP
5. What are the Advantages using WebAPI?
OData support (via Queryable attribute)
Content Negotiation
Filters
Model binding and validation
Ability to self host outside of IIS
Link generation to related resources that incorporates routing rules
Full support for routes/routing
Ability to create custom help and test pages using IApiExplorer
6. What are the Http methods used to implement a RESTful API
RESTful API HTTP methods
Resource GET PUT POST DELETE
Collection URI, such Listthe URIs and perhaps Replace the entire Create a new entry in the Delete the
as [Link] other details of the collection with collection. The new entry's entire
collection's members. another URI is assigned collection.
collection. automatically and is usually
returned by the operation.
Element URI, such Retrievea representation of Replace the Not generally used. Treat Delete the
as [Link] item17 the addressed member of addressed the addressed member as a addressed
the collection, expressed inmember of the collection in its own right member of
an appropriate Internet collection, or if it and create a new entry in it. the
media type. doesn't collection.
exist, create it.
The PUT and DELETE methods are idempotent methods. The GET method is a safe method (or nullipotent), meaning that
calling it produces no side-effects. source :
[Link]
7. How to unit test the WebAPI method using Fiddler - Content-type:application/json?

[Link]/FAQs/WebAPI 1/2
8/19/2020 Web API Interview questions

Fiddler 2 tool -> Compooser Tab - > Enter Request Headers


- > Enter Request Body

8. How to unit test the WebAPI method using Fiddler - Content-type:application/xml?


Fiddler 2 tool -> Compooser Tab - > Enter Request Headers
- > Enter Request Body

Comments and Discussions

[Link]/FAQs/WebAPI 2/2

You might also like