MCQs > IT & Programming > RESTful Services MCQs > Basic RESTful Services MCQs

Basic RESTful Services MCQ

1. The REpresentational State Transfer (REST) architectural style is based on the HTTP protocol.

Answer

Correct Answer: False

Note: This Question is unanswered, help us to find answer for this one

2. Given a REST API that is capable of responding only with JSON, what is the appropriate way to respond to a request with header `Accept: application/xml; charset=utf-8`?

Answer

Correct Answer: Respond with `406 Not Acceptable` error or respond successfully with JSON

Note: This Question is unanswered, help us to find answer for this one

3. Which HTTP methods are idempotent?

Answer

Correct Answer: GET, HEAD, PUT and DELETE

Note: This Question is unanswered, help us to find answer for this one

4. What is the appropriate error response for a request that sends an entity in XML with header `Content-Type: application/json` when the server only understands JSON.

Answer

Correct Answer: 400 Bad Request

Note: This Question is unanswered, help us to find answer for this one

5. A POST request that results in the creation of a resource should respond with ______

Answer

Correct Answer: A `201 Created` status and a `Location` header with a URI identifying where the resource can be retrieved with a GET request.

Note: This Question is unanswered, help us to find answer for this one

6. A PUT request that results in the creation of a new resource should respond with _____

Answer

Correct Answer: A `201 Created` status code

Note: This Question is unanswered, help us to find answer for this one

7. Which HTTP method(s) should be used for creating a resource

Answer

Correct Answer: POST or PUT

Note: This Question is unanswered, help us to find answer for this one

8. A PUT request on a URI that only supports GET and POST should respond with _____

Answer

Correct Answer: A `405 Method Not Allowed` status code

Note: This Question is unanswered, help us to find answer for this one

9. What is the appropriate error response for a request that sends an entity in XML (with header `Content-Type: application/xml; charset=UTF-8`) when the server only understands JSON.

Answer

Correct Answer: 415 Unsupported Media Type

Note: This Question is unanswered, help us to find answer for this one

10. The process of determining which representation of a resource to respond with is called

Answer

Correct Answer: Content Negotiation

Note: This Question is unanswered, help us to find answer for this one

11. Which is the foundational constraint in REST that defines the separation between service, consumer and the technical contract?

Answer

Correct Answer: Client server

Note: This Question is unanswered, help us to find answer for this one

12. What is an appropriate HTTP response for issuing a GET request to /users/1/delete on a RESTful Web Service?

Answer

Correct Answer: 405 Method Not Allowed

Note: This Question is unanswered, help us to find answer for this one

13. Which of the following should not be present in RESTful Web Services URIs?

Answer

Correct Answer: Verbs

Note: This Question is unanswered, help us to find answer for this one

14. How might HATEOAS principles be applied in a RESTful web service?

Answer

Correct Answer: Each response should include links to the other related resources

Note: This Question is unanswered, help us to find answer for this one

15. Which of the following is one of the interface constraints for REST that allows the server functionality to evolve independently?

Answer

Correct Answer: HATEOAS (Hypertext As The Engine Of Application State)

Note: This Question is unanswered, help us to find answer for this one

16. Which of the following describe the correct way to let a client progress through states in a RESTful application?

Answer

Correct Answer: A link in the response body pointing to the next state

Note: This Question is unanswered, help us to find answer for this one

17. Who is responsible for tracking the application state on a system that communicates through a RESTful Web Service

Answer

Correct Answer: Client

Note: This Question is unanswered, help us to find answer for this one

18. What is the mechanism that mediates communication, coordination or cooperation among components like data streams known as?

Answer

Correct Answer: Connector

Note: This Question is unanswered, help us to find answer for this one

19. True or False? In RESTful Web Services each URI can map to one or more resources.

Answer

Correct Answer: False

Note: This Question is unanswered, help us to find answer for this one

20. True or False? It is a design flaw for RESTful Web Services to reveal data gradually, linking to additional resources on the response body.

Answer

Correct Answer: False

Note: This Question is unanswered, help us to find answer for this one

21. PUTting to the following URI will do generally do what? /users/123/posts

Answer

Correct Answer: Replace the entire posts collection for the user 123.

Note: This Question is unanswered, help us to find answer for this one

22. Which software architecture is used for designing and developing software with "RESTful" interfaces?

Answer

Correct Answer: Resource Oriented Architecture

Note: This Question is unanswered, help us to find answer for this one

23. Identify which is not a formal REST constraint

Answer

Correct Answer: Master Data

Note: This Question is unanswered, help us to find answer for this one

24. Which HTTP methods are considered "safe", meaning that the request should not produce side-effects or alter the server state?

Answer

Correct Answer: HEAD, GET, OPTIONS and TRACE

Note: This Question is unanswered, help us to find answer for this one

25. Suppose you're writing a REST resource for listing all coments made by an user. Which would be the most appropriate URI?

Answer

Correct Answer: /users/{id}/comments

Note: This Question is unanswered, help us to find answer for this one

26. True or False? RESTful responses should include links to related resources, enabling the Client to progress through states.

Answer

Correct Answer: True

Note: This Question is unanswered, help us to find answer for this one

27. Which of the following cannot be considered a REST design principle

Answer

Correct Answer: (None of these)

Note: This Question is unanswered, help us to find answer for this one

