RESTful Online Quiz



Following quiz provides Multiple Choice Questions (MCQs) related to RESTful Framework. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.

Questions and Answers

Q 2 - Which of the following component of HTTP request contains message content or Resource representation?

A - Request Body

B - URI

C - HTTP Version

D - Request Header

Answer : A

Explanation

Request Body − Message content or Resource representation.

Answer : C

Explanation

Addressing refers to locating a resource or multiple resources lying on the server. It is analogous to locate a postal address of a person.

Q 4 - Which of the following HTTP method should be used to get status of method availability in RESTful web service?

A - GET

B - HEAD

C - PUT

D - OPTIONS

Answer : B

Explanation

HEAD opearations should be used to get status of method availability in RESTful web service.

Q 5 - Which of the following directive of Cache Control Header of HTTP response provides indication to server to revalidate resource if max-age has passed?

A - must-revalidate

B - Private

C - no-cache/no-store

D - max-age

Answer : A

Explanation

must-revalidate directive provides indication to server to revalidate resource if max-age has passed.

Q 6 - Which of the following HTTP Status code means CREATED, when a resource is successful created using POST or PUT request?

A - 200

B - 201

C - 204

D - 304

Answer : B

Explanation

HTTP Status Code 201 means CREATED, when a resource is successful created using POST or PUT request.

Q 7 - Which of the following annotation of JAX RS API is used to annotate a method used to fetch resource?

A - @Path

B - @GET

C - @PUT

D - @POST

Answer : B

Explanation

@GET − HTTP Get request, used to fetch resource.

Q 8 - Which of the following annotation of JAX RS API binds the parameter passed to method to a HTTP header?

A - @PathParam

B - @QueryParam

C - @MatrixParam

D - @HeaderParam

Answer : D

Explanation

@HeaderParam − Binds the parameter passed to method to a HTTP header.

Q 9 - Which of the following annotation of JAX RS API is used to inject a context of the resource for example HTTPRequest as a context

A - @CookieParam

B - @FormParam

C - @DefaultValue

D - @Context

Answer : D

Explanation

@Context − Context of the resource for example HTTPRequest as a context.

Q 10 - POST opearations should be idempotent.

A - true

B - false

Answer : B

Explanation

POST operation can cause different result.

restful_questions_answers.htm
Advertisements