API 傳檔改 等待 300秒 20250604
This commit is contained in:
parent
25652b0f57
commit
02dbbaf7db
@ -172,8 +172,9 @@ class ApiClient
|
|||||||
public function upload(string $endpoint, array $files = [], array $data = [])
|
public function upload(string $endpoint, array $files = [], array $data = [])
|
||||||
{
|
{
|
||||||
return $this->requestWithCatch(function () use ($endpoint, $files, $data) {
|
return $this->requestWithCatch(function () use ($endpoint, $files, $data) {
|
||||||
$request = $this->withDefaultHeaders();
|
$request = $this->withDefaultHeaders()
|
||||||
|
->timeout(300)
|
||||||
|
->connectTimeout(10);
|
||||||
foreach ($files as $key => $filePath) {
|
foreach ($files as $key => $filePath) {
|
||||||
$filename = basename($filePath);
|
$filename = basename($filePath);
|
||||||
$request = $request->attach($key, fopen($filePath, 'r'), $filename);
|
$request = $request->attach($key, fopen($filePath, 'r'), $filename);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user