Complete the code to return a 200 OK status in a REST API response.
return Response(status=[1])
The HTTP status code 200 means the request was successful and the server is returning the requested data.
Complete the code to return a 201 Created status after successfully creating a resource.
return Response(status=[1])
The HTTP status code 201 means a new resource was successfully created on the server.
Fix the error in the code to correctly return a 201 Created status with a JSON body.
return Response({"id": new_id}, status=[1])
When creating a new resource and returning its data, use status 201 to indicate creation success.
Fill both blanks to create a response with 201 status and a Location header pointing to the new resource URL.
return Response(status=[1], headers={{'Location': [2])
Use status 201 to indicate creation and set the Location header to the new resource's URL.
Fill all three blanks to return a 200 OK response with JSON data and a custom header.
return Response([1], status=[2], headers={{'X-Custom': [3])
Return JSON data with status 200 and include a custom header with the given value.