|
@@ -1,8 +1,6 @@
|
|
|
import 'dart:convert';
|
|
|
import 'package:dio/dio.dart' as dio;
|
|
|
-import 'package:fis_common/http/options.dart';
|
|
|
import 'package:flutter/foundation.dart';
|
|
|
-
|
|
|
import 'exception.dart';
|
|
|
import 'http_pool.dart';
|
|
|
import 'interceptor.dart';
|
|
@@ -56,7 +54,9 @@ class JsonRpcClientBase {
|
|
|
|
|
|
Future<dynamic> _transmit(JsonRpcRequest request) async {
|
|
|
final req = await jsonRpcInterceptHost.onRequestTransmit(request);
|
|
|
+
|
|
|
String package = jsonEncode(req.toJson());
|
|
|
+
|
|
|
var response = await _postRequest(package);
|
|
|
if (response == null) throw JsonRpcException(message: "Response Empty");
|
|
|
|
|
@@ -68,9 +68,9 @@ class JsonRpcClientBase {
|
|
|
try {
|
|
|
final httpClient = jrpcHttpPool.getClient(this.host,
|
|
|
timeout: this.timeout, headers: this.headers);
|
|
|
+
|
|
|
var response =
|
|
|
await httpClient.post('/${this.serviceName}', data: package);
|
|
|
- // if (response.statusCode != HttpStatus.ok) {
|
|
|
if (response.statusCode != 200) {
|
|
|
throw JsonRpcException(
|
|
|
message: "Http error.Status coder: ${response.statusCode}.");
|