RESTful

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

B

Q 1 - What REST stands for? A - Represent State Transfer B - REpresentational State Transfer C - Represent State Transfer D - None of the above.

C

Q 1 - Which of the following is a best practice for designing a secure RESTful web service? A - Validation - Validate all inputs on the server. Protect your server against SQL or NoSQL injection attacks. B - Session based authentication - Use session based authentication to authenticate a user whenever a request is made to a Web Service method. C - Both of the above. D - None of the above.

C

Q 10 - Which of the following HTTP Status code means NOT FOUND, states that method is not available? A - 400 B - 401 C - 404 D - 409

B

Q 10 - Which of the following depicts best practice, Completeness for resource representation in REST? A - Both Server and Client should be able to understand and utilize the representation format of the resource. B - Format should be able to represent a resource completely. For example, a resource can contain another resource. Format should be able to represent simple as well as complex structures of resources. C - A resource can have a linkage to another resource, a format should be able to handles such situations. D - None of the above.

D

Q 11 - Which of the following HTTP Status code means CONFLICT, states conflict situation while executing the method for example, adding duplicate entry? A - 400 B - 401 C - 404 D - 409

C

Q 11 - Which of the following depicts best practice, Linkablity for resource representation in REST? A - Both Server and Client should be able to understand and utilize the representation format of the resource. B - Format should be able to represent a resource completely. For example, a resource can contain another resource. Format should be able to represent simple as well as complex structures of resources. C - A resource can have a linkage to another resource, a format should be able to handles such situations. D - None of the above.

A

Q 12 - Which of the following HTTP Status code means INTERNAL SERVER ERROR, states that server has thrown some exception while executing the method? A - 500 B - 401 C - 404 D - 409

A

Q 12 - 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.

C

Q 13 - What JAX-RS stands for? A - Just API for RESTful Web Services. B - Joint API for RESTful Web Services. C - JAVA API for RESTful Web Services. D - None of the above.

C

Q 13 - Which of the following is correct about messaging in RESTful web services? A - A client sends a message in form of a HTTP Request and server responds in form of a HTTP Response. B - These messages contain message data and metadata i.e. information about message itself. C - Both of the above. D - None of the above.

A

Q 14 - Which of the following component of HTTP request indicates HTTP methods such as GET, POST, DELETE, PUT etc.? A - VERB B - URI C - HTTP Version D - Request Header

C

Q 14 - Which of the following is correct about JAX-RS? A - JAX-RS is a JAVA based programming language API and specification to provide support for created RESTful Webservices. B - Its 2.0 version was released in 24 May 2013. C - Both of the above. D - None of the above.

B

Q 15 - Which of the following component of HTTP request is used to identify the resource on server? A - VERB B - URI C - HTTP Version D - Request Header

C

Q 15 - Which of the following is correct about JAX-RS? A - JAX-RS makes heavy use of annotations available from Java SE 5 to simplify development of JAVA based web services creation and deployment. B - It also provides supports for creating clients for RESTful web services. C - Both of the above. D - None of the above.

A

Q 16 - Which of the following annotation of JAX RS API is used to annotate a method to get the relative path of the resource class/method? A - @Path B - @GET C - @PUT D - @POST

C

Q 16 - Which of the following component of HTTP request is used to indicate HTTP version? A - VERB B - URI C - HTTP Version D - Request Header

B

Q 17 - 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

D

Q 17 - 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

C

Q 18 - 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

A

Q 18 - 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

D

Q 19 - Which of the following annotation of JAX RS API is used to annotate a method used to create/update resource? A - @Path B - @GET C - @PUT D - @POST

A

Q 19 - Which of the following component of HTTP response indicates server status for the requested resource? A - Status/Response Code B - HTTP Version C - Response Header D - Response Body

C

