Restful operations Flashcards

1
Q

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

a) Representational State Transfer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Which of the following is NOT a principle of RESTful services?

a) Lightweight
b) Stateful
c) Scalable
d) Loosely-coupled

A

b) Stateful

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which HTTP operation is used for retrieving data in RESTful services?

a) POST
b) PUT
c) GET
d) DELETE

A

c) GET

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

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

A

b) To create a new stateful entry

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which HTTP operation is intended for updating existing data in RESTful services?

a) GET
b) POST
c) PUT
d) DELETE

A

c) PUT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

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

A

d) To remove existing data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

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

a) Service name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

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

A

b) To allow users to switch to new versions at their own pace

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the primary format used for data exchange in RESTful services?

a) XML
b) CSV
c) JSON
d) YAML

A

c) JSON

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

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

A

b) The format of the request body

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

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

a) The format of the response data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is cURL primarily used for?

a) Creating web pages
b) Making system-level web requests
c) Debugging JavaScript code
d) Managing databases

A

b) Making system-level web requests

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Which command is used to verify the installation of cURL?

a) curl –version
b) curl –install
c) curl –check
d) curl –verify

A

a) curl –version

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

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

a) To specify the HTTP operation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

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

A

c) To add a header to the request

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

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

A

b) The authentication token

17
Q

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

A

b) The data may be intercepted

18
Q

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

A

b) To encapsulate nested data like temperature and elevation

19
Q

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

A

b) It indicates the reliability of the temperature value

20
Q

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

a) To indicate when the observation was recorded