github.com/.../progress.mc
It is same as street (s) in english in most cases optional.
you set:
var options = {
:responseType => Communications.HTTP_RESPONSE_CONTENT_TYPE_JSON,
:headers => {
"Content-Type" => Communications.REQUEST_CONTENT_TYPE_URL_ENCODED
}
};
so url has to be encoded and it isn't because there is a space " g."!
modify code to:
private var _url1 = Lang.format("">kauno-autai.herokuapp.com/.../$1$",[Communications.encodeURL(home)]);
private var _url2 = Lang.format("">kauno-autai.herokuapp.com/.../$1$",[Communications.encodeURL(work)]);
Hmm, that's very interesting, when I try to hardcode(or put into properties) url ending like:
private var _url1 = Lang.format("https://kauno-autai.herokuapp.com/stopActivity/$1$",["vilniaus"]); private var _url2 = Lang.format("https://kauno-autai.herokuapp.com/stopActivity/$1$",["utenos"]);
finally simulator runs smoothly. But as i am adding spaces or dots it fails. Also strange is that even with correct url(without conflicting characters) when using Communications.encodeURL() method it also fails to download.
However you finally found what crashes my code and I really appreciate that <3
of course
var _url1 = Lang.format(""vilniaus"]);">kauno-autai.herokuapp.com/.../$1$",["vilniaus"]);
gives you
>>>https://kauno-autai.herokuapp.com/stopActivity/vilniaus<<<
but in properties is Mituvos g. so it looks
>>>https://kauno-autai.herokuapp.com/stopActivity/Mituvos g.<<< and is space
and should be
>>>https://kauno-autai.herokuapp.com/stopActivity/Mituvos%20g<<<
in my opinion Communications.encodeURL() run bad becouse encodes /
Communications.encodeURL("kauno-autai.herokuapp.com/.../Mituvos g.");
gives
https%3A%2F%2Fkauno-autai.herokuapp.com%2FstopActivity%2FMituvos%20g.
end even chrome return error
When doing a makeWebRequest, you never want to have any param as part of the URL which looks to be the case here:
var _url1 = Lang.format(""vilniaus"]);">kauno-autai.herokuapp.com/.../$1$",["vilniaus"]);
All params should be in the params that are passed to the call
,["vilnaus"] is a param that's part of the url in the code you posted.
Not sure of the current state, but that would work with Android and not iOS for a long time.
no [] is the array to format
in my opinion Communications.encodeURL() run bad becouse encodes /
Yep, it should be called encodeURIComponent() (or something similar), to make it clear that you can't call it on a full URI/URL. Also, the proper usage should be documented, and there should be an example.
For example, javascript has both encodeURI() and encodeURIComponent(). encodeURI() is meant to encode full URLs, whereas encodeURIComponent() is meant to encode things like query string parameters. And the documentation explains in which situations each one should be used. The actual implementation difference is that encodeURIComponent() encodes ";,/?:@&=+$#" and encodeURI() does not.
Having said all of that, if you only get to choose one of those functions, you probably want encodeURIComponent's functionality, which is seemingly what Monkey C gives us.
I guess this problem is eventually solved. Thank you everyone