Q 2 - Which of the following is a best practice for designing a secure RESTful web service? A - No sensitive data in URL - Never use username, password or session token in URL , these values should be passed to Web Service via POST method. B - Restriction on Method execution - Allow restricted use of methods like GET, POST, DELETE. GET method should not be able to delete data. C - Both of the above. D - None of the above.

D

Q 2 - Which of the following is true about REST? A - REST is web standards based architecture and uses HTTP Protocol for data communication. B - It revolves around resource where every component is a resource and a resource is accessed by a common interface using HTTP standard methods. C - REST was first introduced by Roy Fielding in 2000. D - All of the above.

A

Q 20 - Which of the following annotation of JAX RS API is used to annotate a method used to delete resource? A - @DELETE B - @HEAD C - @Produces D - @Consumes

B

Q 20 - Which of the following component of HTTP response indicates HTTP version? A - Status/Response Code B - HTTP Version C - Response Header D - Response Body

B

Q 21 - Which of the following annotation of JAX RS API is used to get status of method availability? A - @DELETE B - @HEAD C - @Produces D - @Consumes

C

Q 21 - Which of the following component of HTTP response contains metadata for the HTTP Response message as key-value pairs? A - Status/Response Code B - HTTP Version C - Response Header D - Response Body

C

Q 22 - Which of the following annotation of JAX RS API states the HTTP Response generated by web service? A - @DELETE B - @HEAD C - @Produces D - @Consumes

D

Q 22 - Which of the following component of HTTP response contains response message content or Resource representation? A - Status/Response Code B - HTTP Version C - Response Header D - Response Body

D

Q 23 - Which of the following annotation of JAX RS API states the HTTP Request type? A - @DELETE B - @HEAD C - @Produces D - @Consumes

C

Q 23 - Which of the following is correct about addressing in RESTful web services? A - Addressing refers to locating a resource or multiple resources lying on the server. B - It is analogous to locate a postal address of a person. C - Both of the above. D - None of the above.

C

Q 24 - What URI stands for? A - Unit Resource Identifier B - Uniform Representation Identifier C - Uniform Resource Identifier D - None of the above.

A

Q 24 - Which of the following annotation of JAX RS API binds the parameter passed to method to a value in path? A - @PathParam B - @QueryParam C - @MatrixParam D - @HeaderParam

B

Q 25 - 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

C

Q 25 - Which of the following is correct about URI in RESTful web services? A - Each resource in REST architecture is identified by its URI. B - Purpose of an URI is to locate a resources on the server hosting the web service. C - Both of the above. D - None of the above.

C

Q 26 - 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

D

Q 26 - Which of the following is a best practice to create a standard URI for a web service? A - Use Plural Noun. B - Avoid using spaces. C - Use lowercase letters D - All of the above.

D

Q 27 - 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

C

Q 27 - Which of the following is a best practice to create a standard URI for a web service? A - Maintain Backward Compatibility B - Use HTTP Verb C - Both of the above. D - None of the above.

A

Q 28 - Which of the following annotation of JAX RS API binds the parameter passed to method to a Cookie? A - @CookieParam B - @FormParam C - @DefaultValue D - @Context

C

Q 28 - Which of the following is correct about statelessness in context of RESTful web service? A - As per REST architecture, a RESTful web service should not keep a client state on server. B - It is responsibility of the client to pass its context to server and then server can store this context to process client's further request. C - Both of the above. D - None of the above.

B

Q 29 - Which of the following annotation of JAX RS API binds the parameter passed to method to a form value? A - @CookieParam B - @FormParam C - @DefaultValue D - @Context

D

Q 29 - Which of the following is advantage of RESTful web service being stateless? A - Web services can treat each method request independently. B - Web services need not to maintain client's previous interactions. It simplifies application design. C - As HTTP is itself a statelessness protocol, RESTful Web services work seamlessly with HTTP protocol. D - All of the above.

C

Q 3 - Which of the following is a best practice for designing a secure RESTful web service? A - Validate Malformed XML/JSON - Check for well formed input passed to a web service method. B - Throw generic Error Messages - A web service method should use HTTP error messages like 403 to show access forbidden etc. C - Both of the above. D - None of the above.

