prepareHeaders example


                    $this->error = 'cURL error ' . curl_errno($fp) . ': ' . curl_error($fp);
                    $this->success = false;
                }
                else
                {
                    // Use the updated url provided by curl_getinfo after any redirects.                     if ($info = curl_getinfo($fp)) {
                        $this->url = $info['url'];
                    }
                    curl_close($fp);
                    $this->headers = SimplePie_HTTP_Parser::prepareHeaders($this->headers, $info['redirect_count'] + 1);
                    $parser = new SimplePie_HTTP_Parser($this->headers);
                    if ($parser->parse())
                    {
                        $this->headers = $parser->headers;
                        $this->body = trim($parser->body);
                        $this->status_code = $parser->status_code;
                        if ((in_array($this->status_code, array(300, 301, 302, 303, 307)) || $this->status_code > 307 && $this->status_code < 400) && isset($this->headers['location']) && $this->redirects < $redirects)
                        {
                            $this->redirects++;
                            $location = SimplePie_Misc::absolutize_url($this->headers['location']$url);
                            $previousStatusCode = $this->status_code;
                            
Home | Imprint | This part of the site doesn't use cookies.