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

Answer : C

Explanation

A web service is a collection of open protocols and standards used for exchanging data between applications or systems. Software applications written in various programming languages and running on various platforms can use web services to exchange data over computer networks like the Internet in a manner similar to inter-process communication on a single computer.

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 4 - Which of the following HTTP method should be used to delete resource using RESTful web service?

A - GET

B - DELETE

C - POST

D - OPTIONS

Answer : B

Explanation

DELETE opearations should be used to delete resource using RESTful web service.

Q 5 - Which of the following directive of Cache Control Header of HTTP response indicates that resource is cachable by only client and server?

A - Public

B - Private

C - no-cache/no-store

D - max-age

Answer : B

Explanation

Private directive indicates that resource is cachable by only client and server, no intermediary can cache the resource.

Q 6 - Which of the following HTTP Status code means OK, shows success?

A - 200

B - 201

C - 204

D - 304

Answer : A

Explanation

HTTP Status Code 200 means OK, shows success.

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 states the HTTP Request type?

A - @DELETE

B - @HEAD

C - @Produces

D - @Consumes

Answer : D

Explanation

@Consumes − States the HTTP Request type, for example application/x-www-form-urlencoded to accept form data in HTTP body during POST request.

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 - Status/Response Code - Indicate Server status for the requested resource.

A - false

B - true

Answer : B

Explanation

Status/Response Code − Indicate Server status for the requested resource.

restful_questions_answers.htm
Advertisements