Ok the problem is related to the http_get_result() function. If the string passed is to small it will cause this error.
Workaround:
Pass a string that is big enough for the data by replacing this part of the template:
STRING* httpResult = str_create("#10");
var length = http_get_result(httpId, httpResult);
if(length > 9)
{
str_remove(httpResult);
httpResult = str_create(str_printf(NULL, "#%d", (long)length + 1));
http_get_result(httpId, httpResult);
}
With this one:
STRING* httpResult = str_create("#100");
var length = http_get_result(httpId, httpResult);
This is how I will fix the bug:
http_get_result() will create and return a string, so it's not required to pass a string anymore. But the release of the new version will take some time (sorry).