Restful operations Flashcards
What does REST stand for in web programming?
a) Representational State Transfer
b) Remote Execution State Transfer
c) Resource Execution State Transfer
d) Representational Service Transfer
a) Representational State Transfer
Which of the following is NOT a principle of RESTful services?
a) Lightweight
b) Stateful
c) Scalable
d) Loosely-coupled
b) Stateful
Which HTTP operation is used for retrieving data in RESTful services?
a) POST
b) PUT
c) GET
d) DELETE
c) GET
What is the purpose of the POST operation in RESTful services?
a) To retrieve data
b) To create a new stateful entry
c) To update existing data
d) To remove existing data
b) To create a new stateful entry
Which HTTP operation is intended for updating existing data in RESTful services?
a) GET
b) POST
c) PUT
d) DELETE
c) PUT
What is the purpose of the DELETE operation in RESTful services?
a) To retrieve data
b) To create a new stateful entry
c) To update existing data
d) To remove existing data
d) To remove existing data
What is the typical structure of a RESTful URI?
a) Service name, version, and plural nouns
b) Version, service name, and singular nouns
c) Plural nouns, version, and service name
d) Singular nouns, service name, and version
a) Service name
Why is it considered a best practice to version RESTful service endpoints?
a) To make the URIs shorter
b) To allow users to switch to new versions at their own pace
c) To reduce the number of endpoints
d) To improve security
b) To allow users to switch to new versions at their own pace
What is the primary format used for data exchange in RESTful services?
a) XML
b) CSV
c) JSON
d) YAML
c) JSON
What does the Content-Type header specify in a RESTful request?
a) The format of the response data
b) The format of the request body
c) The type of HTTP operation
d) The version of the API
b) The format of the request body
What does the Accept header specify in a RESTful request?
a) The format of the response data
b) The format of the request body
c) The type of HTTP operation
d) The version of the API
a) The format of the response data
What is cURL primarily used for?
a) Creating web pages
b) Making system-level web requests
c) Debugging JavaScript code
d) Managing databases
b) Making system-level web requests
Which command is used to verify the installation of cURL?
a) curl –version
b) curl –install
c) curl –check
d) curl –verify
a) curl –version
What is the purpose of the -X option in a cURL command?
a) To specify the HTTP operation
b) To specify the request body
c) To specify the response format
d) To specify the API version
a) To specify the HTTP operation
What is the purpose of the -H option in a cURL command?
a) To specify the HTTP operation
b) To specify the request body
c) To add a header to the request
d) To specify the API version
c) To add a header to the request