Multipart-HTTP-Konfiguration mit Zieladresse, Feldern, Headern und optionalen Chunks.
TxHttpUploadConfig
| Parameter | Typ | Standard | Bedeutung |
|---|---|---|---|
| url | Uri | erforderlich | Zieladresse des Uploadservers. |
| fieldName | String | 'file' | Multipart-Feldname der Datei. |
| headers | Map<String, String> | const {} | Zusätzliche HTTP-Header. |
| fields | Map<String, String> | const {} | Zusätzliche Multipart-Textfelder. |
| chunkSize | int? | null | Chunkgröße in Bytes; muss positiv sein. |
| chunkFields | Map<String, String> Function(TxFile, int, int)? | null | Felder je Chunk; Index ist nullbasiert. |
import 'package:tecexpress/tecexpress.dart';
Future<void> example() async {
final config = TxHttpUploadConfig(url: Uri.parse('https://example.com/api/upload'), fieldName: 'file', chunkSize: 1024 * 1024);
final adapter = txHttpUpload(config);
print(adapter);
}