API Multiple Choice Questions
Q1. Which HTTP status code range indicates a client error ?
a) 100-199
b) 200-299
c) 400-499
d) 500-599
Q2. What is the difference between POST and PUT methods in REST API ?
a) POST is used for creating resources, while PUT is used for updating resources
b) POST updates the entire resource, while PUT updates only specific fields of a resource
c) POST requires authentication, while PUT does not
d) POST is used for creating resources, while PUT updates only specific fields of a resource
Q3. What is the purpose of the Authorization header in a REST API request ?
a) It specifies the format of the request payload
b) It provides additional metadata about the request
c) It provides authentication credentials for accessing protected resources
d) It determines the cache control policy for the request
Q4. What is the role of the "Content-Type" header in a REST API request?
a) It specifies the HTTP method to be used
b) It defines the format of the request payload
c) It provides authentication credentials
d) It determines the cache control policy for the request
Q5. What is the difference between PUT and PATCH methods in REST API?
a) PUT is used for creating resources, while PATCH is used for updating resources
b) PUT updates the entire resource, while PATCH updates only specific fields of a resource
c) PUT requires authentication, while PATCH does not
d) PUT is idempotent, while PATCH is not
Q6. Which HTTP methods are commonly used in REST API operations?
a) GET, POST, PUT, DELETE
b) CREATE, READ, UPDATE, DELETE
c) INSERT, SELECT, UPDATE, DELETE
d) SEND, RECEIVE, MODIFY, DELETE
Q7. What does the HTTP status code 201 indicate?
a) OK
b) Created
c) Accepted
d) No Content
Q8. Which HTTP method do we use to make an HTTP request to update an existing resource?
a) POST
b) PUT
c) UPDATE
d) DELETE
Q9. Which HTTP method do we use to make an HTTP request to create a new resource?
a) POST
b) PUT
c) GET
d) CREATE
Q10. What does HTTP Code 200 indicate?
a) Error
b) Completed
c) Success
d) Warning
Q11. What is the HTTP Code Related to Internal Server Error?
a) 500
b) 501
c) 504
d) 502
Q12. What is the HTTP Status Code Related to Page Not Found?
a) 402
b) 404
c) 403
d) 401
Q13. What is the protocol used in REST?
a) FTP
b) HTTP
c) JMX
d) SOAP
Q14. What does the Acronym REST Stand for?
a) Representational State Transform
b) Representational State Transfer
c) Represent State Transform
d) Represent State Transfer
Q15. What is REST-assured
a) a java library for testing Restful Web services
b) a java api
c) a resting place for API
d) none of options
Q16. REST-assured is a java library
a) Yes
b) No
Q17. We cannot test SOAP web services using REST-assured
a) True
b) False
Q18. REST-assured uses BDD style
a) True
b) False
Q19. How can you extract values from JSON response using Rest Assured?
a) Using JSONPath extractor
b) By parsing the entire response as text and extracting manually
c) By converting JSON to XML and then extracting values
d) Value extraction is not possible with Rest Assured
Q20. Which type of response format is commonly used with SOAP APIs?
a) XML (eXtensible Markup Language)
b) CSV (Comma Separated Values)
c) JSON (JavaScript Object Notation)
d) HTML (Hypertext Markup Language)
Answers:
- c
- a
- c
- b
- b
- a
- b
- b
- a
- c
- a
- b
- b
- b
- a
- a
- b
- a
- a
- a
