spHttpRequest function
Future
spHttpRequest({
- required HttpRequestType httpRequestType,
- required String path,
- dynamic payload,
Implementation
Future spHttpRequest({
required HttpRequestType httpRequestType,
required String path,
dynamic payload,
}) async {
switch (httpRequestType) {
case HttpRequestType.get:
return shurjoPayserviceLocator<SPDioService>().dio.get(
path,
);
case HttpRequestType.post:
return shurjoPayserviceLocator<SPDioService>().dio.post(
path,
data: payload,
);
case HttpRequestType.put:
return shurjoPayserviceLocator<SPDioService>().dio.put(
path,
data: payload,
);
case HttpRequestType.delete:
return shurjoPayserviceLocator<SPDioService>().dio.delete(
path,
data: payload,
);
}
}