iOS Question ResponseError: unsupported URL, status code: 0

Tomas Petrus

Active Member
Licensed User
Longtime User
In B4i version of the app I am geting
B4X:
ResponseError: unsupported URL, status code: 0

whenever I am passing in URL empty spaces....
I need to pass empty spaces in URL because I am calling external api service and AFAIK it needs to be done by GET (to this service).

in this case I am passing for example
"Jungmannovo náměstí, Praha, Česko"

replace spaces to "%20" didnt help

found this:
https://www.b4x.com/android/forum/threads/httpjob-error-solved.101700/#content

and this:

And I have checked and I have 2.81 ...
What are my options now ? : ))

In B4A the exactly same code works without any problems.
 

Tomas Petrus

Active Member
Licensed User
Longtime User
B4X:
Sub PlacesAutocompleteView2_ItemClick (Place As PlaceData)
    Private link As String ="https://xxxxxxxxxxxxxxxxxxxx.json?app_id=xxxxxxxxxxxxx&app_code=xxxxxxxxxxxxxxx&searchtext=" & Place.Description
    LogColor(link,Colors.Magenta)
    Dim j As HttpJob
    j.Initialize("", Me)
    j.Download(link)
    Wait For (j) JobDone(j As HttpJob)
    If j.Success Then
        LogColor(j.GetString, Colors.green)
        Dim jp As JSONParser
        jp.Initialize(j.GetString)
        Dim m As Map = jp.NextObject
        Dim m1 As Map = m.Get("Response")
       
        Dim ViewList As List
        ViewList.Initialize
        ViewList.AddAll(m1.Get("View"))
        m1 = ViewList.get(0)
        ViewList.Clear
        ViewList.AddAll(m1.Get("Result"))
        m1 = ViewList.get(0)
        m1 = m1.Get("Location")
        m1 = m1.Get("DisplayPosition")
       
        NaseptNoClickPnl.Visible = False
        Vystup.Text = Place.Description
        zakVystupGPS1 = m1.Get("Longitude")
        zakVystupGPS2 = m1.Get("Latitude")
    End If
    j.Release
End Sub
 
Upvote 0
Top