Hi guys, I have some trouble with iOS and webrequest. With android device and simulator no problem, but with iOS I received always error 415.
I realized an app for Nuki Smart Lock and this is a curl:
curl -X GET --header 'Accept: application/json' --header 'Authorization: Bearer
API_token' 'https://api.nuki.io/smartlock'
Translate in Monkey:
var url = "https://api.nuki.io/smartlock";
var params = {};
var options = {
:method => Communications.HTTP_REQUEST_METHOD_GET,
:headers => {
"Accept" => "application/json",
"Authorization" => "Bearer " + _apiToken
}
};
Communications.makeWebRequest(url, params, options, method(:onReceive));
I tried with:
"Content-Type" => Communications.REQUEST_CONTENT_TYPE_URL_ENCODED
in a :headers, but same results.
Do you have any idea?
Thanks