Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Web API

Total questions: 10

Worksheet time: 7mins

Name
Class
Date
1.

Are models automatically validated if [ApiController] attribute is used for controller class

a)

Yes

b)

No

c)

It has no effect on model validation

2.

ApiController attribute provides automatic HTTP ___ responses

a)

400

b)

401

c)

402

d)

403

e)

404

3.

Is it mandatory to use attribute base routing when using [ControllerApi]?

a)

Yes

b)

No

c)

Such attribute doesn`t exist

d)

Attribute base routing doesn`t exist

4.

What means status code 403 Forbidden?

a)

Error while executing the request

b)

Resource not found

c)

Access denied

d)

User is not logged in

5.

Which datatype is used more often in WebAPI to represent responce?

a)

JSON

b)

HTML

c)

XML

d)

Plain text

6.

Select binding source attributes.

a)

[FromHeader]

b)

[FromRoute]

c)

[FromModel]

d)

[FromAction]

e)

[FromServices]

7.

Which method returns 400 status code?

(a)  

8.

Which request HTTP header advertises which content types the client can understand?

(a)  

9.

Which method should we call in the Configure method to enable controller routing?

(a)  

10.

What data type returns the Ok() method?

a)

ObjectResult

b)

ActionResult

c)

OkResult

d)

RequestResult