0% found this document useful (0 votes)
21 views8 pages

Quiz 1

Uploaded by

marambargaoui9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views8 pages

Quiz 1

Uploaded by

marambargaoui9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

1. What does the Acronym REST Stand for?

1. Representational State Transform


2. Representational State Transfer
3. Represent State Transform
4. Represent State Transfer

2. What is the protocol used in REST?

1. FTP
2. HTTP
3. JMX
4. SOAP

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

Choose one option

1. URI
2. VERB
3. HTTP Version
4. Request Header

4. 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 web
service.
3. Both (1) and (2)
4. None of the above

3
5. What is the HTTP Status Code Related to Page Not Found?

Choose one option

1. 402
2. 404
3. 403
4. 401

Here 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. 500
2. 501
3. 504
4. 502

Here’s a brief explanation of the different status codes:

– 500: Internal Server Error – The server encountered an unexpected condition that
prevented it from fulfilling the request.
– 501: Not Implemented – The server either does not recognize the request method, or
it lacks the ability to fulfill the request.
– 502: Bad Gateway – The server received an invalid response from the upstream
server while trying to fulfill the request.
– 504: Gateway Timeout – The server, while acting as a gateway or proxy, did not
receive a timely response from the upstream server.
7. What does HTTP Code 200 indicate?

1. Error
2. Completed
3. Success
4. Warning

8. Which of the following is not an HTTP method?

1. CREATE
2. POST
3. PUT
4. OPTION

– 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 new


resource?
1. POST
2. PUT
3. GET
4. CREATE

10. Which HTTP method do we use to make an HTTP request to update an


existing resource?

1. POST
2. PUT
3. UPDATE
4. DELETE

11. Choose the correct URI format to get a sub-resource by resource id and
sub-resource id

1. /{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. OK
2. Created
3. Accepted
4. No Content

13. Which HTTP methods are commonly used in REST API operations?

1. GET, POST, PUT, DELETE


2. CREATE, READ, UPDATE, DELETE
3. INSERT, SELECT, UPDATE, DELETE
4. SEND, RECEIVE, MODIFY, DELETE

14. Which of the following HTTP method should be used to delete resource using
RESTful web service?

1. GET
2. DELETE
3. POST
4. OPTIONS

15. What is the recommended method and URL pattern for retrieving a specific
user?

1. GET /users/{id}
2. GET /user/{id}
3. GET /user?id={id}
4. GET /users?id={id}

16. 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?

1. 403
2. 404
3. 406
4. 409

406: Not Acceptable – Indicates that the server cannot generate a response that is
acceptable 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 with
the current state of the resource, such as a version control conflict.

17. What does the status code 302 represent?

1. Not Modified
2. User can select among multiple links and go to different page.
3. The resource requested has been found and moved temporarily to new URL
location.
4. The page requested is available only by means of proxy address given in the
response.

18. What category do 1xx HTTP status codes belong to?

1. Redirection
2. Client Error
3. Server Error
4. Informational

19. 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 resources
2. PUT updates the entire resource, while PATCH updates only specific fields of a
resource
3. PUT requires authentication, while PATCH does not
4. PUT is idempotent, while PATCH is not

20. What is the role of the “Content-Type” header in a REST API request?

Choose one option

1. It specifies the HTTP method to be used


2. It defines the format of the request payload
3. It provides authentication credentials
4. It determines the cache control policy for the request

Answer 2

21. What is the purpose of the “Authorization” header in a REST API request?

Choose one option

1. It specifies the format of the request payload


2. It provides additional metadata about the request
3. It provides authentication credentials for accessing protected resources
4. It determines the cache control policy for the request

Answer 3

22. In REST API design, what is idempotency?

Choose one option

1. The ability of an API to handle multiple requests in parallel


2. The property that a method can be called multiple times without different
outcomes
3. The capability of an API to update data
4. The feature of an API that allows it to delete resources

Answer 2

23. What is the primary purpose of the HTTP OPTIONS method in REST APIs?

Choose one option

1. To update a resource
2. To retrieve the communication options available on a resource or server
3. To delete a resource
4. To create a resource

Answer 2

24. Which is a common command-line tool for using or exploring an API?

Choose one option

1. ssh
2. bash
3. curl
4. powerShell

Answer 3

25. Which of the following directive of Cache Control Header of HTTP response
indicates that resource is not cachable?

1. Public
2. Private
3. max-age
4. no-cache/no-store

You might also like