Skip to content

Add RestUpload::waiting() to set connect and read timeouts#37

Merged
thekid merged 1 commit intomasterfrom
feature/upload-timeouts
Mar 28, 2026
Merged

Add RestUpload::waiting() to set connect and read timeouts#37
thekid merged 1 commit intomasterfrom
feature/upload-timeouts

Conversation

@thekid
Copy link
Copy Markdown
Member

@thekid thekid commented Mar 28, 2026

Complements RestRequest::waiting() - see #24

use io\File;
use webservices\rest\Endpoint;

$file= new File($reference);

$endpoint= new Endpoint('https://api.example.com/v1');
$response= $endpoint->resource('images/edits')
  ->upload(method: 'POST')
  ->waiting(read: 600)
  ->transfer('images[]', $file->in(), $file->filename)
  ->pass('prompt', 'This image but all people are Simpsons characters')
  ->finish()
;

@thekid thekid added the enhancement New feature or request label Mar 28, 2026
@thekid thekid merged commit 6e06e3d into master Mar 28, 2026
16 checks passed
@thekid thekid deleted the feature/upload-timeouts branch March 28, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant