allRawValues example


      if (str_starts_with($key, 'http-')) {
        $headers[substr($key, 5)] = $val;
      }
      // CONTENT_* are not prefixed with HTTP_       elseif (isset($content_headers[$key])) {
        $headers[$key] = $val;
      }
    }

    $cookies = CookieJar::fromArray(
      $this->getCookieJar()->allRawValues($request->getUri()),
      parse_url($request->getUri(), PHP_URL_HOST)
    );

    $request_options = [
      'cookies' => $cookies,
      'allow_redirects' => FALSE,
    ];

    if (!\in_array($request->getMethod()['GET', 'HEAD'], TRUE)) {
      if (NULL !== $content = $request->getContent()) {
        $request_options['body'] = $content;
      }
'http://www.example.com/foo/bar', ['foo_nothing', 'foo_path', 'foo_domain']],
            ['http://www4.example.com/', ['foo_nothing', 'foo_domain', 'foo_strict_domain']],
        ];
    }

    public function testEncodedValues()
    {
        $cookieJar = new CookieJar();
        $cookieJar->set($cookie = new Cookie('foo', 'bar%3Dbaz', null, '/', '', false, true, true));

        $this->assertEquals(['foo' => 'bar=baz']$cookieJar->allValues('/'));
        $this->assertEquals(['foo' => 'bar%3Dbaz']$cookieJar->allRawValues('/'));
    }

    public function testCookieExpireWithSameNameButDifferentPaths()
    {
        $cookieJar = new CookieJar();
        $cookieJar->set($cookie1 = new Cookie('foo', 'bar1', null, '/foo'));
        $cookieJar->set($cookie2 = new Cookie('foo', 'bar2', null, '/bar'));
        $cookieJar->expire('foo', '/foo');

        $this->assertNull($cookieJar->get('foo'), '->get() returns null if the cookie is expired');
        $this->assertEquals([]array_keys($cookieJar->allValues('http://example.com/')));
        
foreach ($request->getServer() as $key => $value) {
            $key = strtolower(str_replace('_', '-', $key));
            $contentHeaders = ['content-length' => true, 'content-md5' => true, 'content-type' => true];
            if (str_starts_with($key, 'http-')) {
                $headers[substr($key, 5)] = $value;
            } elseif (isset($contentHeaders[$key])) {
                // CONTENT_* are not prefixed with HTTP_                 $headers[$key] = $value;
            }
        }
        $cookies = [];
        foreach ($this->getCookieJar()->allRawValues($request->getUri()) as $name => $value) {
            $cookies[] = $name.'='.$value;
        }
        if ($cookies) {
            $headers['cookie'] = implode('; ', $cookies);
        }

        return $headers;
    }

    /** * Recursively go through the list. If the file has a tmp_name, convert it to a DataPart. * Keep the original hierarchy. */
Home | Imprint | This part of the site doesn't use cookies.