RESTful Online Quiz


Advertisements

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 1 - Which of the following is not a valid HTTP methods used in RESTful web services?

A - GET

B - PUT

C - TIME

D - POST

Answer : C

Explanation

TIME is not a HTTP Verb and is not a valid HTTP methods used in RESTful web services.

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.

Q 3 - Which of the following HTTP method should be idempotent in nature?

A - GET

B - PUT

C - POST

D - HEAD

Answer : B

Explanation

PUT opearations should be idempotent, means their result will always same no matter how many times these operations are invoked.

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 header of HTTP response sets expiration date and time of caching?

A - Date

B - Last Modified

C - Cache-Control

D - Expires

Answer : D

Explanation

Expires header sets expiration date and time of caching.

Q 6 - Which of the following HTTP Status code means BAD REQUEST, states that invalid input is provided e.g. validation error, missing data?

A - 400

B - 401

C - 404

D - 409

Answer : A

Explanation

HTTP Status Code 400 means BAD REQUEST, states that invalid input is provided e.g. validation error, missing data.

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

A - @Path

B - @GET

C - @PUT

D - @POST

Answer : C

Explanation

@PUT − HTTP Get request, used to create resource.

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

A - @PathParam

B - @QueryParam

C - @MatrixParam

D - @HeaderParam

Answer : C

Explanation

@MatrixParam − Binds the parameter passed to method to a HTTP matrix parameter in path.

Q 9 - URI of HTTP request indicates HTTP methods to be executed by RESTful Web services.

A - false

B - true

Answer : A

Explanation

HTTP Verb − Indicates HTTP methods such as GET, POST, DELETE, PUT etc.

Q 10 - GET opearations should be readonly.

A - true

B - false

Answer : A

Explanation

GET opearations should be readonly.

restful_questions_answers.htm
Advertisements