I'm trying to post some json data to a web service, but it seems something is wrong and the web service doesn't accept the data.
My code :
B4X:
Dim job1 As HttpJob
job1.Initialize("Job1", Me)
Dim objMap As Map: objMap.Initialize
objMap.Put("id",123)
objMap.Put("params","XXX,YYY")
objMap.Put("method","apiLogin")
Dim objJSon As JSONGenerator: objJSon.Initialize(objMap)
job1.PostString("https://SITEADDRESS/api/jsonrpc/1_0", objJSon.ToPrettyString(2))
And the error from server :
B4X:
Catchable fatal error: Argument 1 passed to Zend_Json_Server_Request::setOptions() must be an array, null given, called in ...
Notice that the job2.GetRequest.SetContentType is always at the end. If I pull it from here and put it in the GetRequest Sub it throws an error every time. Any thoughts?