Redirection and Referers

Intuitively, the ' redirect’ request option is used to set the maximum number of redirections to process before automatically terminating. Not so intuitively, it defaults to 0, which means that processing of redirections is disabled and you must explicitly set this request option to a value greater than 0 to enable it.

The ' referer’ request option can be used to set the value of the Referer request header. Alternatively, it can be set via the 'headers’ request option (more on that shortly) when using the procedural API or the setHeaders and addHeaders methods of the HttpRequest class when using the object-oriented API.


© pecl_http PECL Extension — Web Scraping

>>> Back to TABLE OF CONTENTS <<<
Category: Article | Added by: Marsipan (31.08.2014)
Views: 341 | Rating: 0.0/0
Total comments: 0
avatar