D

Q 3 - Which of the following is true about REST? A - In REST architecture, a REST Server simply provides access to resources and REST client accesses and presents the resources. B - Each resource is identified by URIs/ global IDs. C - REST uses various representations to represent a resource like text, JSON and XML. D - All of the above.

B

Q 30 - Which of the following HTTP method should be idempotent in nature? A - GET B - PUT C - POST D - HEAD

C

Q 30 - Which of the following annotation of JAX RS API assigns a default value to a parameter passed to method? A - @CookieParam B - @FormParam C - @DefaultValue D - @Context

B

Q 31 - Which of the following HTTP method should be idempotent in nature? A - OPTIONS B - DELETE C - POST D - HEAD

D

Q 31 - 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

B

Q 32 - REST is web standards based architecture and uses HTTP Protocol for data communication. A - false B - true

A

Q 32 - Which of the following HTTP method should be read only in nature? A - GET B - DELETE C - POST D - PUT

B

Q 33 - In REST architecture, a REST Server simply provides access to resources and REST client accesses and presents the resources. A - false B - true

C

Q 33 - Which of the following HTTP method should be used to create/update resource using RESTful web service? A - GET B - DELETE C - POST D - OPTIONS

A

Q 34 - A web service is a collection of open protocols and standards used for exchanging data between applications or systems. A - true B - false

B

Q 34 - Which of the following HTTP method should be used to delete resource using RESTful web service? A - GET B - DELETE C - POST D - OPTIONS

A

Q 35 - RESTful web services use HTTP methods to implement the concept of REST architecture. A - true B - false

C

Q 35 - Which of the following HTTP method should be used to create resource using RESTful web service? A - GET B - DELETE C - PUT D - OPTIONS

B

Q 36 - A RESTful web service usually defines a URI, Uniform Resource Identifier a service, provides resource representation such as JSON and set of HTTP Methods. A - false B - true

A

Q 36 - Which of the following HTTP method should be used to fetch resource using RESTful web service? A - GET B - DELETE C - PUT D - OPTIONS

B

Q 37 - RESTful web services make use of FTP protocol as a medium of communication between client and server. A - true B - false

B

Q 37 - 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

B

Q 38 - A RESTful web service client sends a message in form of a Gopher Request and server responds in form of a HTTP Response. A - true B - false

D

Q 38 - Which of the following HTTP method should be used to get list the supported operations in RESTful web service? A - GET B - HEAD C - PUT D - OPTIONS

A

Q 39 - URI of HTTP request indicates HTTP methods to be executed by RESTful Web services. A - false B - true

C

Q 39 - Which of the following is true about caching in RESTful web service? A - Caching refers to storing server response in client itself so that a client needs not to make server request for same resource again and again. B - A server response should have information about how a caching is to be done so that a client caches response for a period of time or never caches the server response. C - Both of the above. D - None of the above.

A

Q 4 - Which of the following HTTP Status code means OK, shows success? A - 200 B - 201 C - 204 D - 304

C

Q 4 - Which of the following is not a valid HTTP methods used in RESTful web services? A - GET B - PUT C - TIME D - POST

B

Q 40 - Request Header - Contains metadata for the HTTP Request message as keyvalue pairs. A - false B - true

A

Q 40 - Which of the following header of HTTP response, provides the date and time of the resource when it was created? A - Date B - Last Modified C - Cache-Control D - Expires

B

Q 41 - Status/Response Code - Indicate Server status for the requested resource. A - false B - true

B

Q 41 - Which of the following header of HTTP response, provides the date and time of the resource when it was last modified? A - Date B - Last Modified C - Cache-Control D - Expires

A

Q 42 - Response Header - Contains metadata for the HTTP Response message as keyvalue pairs. A - true B - false

C

