Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
482 B
3
Indexable
Never

$fileContents = Storage::get('path_to_your_file');
$response = Http::withBasicAuth($username,$password)->post('api_endpoint', [
    'multipart' => [
        [
            'name'     => 'file_field_name',
            'contents' => $fileContents,
            'filename' => 'desired_filename.ext',
        ],
        [
            'name'     => 'text_field_name', 
            'contents' => 'Your text input value',
        ],
        // You can add more fields as needed
    ],
]);