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

A - OPTIONS

B - DELETE

C - DATE

D - POST

Answer : C

Explanation

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

Q 2 - Which of the following protocol is used by RESTful web services as a medium of communication between client and server?

A - HTTP

B - FTP

C - Gopher

D - None of the above.

Answer : A

Explanation

RESTful web services make use of HTTP protocol as a medium of communication between client and server.

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 create resource using RESTful web service?

A - GET

B - DELETE

C - PUT

D - OPTIONS

Answer : C

Explanation

PUT opearations should be used to create resource using RESTful web service.

Answer : D

Explanation

All of the above options are correct.

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 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 query parameter in path?

A - @PathParam

B - @QueryParam

C - @MatrixParam

D - @HeaderParam

Answer : B

Explanation

@QueryParam − Binds the parameter passed to method to a query parameter in path.

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 - Request Body - Contains Message content or Resource representation.

A - true

B - false

Answer : A

Explanation

Request Body − Contains Message content or Resource representation.

restful_questions_answers.htm
Advertisements