0
0
Flaskframework~5 mins

HTTP status codes for APIs in Flask - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does HTTP status code 200 mean in an API response?
Status code 200 means OK. It indicates the request was successful and the server returned the requested data.
Click to reveal answer
beginner
What is the purpose of HTTP status code 201 in APIs?
Status code 201 means Created. It shows that a new resource was successfully created on the server.
Click to reveal answer
beginner
When should you use HTTP status code 400 in an API?
Use status code 400 Bad Request when the client sends invalid or malformed data that the server cannot process.
Click to reveal answer
beginner
What does HTTP status code 404 indicate in an API?
Status code 404 means Not Found. It tells the client that the requested resource does not exist on the server.
Click to reveal answer
intermediate
Explain HTTP status code 500 and when it occurs.
Status code 500 means Internal Server Error. It happens when the server encounters an unexpected problem while processing the request.
Click to reveal answer
Which HTTP status code means the API request was successful and data is returned?
A200
B404
C500
D201
What status code should you return after successfully creating a new resource?
A201
B400
C404
D500
If the client sends bad data, which status code is appropriate?
A200
B201
C400
D404
Which status code tells the client the requested resource was not found?
A201
B404
C200
D500
What does status code 500 indicate?
ARequest successful
BResource created
CClient error
DServer error
Describe the main HTTP status codes you would use in a Flask API and what each means.
Think about success, creation, client errors, missing resources, and server errors.
You got /5 concepts.
    Explain why it is important to use correct HTTP status codes in API responses.
    Consider how clients react to different codes.
    You got /5 concepts.