loads a file from a URL using an HTTP request
More...
#include <ofURLFileLoader.h>
|
virtual | ~ofBaseURLFileLoader () |
|
virtual ofHttpResponse | get (const std::string &url)=0 |
| make an HTTP request blocks until a response is returned or the request times out
|
|
virtual int | getAsync (const std::string &url, const std::string &name="")=0 |
| make an asynchronous HTTP request will not block, placed in a queue and run using a background thread
|
|
virtual ofHttpResponse | saveTo (const std::string &url, const of::filesystem::path &path)=0 |
| make an HTTP request and save the response data to a file blocks until a response is returned or the request times out
|
|
virtual int | saveAsync (const std::string &url, const of::filesystem::path &path)=0 |
| make an asynchronous HTTP request and save the response data to a file will not block, placed in a queue and run using a background thread
|
|
virtual void | remove (int id)=0 |
| remove an active HTTP request from the queue
|
|
virtual void | clear ()=0 |
| clear all active HTTP requests from the queue
|
|
virtual void | stop ()=0 |
| stop & remove all active and waiting HTTP requests
|
|
virtual ofHttpResponse | handleRequest (const ofHttpRequest &request)=0 |
| low level HTTP request implementation blocks until a response is returned or the request times out
|
|
virtual int | handleRequestAsync (const ofHttpRequest &request)=0 |
|
loads a file from a URL using an HTTP request
◆ ~ofBaseURLFileLoader()
virtual ofBaseURLFileLoader::~ofBaseURLFileLoader |
( |
| ) |
|
|
inlinevirtual |
◆ clear()
virtual void ofBaseURLFileLoader::clear |
( |
| ) |
|
|
pure virtual |
◆ get()
virtual ofHttpResponse ofBaseURLFileLoader::get |
( |
const std::string & |
url | ) |
|
|
pure virtual |
make an HTTP request blocks until a response is returned or the request times out
- Parameters
-
url | HTTP url to request, ie. "http://somewebsite.com/someapi/someimage.jpg" |
- Returns
- HTTP response on success or failure
◆ getAsync()
virtual int ofBaseURLFileLoader::getAsync |
( |
const std::string & |
url, |
|
|
const std::string & |
name = "" |
|
) |
| |
|
pure virtual |
make an asynchronous HTTP request will not block, placed in a queue and run using a background thread
- Parameters
-
url | HTTP url to request, ie. "http://somewebsite.com/someapi/someimage.jpg" |
name | optional key to use when sorting requests |
- Returns
- unique id for the active HTTP request
◆ handleRequest()
low level HTTP request implementation blocks until a response is returned or the request times out
- Returns
- HTTP response on success or failure
Implemented in ofURLFileLoaderImpl.
◆ handleRequestAsync()
virtual int ofBaseURLFileLoader::handleRequestAsync |
( |
const ofHttpRequest & |
request | ) |
|
|
pure virtual |
◆ remove()
virtual void ofBaseURLFileLoader::remove |
( |
int |
id | ) |
|
|
pure virtual |
◆ saveAsync()
virtual int ofBaseURLFileLoader::saveAsync |
( |
const std::string & |
url, |
|
|
const of::filesystem::path & |
path |
|
) |
| |
|
pure virtual |
make an asynchronous HTTP request and save the response data to a file will not block, placed in a queue and run using a background thread
- Parameters
-
url | HTTP url to request, ie. "http://somewebsite.com/someapi/someimage.jpg" |
path | file path to save to |
- Returns
- unique id for the active HTTP request
◆ saveTo()
virtual ofHttpResponse ofBaseURLFileLoader::saveTo |
( |
const std::string & |
url, |
|
|
const of::filesystem::path & |
path |
|
) |
| |
|
pure virtual |
make an HTTP request and save the response data to a file blocks until a response is returned or the request times out
- Parameters
-
url | HTTP url to request, ie. "http://somewebsite.com/someapi/someimage.jpg" |
path | file path to save to |
- Returns
- HTTP response on success or failure
◆ stop()
virtual void ofBaseURLFileLoader::stop |
( |
| ) |
|
|
pure virtual |
The documentation for this class was generated from the following file: