API 傳檔調整邏輯 20250604
This commit is contained in:
parent
fbc627b11a
commit
39872d5aac
@ -171,10 +171,11 @@ class ApiClient
|
||||
|
||||
public function upload(string $endpoint, array $files = [], array $data = [])
|
||||
{
|
||||
$this->setTimeout(300);
|
||||
$this->setConnectTimeout(10);
|
||||
return $this->requestWithCatch(function () use ($endpoint, $files, $data) {
|
||||
$request = $this->timeout(300)
|
||||
->connectTimeout(300)
|
||||
->withDefaultHeaders();
|
||||
$request = $this->withDefaultHeaders();
|
||||
|
||||
foreach ($files as $key => $filePath) {
|
||||
$filename = basename($filePath);
|
||||
$request = $request->attach($key, fopen($filePath, 'r'), $filename);
|
||||
|
Loading…
x
Reference in New Issue
Block a user