connect_timeout

摘要

表示等待服务器响应超时的最大值,使用 0 将无限等待 (默认行为).

类型

float

默认值

0

常量

GuzzleHttp\RequestOptions::CONNECT_TIMEOUT

  1. // Timeout if the client fails to connect to the server in 3.14 seconds.
  2. $client->request('GET', '/delay/5', ['connect_timeout' => 3.14]);