Hope somebody can explain this
If I enter this URL in my browser
http://md5.jsontest.com/?text=example_text
I get the expected response
{
"md5": "fa4c6baa0812e5b5c80ed8885e55a8a6",
"original": "example_text"
}
The following code works as expected on the same URL, returning the above response and Job.Success = True
All well and good so far.
If I repeat the experiment with a differeint URL,
http://www.songsterr.com/a/ra/songs.json?pattern=adel
The response in the browser is a long JSON string, starting
[{"id":398570,"type":"Song","title":"Weinen","artist":{"id":53119,"type":"Artist", ...
However, this PostString call
returns Job.Success = False
What am I doing wrong? Any pointers would be appreciated
If I enter this URL in my browser
http://md5.jsontest.com/?text=example_text
I get the expected response
{
"md5": "fa4c6baa0812e5b5c80ed8885e55a8a6",
"original": "example_text"
}
The following code works as expected on the same URL, returning the above response and Job.Success = True
B4X:
Sub Activity_Create(FirstTime As Boolean)
Dim job1 As HttpJob
job1.Initialize("Job1", Me)
job1.PostString("http://md5.jsontest.com/", "text=example_text") 'works as expected
End Sub
Sub JobDone (Job As HttpJob)
Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
If Job.Success = True Then
Select Job.JobName
Case "Job1"
Log(Job.GetString)
End Select
Else
Log("Error: " & Job.ErrorMessage)
ToastMessageShow("Error: " & Job.ErrorMessage, True)
End If
Job.Release
End Sub
All well and good so far.
If I repeat the experiment with a differeint URL,
http://www.songsterr.com/a/ra/songs.json?pattern=adel
The response in the browser is a long JSON string, starting
[{"id":398570,"type":"Song","title":"Weinen","artist":{"id":53119,"type":"Artist", ...
However, this PostString call
B4X:
job1.PostString("http://www.songsterr.com/a/ra/songs.json", "pattern=adel")
returns Job.Success = False
What am I doing wrong? Any pointers would be appreciated