Q 42 - Which of the following header of HTTP response provides control over caching? A - Date B - Last Modified C - Cache-Control D - Expires

A

Q 43 - Request Body - Contains Message content or Resource representation. A - true B - false

D

Q 43 - 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

A

Q 44 - Each resource in REST architecture is identified by its URI. A - true B - false

A

Q 44 - Which of the following directive of Cache Control Header of HTTP response indicates that resource is cachable by any component? A - Public B - Private C - no-cache/no-store D - max-age

A

Q 45 - Public directive of Cache Control Header of HTTP response indicates that resource is cachable by any component. A - true B - false

B

Q 45 - Purpose of an URI is to do the DNS lookup. A - true B - false

A

Q 46 - Web services can treat each method request independently. A - true B - false

B

Q 46 - 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

A

Q 47 - As HTTP is itself a statelessness protocol, RESTful Web services work seamlessly with HTTP protocol. A - true B - false

C

Q 47 - Which of the following directive of Cache Control Header of HTTP response indicates that resource is not cachable? A - Public B - Private C - no-cache/no-store D - max-age

B

Q 48 - PUT opearations should be readonly. A - true B - false

D

Q 48 - Which of the following directive of Cache Control Header of HTTP response can set the time limit of caching? A - Public B - Private C - no-cache/no-store D - max-age

B

Q 49 - POST opearations should be idempotent. A - true B - false

A

Q 49 - 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

B

Q 5 - 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

C

Q 5 - Which of the following is not a valid HTTP methods used in RESTful web services? A - OPTIONS B - DELETE C - DATE D - POST

A

Q 50 - GET opearations should be readonly. A - true B - false

D

Q 50 - Which of the following is a best practice for caching in RESTful web service? A - Always keep static contents like images, css, JavaScript cacheable, with expiration date of 2 to 3 days. B - Never keep expiry date too high. C - Dynamic contents should be cached for few hours only. D - All of the above

C

Q 6 - Which of the following HTTP Status code means NO CONTENT, when response body is empty for example, a DELETE request? A - 200 B - 201 C - 204 D - 304

C

Q 6 - Which of the following is correct about web services? A - A web service is a collection of open protocols and standards used for exchanging data between applications or systems. B - Software applications written in various programming languages and running on various platforms can use web services to exchange data among them over computer networks like the Internet. C - Both of the above. D - None of the above.

D

Q 7 - Which of the following HTTP Status code means NOT MODIFIED, used to reduce network bandwidth usage in case of conditional GET requests? A - 200 B - 201 C - 204 D - 304

D

Q 7 - Which of the following is correct about RESTful web services? A - Web services based on REST Architecture are known as RESTful web services. B - These web services use HTTP methods to implement the concept of REST architecture. C - A RESTful web service usually defines a URI, Uniform Resource Identifier a service, provides resource representation such as JSON and set of HTTP Methods. D - All of the above.

A

Q 8 - 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

C

Q 8 - Which of the following is correct about resource representation in REST? A - REST uses various representations to represent a resource where text, JSON, XML. B - XML and JSON are the most popular representations of resources. C - Both of the above. D - None of the above.

B

Q 9 - Which of the following HTTP Status code means FORBIDDEN, states that user is not having access to method being used for example, delete access without admin rights? A - 400 B - 401 C - 404 D - 409

A

Q 9 - Which of the following depicts best practice, Understandability for resource representation in REST? A - Both Server and Client should be able to understand and utilize the representation format of the resource. B - Format should be able to represent a resource completely. For example, a resource can contain another resource. Format should be able to represent simple as well as complex structures of resources. C - A resource can have a linkage to another resource, a format should be able to handles such situations. D - None of the above.


Set pelajaran terkait

Chronicle of a Death Foretold Vocab Ch 1-5

View Set

Ch.15.2—unit 4: Why Is Improving Energy Efficiency & Reducing Energy Waste An Important Energy Resource?

View Set

Skills Lesson: Creating and Writing Thesis Statements

View Set