I am developing an IoT (Internet of Things) application where the 'thing' is a Garmin Watch.
I am using a REST API (POST) provided by IBM Bluemix to send the information to the IoT dashboard. The problem is that this API call returns no data at all. It's just an event.
When calling the REST service using:
Comm.makeWebRequest("http://<Iot",
{"payload" => hr},
{
"Content-Type" => Comm.REQUEST_CONTENT_TYPE_JSON,
:headers => {
"Accept" => "application/json"
},
:method => Comm.HTTP_REQUEST_METHOD_POST
},
method(:onReceive));
}
I receive in my callback method an UnknowError (0). I have created a dummy service in Java and I have been able to reproduce the problem. When returning just the 200 return code (no output data), I get the UnknownError. I have writen something to the output stream in the server side, then everything goes fine in the Connect IQ simulator: the 200 return code arrives with the contents.
IMHO, the makeWebRequest should accept empty responses. Any ideas?
Thanks in advance.