Flutter http lib url encodes where clause as parameter

Hi, I am using flutter http lib to fetch data from my Backendless application. But when I try to use where clause as query parameter it gets URL encoded and not woking… any idea how to avoid this?

Hello, @milen-dimitrovK5.

Can you provide a reproducible example?

Best Regards, Nikita.

Sure, thanks for the response. My problem is that the http library for consuming Restful clients URL encodes the query parameters, but the Backendless REST API waits for them as plain text.

my code is pretty much trivial:

final response = await http.get(
Uri.https(
baseUrl,
endpoint,
queryParameters,
),
headers: defaultHeaders,
);

where query parameters are:
final queryParams = {
‘where’: ‘workingDate>=1643666400000 and workingDate<=1646085599999’;,
‘pageSize’: ‘100’,
‘offset’: offset.toString(),
};

expected from REST API:
https://…backendless.app/api/data/work_logs?where=workingDate>=1643666400000 and workingDate<=1646085599999’&pageSize=100&offset=0

Created by Dart http lib:
https://…backendless.app/api/data/work_logs?where=workingDate%3E%3D%271644569173183%27+and+workingDate%3C%3D%271644569173183%27&pageSize=100&offset=0

Why don’t you use our flutter-sdk for this?
We do not provide support with problems in third party libraries

I am using http lib in my app to consume other Restful services, and I think it is overkill to use the SDK for 2 calls that app needs :slight_smile: .

Sorry, we can’t provide support for third-party libraries. Contact the support of the authors of the library you are using.

Regards,
Stanislaw

Is there a way to avoid such formating of the where clause?

Backendless expects to receive raw whereClause, without encoding it. I don’t know how to avoid encoding in the lib you’re using. Try to google for preventing encode in this lib.

Regards,
Stanislaw