28. How is REST related to SOAP?

Answer

Correct Answer: REST is an alternative to SOAP

Note: This Question is unanswered, help us to find answer for this one

29. Statelessness is one of the formal constraint of REST Web Service, which feature is addressed due to absence of state on the server?

Answer

Correct Answer: Improves Web service performance as it removes the need to synchronize session data with an external application

Note: This Question is unanswered, help us to find answer for this one

30. How can users log into RESTful API to see protected resources only?

Answer

Correct Answer: Since server is stateless, client has to provide all information to make request

Note: This Question is unanswered, help us to find answer for this one

31. Which of the following best describe REST?

Answer

Correct Answer: an architectural style

Note: This Question is unanswered, help us to find answer for this one

32. What determines the action to be executed on a RESTful request?

Answer

Correct Answer: HTTP Method

Note: This Question is unanswered, help us to find answer for this one

33. As an idempotent method, which of the following should not happen when issuing a GET request to a RESTful Web Service?

Answer

Correct Answer: Update a resource entry

Note: This Question is unanswered, help us to find answer for this one

34. RESTful web services must be stateful

Answer

Correct Answer: False

Note: This Question is unanswered, help us to find answer for this one

35. Which of the following best describes a RESTful service?

Answer

Correct Answer: Web Services with focus on system resources and transfer of state of resource over http by a wide range of clients written in different languages

Note: This Question is unanswered, help us to find answer for this one

36. Which is the preferred method of determining the format of the data being transfered in a RESTful request?

Answer

Correct Answer: HTTP Content-Type header

Note: This Question is unanswered, help us to find answer for this one

37. Identify the item which is not an intermediary for communication in REST

Answer

Correct Answer: Viruses

Note: This Question is unanswered, help us to find answer for this one

38. What is the key difference between RESTful web services and SOAP web services?

Answer

Correct Answer: REST uses HTTP protocol for producing or consuming web services while SOAP uses XML

Note: This Question is unanswered, help us to find answer for this one

39. True of False? REST, being an architectural style, does not concern implementation details

Answer

Correct Answer: True

Note: This Question is unanswered, help us to find answer for this one

40. Which data formats can be transfered through RESTful Web Services?

Answer

Correct Answer: Any format

Note: This Question is unanswered, help us to find answer for this one

41. Which of the following is true of RESTful Web Service?

Answer

Correct Answer: Use HTTP methods explicitly

Note: This Question is unanswered, help us to find answer for this one

42. When you wish to update an existing “Foo” via a RESTful API, which is most appropriate?

Answer

Correct Answer: PUT /api/foos/123

Note: This Question is unanswered, help us to find answer for this one

43. What are the prerequisites for an application to interact with a resource?

Answer

Correct Answer: Identifier of the resource and Action required

Note: This Question is unanswered, help us to find answer for this one

44. What is the advantage of including Cache control and Last-Modified (a date value) HTTP response header?

Answer

Correct Answer: Improves performance by reducing the requests for duplicate resources

Note: This Question is unanswered, help us to find answer for this one

45. When you wish to create a new “Foo” via a RESTful API, which is most appropriate?

Answer

Correct Answer: POST /api/foos

Note: This Question is unanswered, help us to find answer for this one

46. REST is an acronym for representational state transfer

Answer

Correct Answer: True

Note: This Question is unanswered, help us to find answer for this one

47. Consider a RESTful resource available on the URI /posts. Which is the correct HTTP method used to create a new entry?

Answer

Correct Answer: POST

Note: This Question is unanswered, help us to find answer for this one

48. Which is a true statement in the basic REST design principle that uses HTTP request methods to update resources?

Answer

Correct Answer: To create a resource on the server, use POST

Note: This Question is unanswered, help us to find answer for this one

49. RESTful web services are designed with ____ in mind.

Answer

Correct Answer: Client-server communications

Note: This Question is unanswered, help us to find answer for this one

50. What happens if Restful resources are accessed by multiple clients?

Answer

Correct Answer: Multiple clients can safely access Restful resources concurrently

Note: This Question is unanswered, help us to find answer for this one

51. Which request would best describe removing an user in a RESTful Web Service?

Answer

Correct Answer: DELETE /users/1

Note: This Question is unanswered, help us to find answer for this one

52. When you wish to delete an existing “Foo” via a RESTful API, which is most appropriate?

Answer

Correct Answer: DELETE /api/foos/123

Note: This Question is unanswered, help us to find answer for this one

53. When you wish to read a single “Foo” via a RESTful API, which is most appropriate?

Answer

Correct Answer: GET /api/foos/123

Note: This Question is unanswered, help us to find answer for this one

54. Which HTTP method should be used to update a resource in a RESTful Web Service?

Answer

Correct Answer: PUT

Note: This Question is unanswered, help us to find answer for this one

55. In the context of a web service, a RESTful API should...

Answer

Correct Answer: Make individual resources available at unique URIs

Note: This Question is unanswered, help us to find answer for this one

56. A RESTful Web Service URI should map to __________________?

Answer

Correct Answer: an entity or resource

Note: This Question is unanswered, help us to find answer for this one

57. When you wish to read a collection of “Foo” via a RESTful API, which is most appropriate?

Answer

Correct Answer: GET /api/foos

Note: This Question is unanswered, help us to find answer for this one