-
Notifications
You must be signed in to change notification settings - Fork 10.4k
New issue
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
Allow to add custom metadata to Response #1877
Comments
Almost the same issue: #1453 |
One workaround is to create custom Response subclasses and use The problem with this solution is that Scrapy sometimes constructs responses by itself, e.g. when retreiving from HTTP cache or when handling decompression. In this case original response class gets forgotten. |
I'd like to try to implement this, does anyone have any newer thoughts about it that could lead me in the right direction? |
#5131 seems to address this when defining |
Currently it is not possible to attach a custom attribute to Response in a middleware because
replace
method won't keep it. There are workarounds (e.g. putting objects to response.flags), but they are ugly.What do you think about adding an attribute to Response where user can put anything, similar to Request.meta?
The text was updated successfully, but these errors were encountered: