getUri static method
Returns a OFF uri with the OpenFoodAPIConfiguration specified settings
Typical use-case of "addUserAgentParameters
= false" is for other
request than GET, e.g. POST or MULTIPART, where we add the user agent
parameters in another part of the code.
Implementation
static Uri getUri({
required final String path,
final Map<String, String>? queryParameters,
final QueryType? queryType,
final bool addUserAgentParameters = true,
final String? userInfo,
}) =>
Uri(
scheme: OpenFoodAPIConfiguration.uriScheme,
host: OpenFoodAPIConfiguration.getQueryType(queryType) == QueryType.PROD
? OpenFoodAPIConfiguration.uriProdHost
: OpenFoodAPIConfiguration.uriTestHost,
path: path,
queryParameters: addUserAgentParameters
? HttpHelper.addUserAgentParameters(queryParameters)
: queryParameters,
userInfo: userInfo,
);