SparkOut wrote: ↑Mon Aug 23, 2021 4:59 pm
Now I have seen on a computer rather than phone, I can spot that you are using json data in the GET url.
This I think must be a limitation of the libUrl equivalent on Android.
I have made a few quick trials with urlEncoded filters and substituting html entities but not successfully. Is there a method in the API that you can submit the GET string with filters defined as name=value pairs rather than json?
This may well be the case, however I do not understand why it works with Indy and not Community. My view, it is a defect and as such I will raise a bug request.
In the meantime, I have worked out another way to access the data. The api also provides an SQL access path, so I have gone down that path to get the data I need.
For interest, this is what it ended up as:
Code: Select all
put "2103" into tPC -- comment this variable would normally be supplied by UI
if tPC = "ALL" then
put empty into tPCFilter
else
put "and%20postcode%20=%20%27" into tPCFilter
put tPC after tPCFilter
put "%27" after tPCFilter
end if
put "https://data.nsw.gov.au/data/api/3/action/datastore_search_sql?sql=SELECT%20postcode,%20lga_name19,%20notification_date,%20likely_source_of_infection%20from%20%222776dbb8-f807-4fb2-b1ed-184a6fc2c8aa%22%20WHERE%20lga_name19%20%3C%3E%20%27null%27%20" into tQuery
put tPCFilter after tQuery
put "ORDER%20BY%20notification_date,postcode" after tQuery
answer information "JSON Query: " & tQuery
put url (tQuery) into myJSONVar
put the result into theError
if theError is empty then
answer information "No error found in https query"
else
answer information "An error occurred:" && theError & "." -- this does not seem to work
end if