testGetRequest method
Test GET request
Implementation
Future<ApiResponse> testGetRequest({
Map<String, dynamic>? additionalParams,
}) async {
try {
FinanceSdkLogger.info('🧪 Starting GET Request Test');
const apiKey = 'TEST_GET_REQUEST';
final requestBody = additionalParams ?? {
'testUserId': '12345',
'testName': 'Finance SDK Test',
'timestamp': DateTime.now().millisecondsSinceEpoch.toString(),
};
FinanceSdkLogger.info('Test Parameters: $requestBody');
final response = await _httpService.sendRequest(
apiKey: apiKey,
requestBody: requestBody,
);
if (response.success) {
FinanceSdkLogger.info('✅ GET Test Passed');
FinanceSdkLogger.verbose('Response: ${response.data}');
} else {
FinanceSdkLogger.error('❌ GET Test Failed: ${response.error}');
}
return response;
} catch (e, stackTrace) {
FinanceSdkLogger.error('❌ GET Test Exception', e, stackTrace);
return ApiResponse.error('Test failed: ${e.toString()}');
}
}