Você está na página 1de 5

Question# 1:

Web API supports which of the following protocol?

1. TCP
2. HTTP
3. Soap
4. All of the above

Correct Answer: HTTP

Question# 2:
Web API supports which of the following request/response data formats by
default?

1. JSON
2. XML
3. BSON
4. All of the above

Correct Answer: All of the above

Question# 2:
Web API supports which of the following request/response data formats by
default?

1. JSON
2. XML
3. BSON
4. All of the above

Correct Answer: All of the above

Question# 4:
Which of the following statement is TRUE?

1. Web API can be configured using web.config.


2. Web API can only be configured by code.
3. Web API can be configured using app.config.
4. None of the above

Correct Answer: Web API can only be configured by code.


Question# 5:
Web API uses which of the following open-source library for JSON
serialization?

1. Json.NET
2. JsonFormatter.NET
3. GetJson.NET
4. None of the above

Correct Answer: Json.NET

Question# 6:
Web API controller must be derived from __________.

1. Controller class
2. ApiController class
3. WebApiController class
4. WebController class

Correct Answer: ApiController class

Question# 7:
Which of the following types of routing is supported in Web API 2?

1. Attribute Routing
2. Convention-based Routing
3. All of the above
4. None of the above

Correct Answer: All of the above

Question# 8:
Which of the following types are valid response types of Web API 2 action
method?

1. HttpResponseMessage
2. IHttpActionResult
3. Custom types
4. All of the above

Correct Answer: All of the above


Question# 9:
Which of the following action method names are valid to handle HTTP GET
request?

1. Get
2. GetAllStudents
3. GetStudent
4. all of the above

Correct Answer: all of the above

Question# 10:
Web API sends which of the following status code on successful execution?

1. 200
2. 201
3. 500
4. 404

Correct Answer: 200

Question# 11:
Which of the following is a formatter class for JSON?

1. JsonMediaTypeFormatter
2. JsonMediaFormatter
3. Json.Net
4. None of the above

Correct Answer: JsonMediaTypeFormatter

Question# 12:
Which of the following property returns all the formatters in Web API?

1. GlobalConfiguration.Configuration.JsonFormatter
2. Configuration.Formatters
3. GlobalConfiguration.Formatters
4. GlobalConfiguration.Configuration.Formatters

Correct Answer: GlobalConfiguration.Configuration.Formatters


Question# 13:
Web API Filters are used ____________.

1. to add an extra logic before or after action method executes


2. to provide authentication and authorization.
3. to Launch Web API
4. to host Web API

Correct Answer: to add an extra logic before or after action method


executes

Question# 14:
Web API extract the values of primitive type parameters of an action
method from _____ by default.

1. HTTP Request Body


2. HTTP Header
3. Message Header
4. Query String

Correct Answer: Query String

Question# 15:
Web API extract the values of complex type parameters of an action
method from _____ by default.

1. HTTP Request Body


2. HTTP Header
3. Message Header
4. Query String

Correct Answer: HTTP Request Body

Question# 16:
By default, Web API sends HTTP response with which of the following status
code for all uncaught exception?

1. 404 - Not Found


2. 500 - Internal Server Error
3. 204 - No content.
4. None of the above

Correct Answer: 500 - Internal Server Error


Question# 17:
Which of the following is used to check the validity of the model in Web
API?

1. Mode.Valid
2. Model.IsValid
3. ModelState.IsValid
4. ModelState.Valid

Correct Answer: ModelState.IsValid

Question# 18:
Web API 2 is supported in _______.

1. .NET 4.5
2. .NET 4.0
3. .NET 3.5
4. .NET 3.0

Correct Answer: .NET 4.5

Question# 19:
Which of the following is true?

1. Web API can be self-host.


2. Web API can be host in IIS.
3. Web API can be host in any web server that supports .NET Framework.
4. All of the above

Correct Answer: All of the above

Question# 20:
Which of the following class is used to send HTTP requests in .NET 4.5?

1. WebClient
2. HttpClient
3. MessageClient
4. None of the above

Correct Answer: HttpClient

Você também pode gostar