MCPcopy
hub / github.com/encode/uvicorn / receive

Method receive

uvicorn/protocols/http/httptools_impl.py:562–576  ·  uvicorn/protocols/http/httptools_impl.py::RequestResponseCycle.receive
(self)

Source from the content-addressed store, hash-verified

560 raise RuntimeError(fclass="st">"Unexpected ASGI message &class="cm">#x27;{message['type']}' sent, after response already completed.")
561
562 async def receive(self) -> ASGIReceiveEvent:
563 if self.waiting_for_100_continue and not self.transport.is_closing():
564 self.transport.write(bclass="st">"HTTP/1.1 100 Continue\r\n\r\n")
565 self.waiting_for_100_continue = False
566
567 if not self.disconnected and not self.response_complete:
568 self.flow.resume_reading()
569 await self.message_event.wait()
570 self.message_event.clear()
571
572 if self.disconnected or self.response_complete:
573 return {class="st">"type": class="st">"http.disconnect"}
574 message: HTTPRequestEvent = {class="st">"type": class="st">"http.request", class="st">"body": bytes(self.body), class="st">"more_body": self.more_body}
575 self.body = bytearray()
576 return message

Callers

nothing calls this directly

Calls 4

clearMethod · 0.80
is_closingMethod · 0.45
writeMethod · 0.45
resume_readingMethod · 0.45

Tested by

no test coverage detected