XData List query error -1002 from MacOS


I've been wrestling with this sill problem for a couple of days! After getting my XDataClient authentication working, I wanted to try a client application. The first thing it does is a filter query, like:

lLoginUsers := fXClient.List<TUserlogin>('$filter=username eq ''' + lUsername + '''');

This works fine on Windows, but when I ran it on the Mac, I was greeted by an EMacHttpNoDataException. Unsupported URL (-1002). StackOverflow spoke about a malformed URL, so I put some logging in, which showed my URL looked okay.
I tried again without the filter, and the query worked. So the problem was with the filter. Since StackOverflow mentioned spaces in the URL, I substituted the spaces in my filter with the string %20. Now the filter works!

Just thought I'd let you know!

Regards and thanks,
Pat Heuvel

Dear Mr. Heuvel,

Indeed, the "problem" is that Windows does that job automatically for you. But ideally you should do it yourself, percent encoding the query string:

lLoginUsers := fXClient.List<TUserlogin>('$filter=' + TSparkleUtils.PercentEncode('username eq ''' + lUsername + ''''));

I should have realised you guys would've had that covered! Thanks very much!

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.