request method

Future<Map<String, dynamic>> request(
  1. String url,
  2. Map<String, dynamic> params, {
  3. required NetworkMethodType method,
  4. bool absoluteUrl = false,
  5. bool isRawResponse = false,
  6. bool isSimpleResponse = false,
  7. bool isNeedAutoSetupDeviceInfo = true,
  8. bool isUseMemoryCache = false,
  9. String? cacheKey,
  10. Map<String, String>? customHeaders,
  11. List<String>? ignoreErrorCodes,
})

Http request.

  • url .
  • params The MapObj of HTTP Body.
  • method NetworkMethodType.
  • isRawResponse Returning the response raw data directly.
  • isSimpleResponse The 'data' could be null or SimpleType at the response value.
  • isNeedAutoSetupDeviceInfo Automatic invoking the _setupDeviceInfoIfNeeded.
  • ignoreErrorCodes The response codes that will not be recognize.

Implementation

Future<Map<String, dynamic>> request(
    String url, Map<String, dynamic> params, {
      required NetworkMethodType method,
      bool absoluteUrl = false,
      bool isRawResponse = false,
      bool isSimpleResponse = false,
      bool isNeedAutoSetupDeviceInfo = true,
      bool isUseMemoryCache = false,
      String? cacheKey,
      Map<String, String>? customHeaders,
      List<String>? ignoreErrorCodes,
    }) async {
  return _request.request(
    url,
    params,
    method: method,
    absoluteUrl: absoluteUrl,
    isRawResponse: isRawResponse,
    isSimpleResponse: isSimpleResponse,
    isNeedAutoSetupDeviceInfo: isNeedAutoSetupDeviceInfo,
    isUseMemoryCache: isUseMemoryCache,
    customHeaders: customHeaders,
    cacheKey: cacheKey,
    ignoreErrorCodes: ignoreErrorCodes,
  );
}