question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[QUESTION] How to response with empty body?

See original GitHub issue

Though I neither declare response model (None by default) neither return anything the response contains null. Is there a way to send empty body?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

25reactions
symonsoftcommented, Feb 29, 2020

This works as I need: return Response(status_code=HTTP_200_OK)

Thanks all!

13reactions
remidinishanth-ntnxcommented, Jan 27, 2021

You can also import from fastapi instead of starlette using

from fastapi import Response, status

and use status.HTTP_200_OK

Read more comments on GitHub >

github_iconTop Results From Across the Web

go - Response.Body returning an "empty" body
I commented in the full URL so that you can check it out yourself and see that the response body should not be...
Read more >
Responses with no body
True. That's an empty JSON, but not an empty body though. An empty body would have a content length of zero. A possible...
Read more >
Handling REST POST method with Empty body on MPGW ...
One is to set the MPGW to 'Process Messages whose body is empty' as pointed out by Hermann above, marking the rule as...
Read more >
Why does wp_remote_post returns an empty body ...
The problem is that the $response object always returns an empty body. If I copy the exact request JSON that im sending over,...
Read more >
Question: HTTP Client connector payload is empty
Action - send Operation Action - send Request Profile - JSON Response ... JSON file that i am trying to send, the body...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found