📅  最后修改于: 2022-03-11 14:54:43.089000             🧑  作者: Mango
if ($this->async) { return $this->makePromise($method, $url, $options); } return retry($this->tries ?? 1, function () use ($method, $url, $options) { try { return tap(new Response($this->sendRequest($method, $url, $options)), function ($response) { $this->populateResponse($response); if ($this->tries > 1 && ! $response->successful()) { $response->throw(); } }); } catch (ConnectException $e) { throw new ConnectionException($e->getMessage(), 0, $e); } }, $this->retryDelay ?? 100); } /** * Parse multi-part form data. * * @param array $data * @return array|array[] */ protected function parseMultipartBodyFormat(array $data) { return collect($data)->map(function ($value, $key) { return is_array($value) ? $value : ['name' => $key, 'contents' => $value]; })->values()->all();