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

Answer : D

Explanation

Web services based on REST Architecture are known as RESTful web services. These web services use HTTP methods to implement the concept of REST architecture. A RESTful web service usually defines a URI, Uniform Resource Identifier a service, provides resource representation such as JSON and set of HTTP Methods.

Q 2 - Which of the following component of HTTP request contains metadata for the HTTP Request message as key-value pairs?

A - VERB

B - URI

C - HTTP Version

D - Request Header

Answer : D

Explanation

Request Header − Contains metadata for the HTTP Request message as key-value pairs. For example, client ( or browser) type, format supported by client, format of message body, cache settings etc.

Answer : C

Explanation

Each resource in REST architecture is identified by its URI. Purpose of an URI is to locate a resource(s) on the server hosting the web service.

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 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 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 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 - A web service is a collection of open protocols and standards used for exchanging data between applications or systems.

A - true

B - false

Answer : A

Explanation

A web service is a collection of open protocols and standards used for exchanging data between applications or systems.

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