-1

I have the response of instance I wanted to access the specific variable

I tried different combinations, using the arrow operator.

Client {#445 ▼
  -httpClient: Client {#460 ▼
   -client: Client {#469 ▼
   -config: array:7 [▼
    "handler" => HandlerStack {#459 ▶}
    "allow_redirects" => array:5 [▶]
    "http_errors" => true
    "decode_content" => true
    "verify" => true
    "cookies" => false
    "headers" => array:1 [▼
      "User-Agent" => "GuzzleHttp/6.3.3 curl/7.50.1 PHP/7.0.10"
    ]
  ]
}

I want to access the array variables like handler, verify and cookies.

James Wahlin
  • 2,811
  • 21
  • 22
Kapil Verma
  • 178
  • 3
  • 17

1 Answers1

0

You should be able to get the config from Guzzle Client using '$client->getConfig()' call (if $client is your \GuzzleHttp\Client instance).

Look at the code here: https://github.com/guzzle/guzzle/blob/6.3.3/src/Client.php#L134

Alexey Shokov
  • 4,775
  • 1
  • 21
  • 22