Skip to content

ofUrlFileLoader progress function#8507

Open
NickHardeman wants to merge 1 commit intoopenframeworks:masterfrom
NickHardeman:feature-url-progress
Open

ofUrlFileLoader progress function#8507
NickHardeman wants to merge 1 commit intoopenframeworks:masterfrom
NickHardeman:feature-url-progress

Conversation

@NickHardeman
Copy link
Contributor

It's rather hidden, but super handy.

ofURLFileLoader floader;
ofHttpRequest req;
req.progressCallback = [](const ofHttpRequest & req, float progress) {
	ofLogNotice("ofApp") << "http progress: " << progress;
};
req.url = "https://openframeworks.cc/about/0.jpg";
req.method = ofHttpRequest::GET;
req.timeoutSeconds = 60;
ofHttpResponse res = floader.handleRequest(req);
if (res.status != 200) {
	ofLogError("ofApp") << "Image download failed";
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant