doGetRequest method

Future<Response> doGetRequest(
  1. Uri uri, {
  2. User? user,
  3. QueryType? queryType,
})

Send a http get request to the specified uri. The data of the request (if any) has to be provided as parameter within the uri. The result of the request will be returned as string. By default the query will hit the PROD DB

Implementation

Future<http.Response> doGetRequest(
  Uri uri, {
  User? user,
  QueryType? queryType,
}) async {
  http.Response response = await http.get(
    uri,
    headers: _buildHeaders(
      user: user,
      isTestModeActive:
          OpenFoodAPIConfiguration.getQueryType(queryType) != QueryType.PROD,
    ),
  );

  return response;
}