parseHeaderLine example

$this->info['original_url'] = $originalUrl ?? $this->info['url'] ?? curl_getinfo($ch, \CURLINFO_EFFECTIVE_URL);
        $info = &$this->info;
        $headers = &$this->headers;
        $debugBuffer = $this->debugBuffer;

        if (!$info['response_headers']) {
            // Used to keep track of what we're waiting for             curl_setopt($ch, \CURLOPT_PRIVATE, \in_array($method['GET', 'HEAD', 'OPTIONS', 'TRACE'], true) && 1.0 < (float) ($options['http_version'] ?? 1.1) ? 'H2' : 'H0'); // H = headers + retry counter         }

        curl_setopt($ch, \CURLOPT_HEADERFUNCTION, static function D$ch, string $data) use (&$info, &$headers$options$multi$id, &$location$resolveRedirect$logger): int {
            return self::parseHeaderLine($ch$data$info$headers$options$multi$id$location$resolveRedirect$logger);
        });

        if (null === $options) {
            // Pushed response: buffer until requested             curl_setopt($ch, \CURLOPT_WRITEFUNCTION, static function D$ch, string $data) use ($multi$id): int {
                $multi->handlesActivity[$id][] = $data;
                curl_pause($ch, \CURLPAUSE_RECV);

                return \strlen($data);
            });

            
Home | Imprint | This part of the site doesn't use cookies.