.Net Interview Questions
Open in Telegram
1 794
Subscribers
+124 hours
+207 days
+4930 days
Posts Archive
AJAX
In Ajax, the request are sent to the server by using XMLHttpRequest objects. The response is used by the JavaScript code to dynamically alter the current page
Ajax is a set of technology; it is a technique of dynamically updating parts of UI without having to reload the page
Ajax eliminates the interaction between the customer and server asynchronously
REST
REST have a URL structure and a request/response pattern the revolve around the use of resources
REST is a type of software architecture and a method for users to request data or information from servers
REST requires the interaction between the customer and server
Web API is generally considered as a service that basically provides us information or data from the server. It is very important because of the following reasons:
• It is used to provide an interface for websites and client applications to have access to data.
• It can also be used to access data from the database and save data back to the database.
• It supports different text formats such as XML, JSON, etc.
• It is suitable or compatible with any type of browser and any type of device like mobile, desktop, web, etc.
• It uses low bandwidth such as XML or JSON data, etc., and is therefore considered good for devices that have limited bandwidth such as smartphones, etc.
❇2⃣2⃣5⃣ What is WebAPI
WebAPI is the technology by which you can expose data over HTTP following REST principles.
No, you are not supposed to use PUT for GET. GET operations should only have view rights, while PUT resource is used for updating a data.
❇2⃣2⃣4⃣ Mention whether you can use GET request instead of PUT to create a resource?
Some of the advantages of REST web services are:
• Learning curve is easy since it works on HTTP protocol
• Supports multiple technologies for data transfer such as text, xml, json, image etc.
• No contract defined between server and client, so loosely coupled implementation.
• REST is a lightweight protocol
• REST methods can be tested easily over browser.
A Service Oriented Architecture (SOA) is basically defined as an architectural pattern consisting of services. Here application components provide services to the other components using communication protocol over the network. This communication involves data exchanging or some coordination activity between services.
Some of the key principles on which SOA is based are mentioned below.
• The service contract should be standardized containing all the description of the services.
• There is loose coupling defining the less dependency between the web services and the client.
• It should follow Service Abstraction rule, which says the service should not expose the way functionality has been executed to the client application.
• Services should be reusable in order to work with various application types.
• Services should be stateless having the feature of discoverability.
• Services break big problems into little problems and allow diverse subscribers to use the services.
A HTTP Request has five major parts −
• Verb − Indicate HTTP methods such as GET, POST, DELETE, PUT etc.
• URI − Uniform Resource Identifier (URI) to identify the resource on server.
• HTTP Version − Indicate HTTP version, for example HTTP v1.1.
• Request Header − Contains metadata for the HTTP Request message as key-value pairs. For example, client (or browser) type, format supported by client, format of message body, cache settings etc.
• Request Body − Message content or Resource representation
API design is the process of building an intermediary interface for a system to system connection to expose data to application users and developers.
Razor syntax makes use of @* to indicate the begining of a comment and *@ to indicate the end. An example is shown below.
@* This is a Comment *@
