wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

RestfulAPI

Total questions: 21

Worksheet time: 11mins

Name
Class
Date
1.

Which of the following best defines a Web Service?

a)

A database system

b)

A system that allows applications to communicate over a network

c)

A programming language

d)

A type of server

2.

Which format is MOST commonly used in REST APIs today?

a)

XML

b)

JSON

c)

YAML

d)

CSV

3.

Which HTTP method is idempotent?

a)

POST

b)

GET

c)

PATCH

d)

None of the above

4.

Which status code means “Resource Not Found”?

a)

200

b)

201

c)

404

d)

500

5.

Which of the following is NOT a REST principle?

a)

Stateless communication

b)

Client-Server architecture

c)

Cacheable responses

d)

Requires SOAP protocol

6.

In Django, which file is used for defining database models?

7.

Which Django file is responsible for request routing (URL mapping)?

8.

Which HTTP header specifies the data format being sent to the server?

a)

a) Authorization

b)

b) Accept

c)

c) Content-Type

d)

d) Cache-Control

9.

Which HTTP status code indicates success when a new resource is created?

a)

200

b)

201

c)

202

d)

204

10.

Which authentication method uses Base64 encoding of username and password?

a)

API Key

b)

Basic Auth

c)

Bearer Token

d)

OAuth 2.0

11.

In REST, what does the 201 status code represent?

a)

OK

b)

Created

c)

No Content

d)

Forbidden

12.

In REST, which HTTP method is used to update an existing resource completely?

a)

POST

b)

PUT

c)

PATCH

d)

DELETE

13.

Which HTTP method is generally used to delete a resource?

a)

GET

b)

DELETE

c)

POST

d)

PUT

14.

Which of the following is an example of a RESTful URL design?

a)

/getUser?id=101

b)

/api/users/101

c)

/fetch/user/101

d)

/users.php?id=101

15.

In Django, which command is used to start a new project?

a)

django-admin startapp

b)

django-admin runserver

c)

django-admin startproject

d)

django-admin migrate

16.

Which HTTP status code indicates a server error?

a)

200

b)

404

c)

500

d)

401

17.

Which of the following is NOT an HTTP method?

a)

GET

b)

POST

c)

UPDATE

d)

DELETE

18.

Which status code means “Unauthorized”

a)

200

b)

401

c)

403

d)

500

19.

In Django, which file is used for project-wide configurations like DB, security, middleware?

20.

In Django, which file handles the request/response logic

21.

Which is the correct command to run a Django development server?

a)

django-admin startserver

b)

python manage.py runserver

c)

django-admin runserver

d)