Skip to content

200 Response without body and content-type #3097

Discussion options

You must be logged in to vote

"200 without a body" isn't really a thing. As @guacs said, if you truly want to omit the body, you should use a 204 code. However, if you're fine with sending an empty body, you could just do something like

@get("/")
async def handler() -> str:
    return ""

which sends an empty plaintext response.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@guacs
Comment options

@bunny-therapist
Comment options

@provinzkraut
Comment options

Answer selected by bunny-therapist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants