requestForm method
call api latest bot api with upload file example:
requestForm("sendDocument", parameters: {
"chat_id": 123456,
"document": tg.file("./doc.json"),
"parse_mode": "html"
});
Implementation
Future<Map> requestForm(
String method, {
Map parameters = const {},
bool is_form = false,
String? tokenBot,
String? urlApi,
String? clientType,
void Function(int bytesCount, int totalBytes)? onUploadProgress,
bool isAutoExtendMessage = false,
bool isThrowOnError = true,
Client? httpClient,
}) async {
tokenBot ??= token_bot;
return await request(
method,
parameters: parameters,
is_form: true,
tokenBot: tokenBot,
urlApi: urlApi,
clientType: clientType,
onUploadProgress: onUploadProgress,
isAutoExtendMessage: isAutoExtendMessage,
isThrowOnError: isThrowOnError,
httpClient: httpClient,
);
}