diff --git a/django-stubs/http/request.pyi b/django-stubs/http/request.pyi index f92e651e3..1fbe7df72 100644 --- a/django-stubs/http/request.pyi +++ b/django-stubs/http/request.pyi @@ -10,7 +10,7 @@ from django.core.files import uploadedfile, uploadhandler from django.urls import ResolverMatch from django.utils.datastructures import CaseInsensitiveMapping, ImmutableList, MultiValueDict from django.utils.functional import cached_property -from typing_extensions import Self, override +from typing_extensions import Reader, Self, override RAISE_ERROR: object host_validation_re: Pattern[str] @@ -42,7 +42,7 @@ class HttpHeaders(CaseInsensitiveMapping[str]): @classmethod def to_asgi_names(cls, headers: Mapping[str, Any]) -> dict[str, Any]: ... -class HttpRequest: +class HttpRequest(Reader[bytes]): GET: _ImmutableQueryDict POST: _ImmutableQueryDict COOKIES: dict[str, str] diff --git a/django-stubs/http/response.pyi b/django-stubs/http/response.pyi index 4d9bfcf72..51ca5122a 100644 --- a/django-stubs/http/response.pyi +++ b/django-stubs/http/response.pyi @@ -7,7 +7,7 @@ from typing import Any, Literal, NoReturn, TypeVar, overload, type_check_only from django.utils.datastructures import CaseInsensitiveMapping, _PropertyDescriptor from django.utils.functional import _StrOrPromise, cached_property -from typing_extensions import override +from typing_extensions import Writer, override class BadHeaderError(ValueError): ... @@ -21,7 +21,7 @@ class ResponseHeaders(CaseInsensitiveMapping[str]): def pop(self, key: str, default: _Z = ...) -> _Z | tuple[str, str]: ... def setdefault(self, key: str, value: str | bytes | int) -> None: ... -class HttpResponseBase: +class HttpResponseBase(Writer[str | bytes]): status_code: int streaming: bool cookies: SimpleCookie