Hi all,
Basically I'm attempting to post data to the URL expecting a JSON object. But i keep hetting the "Error: not found" message. Any ideas on why It's not working please?
Basically I'm attempting to post data to the URL expecting a JSON object. But i keep hetting the "Error: not found" message. Any ideas on why It's not working please?
B4X:
Sub justrun
Dim postProdJob As HttpJob
Dim m As Map
postProdUrl = "http://146.231.88.170:8080/reedhousesystemsitsafricaweb/service/art/add-product/"
m.Initialize
m.Put("id", 1)
m.Put("profile", "Frank Lucas")
m.Put("name", "Zululand")
m.Put("dimension", "4 x 5 x 7")
m.Put("price", 550)
m.Put("description", "NA")
m.Put("type", "Carving")
m.Put("quantity", 4)
Dim JSONGenerator As JSONGenerator
JSONGenerator.Initialize(m)
postProdJob.Initialize("PostProd", Me)
postProdJob.PostString(postProdUrl, JSONGenerator.ToString())
postProdJob.Release
End Sub
Sub JobDone (Job As HttpJob)
Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
If Job.Success = True Then
Select Job.JobName
Case "PostProd"
Log(Job.GetString)
End Select
Else
Log("Error: " & Job.ErrorMessage)
ToastMessageShow("Error: " & Job.ErrorMessage, True)
End If
Job.Release
End Sub