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

Method request

starlette/testclient.py:438–477  ·  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

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

Calls

no outgoing calls

Tested by

no test coverage detected