We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
data
Accessing Request.body() on a request constructed with RequestFactory where data={} raises RuntimeError.
Request.body()
RequestFactory
data={}
RuntimeError
No response
-console (starlite-py3.8) peter@peter-Inspiron-15-5510:~/PycharmProjects/starlite$ python -m asyncio asyncio REPL 3.8.15 (default, Oct 17 2022, 12:54:29) [GCC 9.4.0] on linux Use "await" directly instead of "asyncio.run()". Type "help", "copyright", "credits" or "license" for more information. >>> import asyncio >>> from starlite.testing import RequestFactory >>> await RequestFactory().post(data={}).body() Traceback (most recent call last): File "/home/peter/.pyenv/versions/3.8.15/lib/python3.8/concurrent/futures/_base.py", line 444, in result return self.__get_result() File "/home/peter/.pyenv/versions/3.8.15/lib/python3.8/concurrent/futures/_base.py", line 389, in __get_result raise self._exception File "<console>", line 1, in <module> File "/home/peter/PycharmProjects/starlite/starlite/connection/request.py", line 147, in body self._body = self.scope["_body"] = b"".join([c async for c in self.stream()]) # type: ignore[typeddict-unknown-key] File "/home/peter/PycharmProjects/starlite/starlite/connection/request.py", line 147, in <listcomp> self._body = self.scope["_body"] = b"".join([c async for c in self.stream()]) # type: ignore[typeddict-unknown-key] File "/home/peter/PycharmProjects/starlite/starlite/connection/request.py", line 119, in stream while event := await self.receive(): File "/home/peter/PycharmProjects/starlite/starlite/connection/base.py", line 40, in empty_receive raise RuntimeError() RuntimeError
1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See error
"![SCREENSHOT_DESCRIPTION](SCREENSHOT_LINK.png)"
main
The text was updated successfully, but these errors were encountered:
Fix #1419: Support RequestFactory with empty data (#1420)
6db69c7
support empty body in RequestFactory
Successfully merging a pull request may close this issue.
Description
Accessing
Request.body()
on a request constructed withRequestFactory
wheredata={}
raisesRuntimeError
.URL to code causing the issue
No response
MCVE
Steps to reproduce
Screenshots
"![SCREENSHOT_DESCRIPTION](SCREENSHOT_LINK.png)"
Logs
No response
Starlite Version
main
Platform
The text was updated successfully, but these errors were encountered: