Tunis Business School**We aren't endorsed by this school
Course
BA 123
Subject
Computer Science
Date
Dec 24, 2024
Pages
8
Uploaded by JusticeRainElephant40
1. What does the Acronym REST Stand for?1.Representational State Transform2.Representational State Transfer3.Represent State Transform4.Represent State Transfer22. What is the protocol used in REST?1.FTP2.HTTP3.JMX4.SOAP23. Which of the following component of HTTP request contains metadata for theHTTP Request message as key-value pairs?Choose one option1.URI2.VERB3.HTTP Version4.Request Header44. Which of the following is correct about URI in RESTful web services?1.Each resource in REST architecture is identified by its URI.2.Purpose of an URI is to locate a resource(s) on the server hosting the webservice.3.Both (1) and (2)4.None of the above3
5. What is the HTTP Status Code Related to Page Not Found?Choose one option1.4022.4043.4034.4012Here is a brief explanation of the different status codes– 401: Unauthorized– The request requires user authentication.– 402: Payment Required– This status code is reserved for future use.– 403: Forbidden– The server understood the request but refuses to authorize it.– 404: Not Found– The server can’t find the requested page.6. What is the HTTP Code Related to Internal Server Error?1.5002.5013.5044.5021Here’s a brief explanation of the different status codes:– 500: Internal Server Error– The server encountered an unexpected condition thatprevented it from fulfilling the request.– 501: Not Implemented– The server either does not recognize the request method, orit lacks the ability to fulfill the request.– 502: Bad Gateway– The server received an invalid response from the upstreamserver while trying to fulfill the request.– 504: Gateway Timeout– The server, while acting as a gateway or proxy, did notreceive a timely response from the upstream server.
7. What does HTTP Code 200 indicate?1.Error2.Completed3.Success4.Warning38. Which of the following is not an HTTP method?1.CREATE2.POST3.PUT4.OPTION1–GET:Retrieve data from a server.–POST:Send data to a server to create a resource.–PUT:Update or create a resource on the server with the provided data.–DELETE:Remove a resource from the server.–OPTIONS:Describe the communication options for the target resource.–HEAD:Similar to GET but without the response body.–PATCH:Apply partial modifications to a resource.–TRACE:Perform a message loop-back test along the path to the target resource.–CONNECT:Establish a tunnel to the server identified by the target resource.9. Which HTTP method do we use to make an HTTP request to create a newresource?
1.POST2.PUT3.GET4.CREATE110. Which HTTP method do we use to make an HTTP request to update anexisting resource?1.POST2.PUT3.UPDATE4.DELETE211. Choose the correct URI format to get a sub-resource by resource id andsub-resource id1./{resource}/{resource-id}/{sub-resource}/{sub-resource-id}2./{resource}/{sub-resource}/{sub-resource-id}3.{sub-resource}/{sub-resource-id}/{resource}/{resource-id}4./{resource}/{resource-id}/{sub-resource-id}/{sub-resource}12. What does the HTTP status code 201 indicate?1.OK2.Created3.Accepted4.No Content213. Which HTTP methods are commonly used in REST API operations?1.GET, POST, PUT, DELETE
2.CREATE, READ, UPDATE, DELETE3.INSERT, SELECT, UPDATE, DELETE4.SEND, RECEIVE, MODIFY, DELETE214. Which of the following HTTP method should be used to delete resource usingRESTful web service?1.GET2.DELETE3.POST4.OPTIONS215. What is the recommended method and URL pattern for retrieving a specificuser?1.GET /users/{id}2.GET /user/{id}3.GET /user?id={id}4.GET /users?id={id}116. Which of the following HTTP Status code means FORBIDDEN, states that useris not having access to method being used for example, delete access withoutadmin rights?1.4032.4043.4064.4091406: Not Acceptable– Indicates that the server cannot generate a response that isacceptable to the client based on the accept headers sent in the request
409: Conflict– Indicates that the request could not be completed due to a conflict withthe current state of the resource, such as a version control conflict.17. What does the status code 302 represent?1.Not Modified2.User can select among multiple links and go to different page.3.The resource requested has been found and moved temporarily to new URLlocation.4.The page requested is available only by means of proxy address given in theresponse.318. What category do 1xx HTTP status codes belong to?1.Redirection2.Client Error3.Server Error4.Informational419. What is the difference between PUT and PATCH methods in REST API?1.PUT is used for creating resources, while PATCH is used for updating resources2.PUT updates the entire resource, while PATCH updates only specific fields of aresource3.PUT requires authentication, while PATCH does not4.PUT is idempotent, while PATCH is not220. What is the role of the “Content-Type” header in a REST API request?Choose one option1.It specifies the HTTP method to be used
2.It defines the format of the request payload3.It provides authentication credentials4.It determines the cache control policy for the requestAnswer 221. What is the purpose of the “Authorization” header in a REST API request?Choose one option1.It specifies the format of the request payload2.It provides additional metadata about the request3.It provides authentication credentials for accessing protected resources4.It determines the cache control policy for the requestAnswer 322. In REST API design, what is idempotency?Choose one option1.The ability of an API to handle multiple requests in parallel2.The property that a method can be called multiple times without differentoutcomes3.The capability of an API to update data4.The feature of an API that allows it to delete resourcesAnswer 223. What is the primary purpose of the HTTP OPTIONS method in REST APIs?Choose one option1.To update a resource2.To retrieve the communication options available on a resource or server3.To delete a resource
4.To create a resourceAnswer 224. Which is a common command-line tool for using or exploring an API?Choose one option1.ssh2.bash3.curl4.powerShellAnswer 325. Which of the following directive of Cache Control Header of HTTP responseindicates that resource is not cachable?1.Public2.Private3.max-age4.no-cache/no-store4