Re-using HTTP_Request2 for multiple requests
[email protected] (Christian Weiske)
| Newsgroups | php.pear.general |
|---|---|
| Message-ID | <20131024083758.35542f2e@cyberdyne> |
Hi, I'm using HTTP_Request2 to do several consecutive HTTP requests (HEAD, GET and POST) in Services_Linkback[1]. To be able to customize the request object and e.g. set custom SSL or proxy options, applications can do a > setRequest(HTTP_Request2 $req) call in the linkback object. This request object is then used to do all the requests. When using it in stapibas[2], my standalone pingback server, I noticed that POST data are kept+re-used during requests, even if the next request is a HEAD or a GET request. My solution is now to only use clones of the request object, because the HTTP_Request2 doesn't offer a "reset" option. Is this the correct solution, or is there a hidden reset method I didn't see? [1] https://github.com/pear2/Services_Linkback [2] http://git.cweiske.de/stapibas.git/ -- Regards/Mit freundlichen Grüßen Christian Weiske -= Geeking around in the name of science since 1982 =-