We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Delete

The DELETE method does exactly what you expect: it deletes a specified resource.

Example

# This deletes the location with ID: 52fdfc07-2182-454f-963f-5f0f9a621d72
url = "https://api.boot.dev/v1/courses_rest_api/learn-http/locations/52fdfc07-2182-454f-963f-5f0f9a621d72"

await pyfetch(
    url,
    method="DELETE",
    headers={
        "X-API-Key": api_key,
    },
)

Assignment

Users need to be able to delete their player accounts! Complete the delete_user function. It should send a DELETE request to the given full_url. You'll need to set the method and headers. Like before, set the X-API-Key header to equal the given api_key.