MCPcopy Index your code
hub / github.com/github/copilot-sdk / _build_httpx_request

Function _build_httpx_request

python/copilot/copilot_request_handler.py:674–687  ·  view source on GitHub ↗
(exchange: _CopilotRequestExchange)

Source from the content-addressed store, hash-verified

672
673
674async def _build_httpx_request(exchange: _CopilotRequestExchange) -> httpx.Request:
675 import httpx
676
677 header_pairs = [
678 (name, value)
679 for name, values in exchange.headers.items()
680 if name.lower() not in _FORBIDDEN_REQUEST_HEADERS
681 for value in (values or [])
682 ]
683 method = exchange.method.upper()
684 has_body = method not in ("GET", "HEAD")
685 body = await _drain_async(exchange.request_body)
686 content = body if (has_body and body) else None
687 return httpx.Request(method, exchange.url, headers=header_pairs, content=content)
688
689
690async def _drain_async(stream: AsyncIterator[bytes]) -> bytes:

Callers 1

_handle_httpMethod · 0.85

Calls 2

_drain_asyncFunction · 0.85
RequestMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…