Bug? HttpJob Download Get bug?

boastrike

Member
Licensed User
I am using the Download method of an HttpJob problem with no problems at all in most cases. However there is one URL that is providing some strange error. When I create this same request using both native code, Xamarin F#, or simply paste the URL in a browser I have no problems at all. The URL is this

http://sos.homedns.org/Api/StoneColdApi/?queryName=select_orders&parameters=%,2014-12-8,_

Here is an example of a URL that works with HttpJob

http://sos.homedns.org/Api/StoneColdApi/?queryName=select_orders&parameters=PS,2014-12-8,0

B4X:
Sub SubmitButton_Click
    OrderSource = "%"
    CartID = "_"

    Dim selectOrdersHttp As HttpJob
    selectOrdersHttp.Initialize("selectOrders", Me)

    selectOrdersHttp.Download("http://sos.homedns.org/Api/StoneColdApi/?queryName=select_orders&parameters=" & OrderSource & "," & DatePicker.GetSelectedItem(2) & "-" & (DatePicker.GetSelectedRow(0) + 1) & "-" & DatePicker.GetSelectedItem(1) & "," & CartID)
End Sub

Sub JobDone (Job As HttpJob)
    Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
    If Job.Success = True Then
        Select Job.JobName
            Case "selectOrders"
                selectOrders(Job.GetString)
            Case "selectOrderDetail"
                selectOrderDetail(Job.GetString)
        End Select
    Else
        Log("Error: " & Job.ErrorMessage)
        Toast.ToastMessageShow("Error: " & Job.ErrorMessage, True)
    End If
    Job.Release
End Sub
There is no "error". This is what the debug pane says.

Application_Start
Application_Active
Error response: , status code: 0
JobName = selectOrders, Success = false
Error: The operation couldn’t be completed. (NSURLErrorDomain error -1002.)
 

moster67

Expert
Licensed User
You may have illegal characters in your string URL. Have you tried to URL encode the string (URL)? See the iStringUtils-library:

EncodeUrl (TextToEncode As String, CharSet As String) As String
Encodes a string into application/x-www-form-urlencoded format.
 
Top