REST API quizzz

An informative illustration showcasing REST APIs, HTTP methods, and a vintage computer theme in a vibrant tech-inspired design.

Mastering REST APIs: A Comprehensive Quiz

Test your understanding of RESTful APIs with this engaging quiz! Dive into a variety of topics, from HTTP methods to content negotiation, and explore the nuances of the Richardson Maturity Model.

Whether you’re a seasoned developer or just starting out, this quiz will help reinforce your knowledge and improve your skills!

  • Multiple choice and checkbox questions
  • Real-world scenarios and design flaws
  • Learn about HATEOAS and idempotent operations
13 Questions3 MinutesCreated by DebuggingWizard425
What HTTP operations are considered safe?
PUT & POST
GET, HEAD, PUT
All but DELETE
GET, HEAD, OPTIONS
Only GET
What HTTP operations are considered idempotent
PUT & POST
All safe operations + PUT
Just GET, HEAD, OPTIONS
All safe + PUT and DELETE
GET
GET, PUT
In the Richardson Maturity Model, what is the difference between level 1 maturity and level 3 maturity?
Resources
POX/ POJO
VERBS
HTTP statuses
RPC
HATEOAS
In the Richardson Maturity Model, what is the difference between level 1 maturity and level 3 maturity?
Resources
POX/ POJO
VERBS
HTTP statuses
RPC
HATEOAS
- What HATEOAS stands for?
- What does API stand for?
- What does REST stand for?
What best describes PUT and POST difference
PUT is update POST is create
PUT and POST can be used interchangeably
PUT overrides the whole resource POST can be used to partial updates
PUT is safe and POST not
PUT is and POST is not idempotent
You need to know up front resource identity to do PUT create, which is not the case for POST
What is the responsibility of 3.. HTTP status codes family?
Informing about client errors
Inform on server errors
Inform on success
Inform on redirection
WebDAV
What is the proper content negotiation flow?
a)
req: POST /resource
Content Type: application/json 
Accept: text/html, */*
{"id":1000, "status":"ACTIVE"}
 
srv: R1: Consumes: "application/*", Produces:"text/plain"
R2: Consumes: {"application/x-www-form-urlencoded"} Produces:"application/json"
 
 res: 200 OK
Content Type: "text/plain"
 Resource status:
"ACTIVATED"
 
b)
req: PUT /resource
Content Type: application/xml 
Accept: text/html, */*
<req><id>1000</id>,<status>ACTIVE</status></req>
 
srv: R1: Consumes: "application/*", Produces:"text/plain"
R2: Consumes: {"application/json","application/x-www-form-urlencoded"} Produces:"application/json"
 
 res: 200 OK
 
c) non
d)both
A
B
C
D
What is the content type precedence in: Accept: text/*, text/html, text/html;level=1, */*
1) text/html;level=1 2) text/html 3) text/* 4) */*
1) text/* 2) text/html 3) text/html;level=1 4) */*
1) text/* 2) text/html;level=1 3) text/html 4) */*
What is the meaning of HTTP 406
Bad Request
Internal Server Error
Unsupported Media Type
Not Found
Not Acceptable
What is the design flaw in given REST resource?
 
POST /create-user
Produces: "application/json" Consumes: "application/json"
Resource schema: {name: string, email: email-string}
succ resp: status: 202 Accepted 
Wrong verb used
Wrong content type proposed (we should use rather url encoded params)
Potentially wrong response status code
Wrong resource URI
What is the design flaw in given REST resource?
 
PUT /user
Produces: "application/json"
Consumes: "application/json"
Resource schema: {name: string, email: email-string}
succ resp: status: 201 Created
Location: /user/12345 
Wrong response header (Location)
Wrong verb used to create resource
Wrong URI design
Wrong status code
Operation not idempotent
What is the design flaw in given REST resource?
 
POST /user
Produces: "application/x-www-form-urlencoded"
Consumes: "application/x-www-form-urlencoded"
Resource schema: name: string, email: email-string
succ resp: status: 201 Created
Location: /user/12345 
Wrong Produces
Wrong URI
Wrong status code
Wrong response header
Wrong Consumes
Wrong verb
{"name":"REST API quizzz", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"Test your understanding of RESTful APIs with this engaging quiz! Dive into a variety of topics, from HTTP methods to content negotiation, and explore the nuances of the Richardson Maturity Model.Whether you’re a seasoned developer or just starting out, this quiz will help reinforce your knowledge and improve your skills!Multiple choice and checkbox questionsReal-world scenarios and design flawsLearn about HATEOAS and idempotent operations","img":"https:/images/course7.png"}
Powered by: Quiz Maker