Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. HttpClientKernel.php

function HttpClientKernel::getHeaders

1 call to HttpClientKernel::getHeaders()
HttpClientKernel::handle in vendor/symfony/http-kernel/HttpClientKernel.php
Handles a Request to convert it to a Response.

File

vendor/symfony/http-kernel/HttpClientKernel.php, line 96

Class

HttpClientKernel
An implementation of a Symfony HTTP kernel using a "real" HTTP client.

Namespace

Symfony\Component\HttpKernel

Code

private function getHeaders(Request $request) : array {
    $headers = [];
    foreach ($request->headers as $key => $value) {
        $headers[$key] = $value;
    }
    $cookies = [];
    foreach ($request->cookies
        ->all() as $name => $value) {
        $cookies[] = $name . '=' . $value;
    }
    if ($cookies) {
        $headers['cookie'] = implode('; ', $cookies);
    }
    return $headers;
}
RSS feed
Powered by Drupal