MCPcopy Create free account
hub / github.com/vercel/vercel / _lambda_event

Function _lambda_event

python/vercel-runtime/tests/test_runtime.py:113–130  ·  view source on GitHub ↗

Build a Lambda event dict for vc_handler.

(
    method: str,
    path: str,
    headers: dict[str, str | list[str]] | None = None,
    body: str | None = None,
    encoding: str | None = None,
)

Source from the content-addressed store, hash-verified

111
112
113def _lambda_event(
114 method: str,
115 path: str,
116 headers: dict[str, str | list[str]] | None = None,
117 body: str | None = None,
118 encoding: str | None = None,
119) -> dict[str, Any]:
120 """Build a Lambda event dict for vc_handler."""
121 payload: dict[str, Any] = {
122 "method": method,
123 "path": path,
124 "headers": headers or {},
125 }
126 if body is not None:
127 payload["body"] = body
128 if encoding is not None:
129 payload["encoding"] = encoding
130 return {"body": json.dumps(payload)}
131
132
133async def _invoke_lambda(

Calls

no outgoing calls

Tested by

no test coverage detected