Skip to content

Add RestUpload::with($headers) and RestUpload::including($cookies)#38

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

Add RestUpload::with($headers) and RestUpload::including($cookies)#38
thekid merged 1 commit intomasterfrom
feature/upload-headers

Conversation

@thekid
Copy link
Copy Markdown
Member

@thekid thekid commented Mar 28, 2026

Consisten with RestRequest::with($headers) and RestRequest::inluding($cookies).

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')
  ->with(['X-Request-ID' => $requestId])
  ->including(['session_id' => $sessionId])
  ->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 a806d90 into master Mar 28, 2026
16 checks passed
@thekid thekid deleted the feature/upload-headers branch March 28, 2026 15:19
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