Can i inherit the twisted.web.http.Request.requestReceived ??
![](https://secure.gravatar.com/avatar/fac5b9a908202b64d29d723fb7637406.jpg?s=120&d=mm&r=g)
Can i inherit the twisted.web.http.Request.requestReceived ?? In the comment, said that "This method is not intended for users". I has inherited the rawDataReceived and it like this: def rawDataReceived(self, data): self.resetTimeout() if len(data) < self.length: self.requests[-1].content.send(data) self.length = self.length - len(data) else: self.requests[-1].content.send(data[:self.length]) self._finishRequestBody(data[self.length:]) the "self.requests[-1].content.send(data)" will send the data in another http connection. In fact, i use the httplib here. All goes well, but it doesn't work at the last step in allContentReceived. And it's req.requestReceived(command, path, version). So can i inherit this method requestReceived. Or where is it go wrong? my code is here. You can download it. http://pan.baidu.com/share/link?shareid=569597&uk=926264233
![](https://secure.gravatar.com/avatar/607cfd4a5b41fe6c886c978128b9c03e.jpg?s=120&d=mm&r=g)
On 07:36 am, xxy-php@qq.com wrote:
Can i inherit the twisted.web.http.Request.requestReceived ??
Subclasses inherit all methods from base classes automatically. So I don't see what would stop you from inheriting this method if you subclass twisted.web.http.Request. You might get more helpful information if you explain what you actually want to achieve, though. See http://www.catb.org/esr/faqs/smart- questions.html and http:/sscce.org/ for some tips.
my code is here. You can download it. http://pan.baidu.com/share/link?shareid=569597&uk=926264233
Unfortunately I can't read the UI on that page, so I can't actually download it. A good example will fit inline in an email, though. Jean-Paul
participants (2)
-
exarkun@twistedmatrix.com
-
小学园PHP