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, version, and plural nouns
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
What does the X-Cassandra-Token header represent in an Astra DB RESTful request?
a) The API version
b) The authentication token
c) The response format
d) The request body format
b) The authentication token
What is the primary risk of passing sensitive data in an unsecured (HTTP) web request?
a) The data may be lost
b) The data may be intercepted
c) The request may fail
d) The API may reject the request
b) The data may be intercepted
What is the purpose of the properties block in the JSON response from the National Weather Service API?
a) To define the HTTP operation
b) To encapsulate nested data like temperature and elevation
c) To specify the API version
d) To define the request headers
b) To encapsulate nested data like temperature and elevation
What is the significance of the qualityControl field in the JSON response from the National Weather Service API?
a) It indicates the format of the data
b) It indicates the reliability of the temperature value
c) It specifies the API version
d) It defines the request headers
b) It indicates the reliability of the temperature value
What is the purpose of the timestamp field in the JSON response from the National Weather Service API?
a) To indicate when the observation was recorded
b) To specify the API version
c) To define the request headers
d) To indicate the format of the data
a) To indicate when the observation was recorded