Xdata server request error

I've got an xdata server running & I'm accessing it successfully from web browser & my android app running on a phone (Huawei P20 Pro).

When I run the same app on a Nexus 5 every request fails with :

XData server request error.
Uri: eq 12345)
Status code: 400
Bad Request.

Any ideas how I can debug this ? Obviously the request is reaching the XData server. I tried running the server in debug mode hoping that an exception would be raised, but that doesn't happen.

Any help appreciated.
A bit more info.

I've found that some requests are working, for example :

myItem := XDataClient.Get<TMyItem>(1);

The problem appears on calls to List, eg :

myItemList := XDataClient.List<TMyItem>('$filter=(Name eq ''john'''));

It's strange how the code works on one phone, but not the other. I've now also tried it on a Nexus 7 tablet, which also fails.

Maybe the Android version ? My Huawei has Android 9 and the Nexus 5 has android 6. The Nexus 7 has Android 5.

I'm quite new to Android development, not sure if I need to do something to handle different Android versions.

Forgot to say that I'm using Delphi Rio, XData (latest), Sparkle (latest).

More Info :

The problem only occurs with calls to XDataClient.List<TMyType>() when a parameter is supplied (eg a $filter or $orderby). So I guess that somehow on these older android versions the parameters are not being sent to the server correctly.

Is there a good place to set a breakpoint in the server code in order to see the actual parameters received ?

Hi John, the very last topic in this forum deals with same issue:


Short answer, use:

myItemList := XDataClient.List<TMyItem>('$filter=' + TSparkleUtils.PercentEncode('(Name eq ''john''')));

Many thanks - working now.