MCPcopy
hub / github.com/encode/starlette / request

Method request

starlette/testclient.py:429–468  ·  view source on GitHub ↗
(  # type: ignore[override]
        self,
        method: str,
        url: httpx._types.URLTypes,
        *,
        content: httpx._types.RequestContent | None = None,
        data: _RequestData | None = None,
        files: httpx._types.RequestFiles | None = None,
        json: Any = None,
        params: httpx._types.QueryParamTypes | None = None,
        headers: httpx._types.HeaderTypes | None = None,
        cookies: httpx._types.CookieTypes | None = None,
        auth: httpx._types.AuthTypes | httpx._client.UseClientDefault = httpx._client.USE_CLIENT_DEFAULT,
        follow_redirects: bool | httpx._client.UseClientDefault = httpx._client.USE_CLIENT_DEFAULT,
        timeout: httpx._types.TimeoutTypes | httpx._client.UseClientDefault = httpx._client.USE_CLIENT_DEFAULT,
        extensions: dict[str, Any] | None = None,
    )

Source from the content-addressed store, hash-verified

427 yield portal
428
429 def request( # type: ignore[override]
430 self,
431 method: str,
432 url: httpx._types.URLTypes,
433 *,
434 content: httpx._types.RequestContent | None = None,
435 data: _RequestData | None = None,
436 files: httpx._types.RequestFiles | None = None,
437 json: Any = None,
438 params: httpx._types.QueryParamTypes | None = None,
439 headers: httpx._types.HeaderTypes | None = None,
440 cookies: httpx._types.CookieTypes | None = None,
441 auth: httpx._types.AuthTypes | httpx._client.UseClientDefault = httpx._client.USE_CLIENT_DEFAULT,
442 follow_redirects: bool | httpx._client.UseClientDefault = httpx._client.USE_CLIENT_DEFAULT,
443 timeout: httpx._types.TimeoutTypes | httpx._client.UseClientDefault = httpx._client.USE_CLIENT_DEFAULT,
444 extensions: dict[str, Any] | None = None,
445 ) -> httpx.Response:
446 if timeout is not httpx.USE_CLIENT_DEFAULT:
447 warnings.warn(
448 "You should not use the 'timeout' argument with the TestClient. "
449 "See https://github.com/Kludex/starlette/issues/1108 for more information.",
450 StarletteDeprecationWarning,
451 stacklevel=2,
452 )
453 url = self._merge_url(url)
454 return super().request(
455 method,
456 url,
457 content=content,
458 data=data,
459 files=files,
460 json=json,
461 params=params,
462 headers=headers,
463 cookies=cookies,
464 auth=auth,
465 follow_redirects=follow_redirects,
466 timeout=timeout,
467 extensions=extensions,
468 )
469
470 def get( # type: ignore[override]
471 self,

Calls

no outgoing calls

Tested by

no test coverage detected