MCPcopy Create free account
hub / github.com/encode/starlette / handle

Method handle

starlette/routing.py:273–282  ·  view source on GitHub ↗
(self, scope: Scope, receive: Receive, send: Send)

Source from the content-addressed store, hash-verified

271 return URLPath(path=path, protocol="http")
272
273 async def handle(self, scope: Scope, receive: Receive, send: Send) -> None:
274 if self.methods and scope["method"] not in self.methods:
275 headers = {"Allow": ", ".join(self.methods)}
276 if "app" in scope:
277 raise HTTPException(status_code=405, headers=headers)
278 else:
279 response = PlainTextResponse("Method Not Allowed", status_code=405, headers=headers)
280 await response(scope, receive, send)
281 else:
282 await self.app(scope, receive, send)
283
284 def __eq__(self, other: Any) -> bool:
285 return (

Callers

nothing calls this directly

Calls 3

HTTPExceptionClass · 0.90
PlainTextResponseClass · 0.90
appMethod · 0.45

Tested by

no test coverage detected