default_settings
default_settings

Reputation: 490

Scrapy - is it possible to extract Payload Request from Response

is it possible to extract and set as variable the "Payload Request" which has been pushed in order to receive particular response?

Upvotes: 1

Views: 534

Answers (1)

renatodvc
renatodvc

Reputation: 2564

You can access the request object in the callback function by response.request. This object is the request object itself, so it contains everything you passed in the request. It doesn't have a "payload" attribute though.

The equivalent should be response.request.body, assuming you had a body in the request. Everything else is still there, headers, cookies, meta, method, etc

More on the params of request here.

Upvotes: 2

Related Questions