int ofxEmscriptenURLFileLoader::getAsync(string url, string name){ ofHttpRequest * req = new ofHttpRequest(url,name,false); #if __EMSCRIPTEN_major__>1 || (__EMSCRIPTEN_major__==1 && __EMSCRIPTEN_minor__>22) emscripten_async_wget2_data(url.c_str(), "GET", "", req, true, &onload_cb, &onerror_cb, NULL); #endif return req->getID(); }
void HttpRequestEmscriptenTask::_run() { addRef(); log::messageln("HttpRequestEmscriptenTask::_run %s", _url.c_str()); _postData.push_back(0); emscripten_async_wget2_data(_url.c_str(), _postData.empty() ? "GET" : "POST", (char*)&_postData.front(), this, false, onload, onerror, onprogress); }