scrapy post头有两个“ContentLength”字段

2024-09-30 08:34:17 发布

您现在位置:Python中文网/ 问答频道 /正文

当我使用scrapy.http.请求为了将空数据发布到特定的url,我总是发现scray发送的post头有两个“Content Length”字段,下面是我的请求代码:

    yield Request(
        self.url,
        self.parseReport,
        method='POST',
        headers=self.header,
        meta={'cookiejar': response.meta['cookiejar']}
    )

我的标题是:

^{pr2}$

我知道scrapy会自动附加“Content Length”字段,但是我的头不包含任何“Content Length”字段,并且捕获了数据包 wireshark表示post头有两个这样的文件,响应给出状态码400。 here is the post header screenshot。 有谁能帮上忙吗。在


Tags: 数据代码selfhttpurlrequestcontentpost

热门问题